DescriptionIntroduce 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 : #
Messages
Total messages: 5 (0 generated)
|