-
Notifications
You must be signed in to change notification settings - Fork 0
Dwarf reader sort translation units #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
myxoid
wants to merge
3
commits into
master
Choose a base branch
from
dwarf-reader-sort-translation-units
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0e301d6 to
3b2ca8b
Compare
3b2ca8b to
4847c98
Compare
4847c98 to
ccc7db0
Compare
ccc7db0 to
85b67d7
Compare
e2380ad to
b58f9b6
Compare
b58f9b6 to
618c199
Compare
618c199 to
6481f26
Compare
6481f26 to
63d6a22
Compare
myxoid
added a commit
that referenced
this pull request
Sep 29, 2020
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
63d6a22 to
82f711f
Compare
myxoid
added a commit
that referenced
this pull request
Oct 6, 2020
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
82f711f to
a21788a
Compare
myxoid
added a commit
that referenced
this pull request
Nov 6, 2020
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
a21788a to
28fa545
Compare
28fa545 to
c87fdc7
Compare
myxoid
added a commit
that referenced
this pull request
Nov 16, 2020
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
myxoid
added a commit
that referenced
this pull request
Nov 30, 2020
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
c87fdc7 to
7b0a968
Compare
7b0a968 to
1a8af70
Compare
myxoid
added a commit
that referenced
this pull request
Feb 16, 2021
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
myxoid
added a commit
that referenced
this pull request
Mar 23, 2021
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
1a8af70 to
465038c
Compare
myxoid
added a commit
that referenced
this pull request
Mar 31, 2021
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
2094939 to
8bfc4c0
Compare
myxoid
added a commit
that referenced
this pull request
Apr 6, 2021
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
8bfc4c0 to
e5a8ecd
Compare
myxoid
added a commit
that referenced
this pull request
Apr 16, 2021
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
e5a8ecd to
be29c60
Compare
myxoid
added a commit
that referenced
this pull request
May 7, 2021
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
be29c60 to
a7f2353
Compare
myxoid
added a commit
that referenced
this pull request
May 26, 2021
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
myxoid
added a commit
that referenced
this pull request
Jun 11, 2021
Ignore this commit message, it's all been squashed. The intermediate commits no longer passed the test suite, perhaps due to types where the recursion ended up with a type on the left side of an equality later appearing on the right. ------------------------------>CUT<------------------------------ > This is the 1st commit message: Function types don't introduce new names so cannot cause self references and so there is no need to track currently being compared function types. Typedefs do introduce new names but cannot refer directly to themselves or be forward-declared. Enums introduce new names but cannot refer to anything other than integral types. Therefore each self reference must be via a class, struct or union type. This commit removes the extra logic for function types. Note that this short-cutting could actually be done at every level of type comparison but it's unknown whether this would buy any performance advantage. * src/abg-ir.cc (struct environment::priv): Drop member fn_types_being_compared_. (mark_as_being_compared): Drop function_type overload. (unmark_as_being_compared): Likewise. (comparison_started): Likewise. (equals): In the function_type overload, inline and remove the RETURN macro, bearing in mind that its argument was almost always false and the unmark_as_being_compared method is gone. (types_are_being_compared): Remove the code relating to function types being compared. > This is the commit message #2: abg-ir.cc: Adjust assertions around being-compared types This commit adjust the assertions in the code that tracks in-progress type comparisons. The mark/unmark operations should be strictly paired and it should never be possible to pass a null pointer. * src/abg-ir.cc (unmark_as_being_compared): Adjust doc comment to reflect that the methods expect to find the type marked. In the overload that does the removal, assert that this happened. In the overload taking a plain pointer, remove the null pointer test. (comparison_started): In the class_or_union overload taking a plain pointer, remove the null pointer test. (mark_as_being_compared): Do something else. TBcompleted. Signed-off-by: Giuliano Procida <gprocida@google.com> > This is the commit message #3: Mark/unmark/test comparisons part 1 > This is the commit message #4: Record both types being compared. The current code that compares types has protection against infinite recursion. It works as follows. For types which can introduce recursion (function types - hang on, can they really? - and class/union types), a set of currently currently being compared types is maintained and if a type is seen again, the equality test automatically short-cuts to true. The tests use of set containing both the left and right side of the comparison and checks test for either. The difference between this and the more correct insertion and checking of pairs may be nil or non-existent but the storage requirements are likely to be almost identical. The bracketed push/pop behaviour means we can assert stronger invariants on the code and only need to manipulate the top of a stack. Using a vector over a set likely has a performance advantage as the number of elements is typically very small. - max size in test suite 10 pairs - max size in kernel ABI 6 pairs - typical max size 2-3 pairs This commit switches from sets of single pointers to vectors of pairs of pointers. Signed-off-by: Giuliano Procida <gprocida@google.com>
a7f2353 to
030d7a3
Compare
030d7a3 to
8b71a6d
Compare
8b71a6d to
b8ff538
Compare
b8ff538 to
6b09fb7
Compare
6b09fb7 to
f598d26
Compare
This commit switches all the annotation tests and most of the DWARF reader tests to output with hash-based type ids. This is to make later code changes that affect ABI output easier to review. The first nine DWARF reader tests remain duplicated with both SEQUENCE_TYPE_ID_STYLE and HASH_TYPE_ID_STYLE. Signed-off-by: Giuliano Procida <gprocida@google.com>
A common source of kernel ABI churn is the movement of type declarations between abi-instr XML elements. While it may be possible to fix this in the longer term by moving types to a dedicated section of ABI XML, a short-term fix would make reviewing ABI changes less painful. It is suspected that translation unit order within a corpus may contribute to this issue. This commit imposes a deterministic order. Some of the variations in test output may point to latent bugs. Signed-off-by: Giuliano Procida <gprocida@google.com>
Signed-off-by: Giuliano Procida <gprocida@google.com>
f598d26 to
9827eef
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Attempt to increase determinism