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

Issue 135123011: Introduce cache of resolved names in library (Closed)

Created:
6 years, 10 months ago by hausner
Modified:
6 years, 10 months ago
Reviewers:
siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Ivan Posva
Visibility:
Public.

Description

Introduce cache of resolved names in library A name that is not resolved in the local scope gets looked up in the global scope of the library to which the code being compiled belongs. The local name dictionary gets searched first, then the dictionary of each imported library (and and their re-exported libraries.) Each dictionary lookup includes the lookup of the mangled getter and setter names, which means that we concatenate the same name many times. This change introduces a cache that stores the result of a previous name lookup, including negative lookup results. The latter is important to speed up the resolution of names that are not in the global name space, e.g. class members like .length in lists. Experiments running dart2js (with VM option --compile_all) show that this reduces the number of name mangling calls by a factor of 10 and speeds up compiling dart2js by 15%. R=asiva@google.com Committed: https://code.google.com/p/dart/source/detail?r=32385

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -77 lines) Patch
M runtime/vm/compiler_stats.h View 1 2 chunks +5 lines, -1 line 0 comments Download
M runtime/vm/compiler_stats.cc View 1 2 chunks +11 lines, -0 lines 0 comments Download
M runtime/vm/debugger.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/object.h View 1 3 chunks +18 lines, -1 line 0 comments Download
M runtime/vm/object.cc View 1 12 chunks +159 lines, -19 lines 0 comments Download
M runtime/vm/parser.h View 1 1 chunk +0 lines, -6 lines 0 comments Download
M runtime/vm/parser.cc View 1 4 chunks +8 lines, -48 lines 0 comments Download
M runtime/vm/raw_object.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/resolver.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
hausner
6 years, 10 months ago (2014-02-05 23:34:09 UTC) #1
siva
lgtm https://codereview.chromium.org/135123011/diff/1/runtime/vm/object.cc File runtime/vm/object.cc (right): https://codereview.chromium.org/135123011/diff/1/runtime/vm/object.cc#newcode7915 runtime/vm/object.cc:7915: AddResolvedName(name, obj); AddToResolvedNamesCache would be a more readable ...
6 years, 10 months ago (2014-02-06 21:01:29 UTC) #2
hausner
Thank you. https://codereview.chromium.org/135123011/diff/1/runtime/vm/object.cc File runtime/vm/object.cc (right): https://codereview.chromium.org/135123011/diff/1/runtime/vm/object.cc#newcode7915 runtime/vm/object.cc:7915: AddResolvedName(name, obj); On 2014/02/06 21:01:29, siva wrote: ...
6 years, 10 months ago (2014-02-06 21:31:45 UTC) #3
hausner
Committed patchset #2 manually as r32385 (presubmit successful).
6 years, 10 months ago (2014-02-06 21:32:37 UTC) #4
rmacnak
6 years, 10 months ago (2014-02-07 18:44:03 UTC) #5
Message was sent while issue was closed.
On 2014/02/06 21:32:37, hausner wrote:
> Committed patchset #2 manually as r32385 (presubmit successful).

Sped up cold access to the mirror system by 50% too!

Powered by Google App Engine
This is Rietveld 408576698