Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Issue 2419633002: Rewrite DeclarationResolver to match declarations to elements by order rather than offset. (Closed)

Created:
4 years, 2 months ago by Paul Berry
Modified:
4 years, 2 months ago
CC:
reviews_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Rewrite 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+333 lines, -434 lines) Patch
M pkg/analyzer/lib/src/generated/declaration_resolver.dart View 16 chunks +333 lines, -434 lines 0 comments Download

Messages

Total messages: 9 (3 generated)
Paul Berry
Note: this CL is not ready to land yet (we would need to first modify ...
4 years, 2 months ago (2016-10-12 19:32:38 UTC) #3
scheglov
LGTM
4 years, 2 months ago (2016-10-13 00:45:03 UTC) #4
Brian Wilkerson
lgtm
4 years, 2 months ago (2016-10-13 13:37:04 UTC) #5
scheglov
I looked into IncrementalCompilationUnitElementBuilder implementation, and it already keeps order or nodes and elements in ...
4 years, 2 months ago (2016-10-13 16:00:48 UTC) #6
Paul Berry
On 2016/10/13 16:00:48, scheglov wrote: > I looked into IncrementalCompilationUnitElementBuilder implementation, and it > already ...
4 years, 2 months ago (2016-10-13 16:09:59 UTC) #7
Paul Berry
4 years, 2 months ago (2016-10-13 19:25:00 UTC) #9
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
524a7da14146a4e2ea0db22ff197d56cb5d06a5c (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698