DescriptionRewrite DeclarationResolver to match declarations to elements by order rather than offset.
Previously, DeclarationResolver matched declarations to elements using their offsets in the file. This meant that it could not work with element models built from a summary, since those element models are not guaranteed to contain offsets. Now, DeclarationResolver assumes that elements appear in the same order in the element model as they do in the file, so it can just match them up using their order.
DeclarationResolver continues to verify element names as it does its matching, so if the ordering of elements ever fails to match up with the ordering of declarations, an exception is almost certain to be thrown. (The only time it wouldn't be is if the mismatch can't be detected due to multiple elements having the same name).
The new implementation is ~1.6x faster than the previous one.
R=brianwilkerson@google.com, scheglov@google.com
Committed: https://github.com/dart-lang/sdk/commit/524a7da14146a4e2ea0db22ff197d56cb5d06a5c
Patch Set 1 #
Messages
Total messages: 9 (3 generated)
|