i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER
This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/2450713004 .
Eliminate the need to invoke an execute-once function to compute
type literals and implicit closures. This reduces the number of
execute-once invocations from 6000 to 60 when compiling all of
the greentea sources, about 1MB of generated code. Sadly, no
significant runtime gain was observed.
Also simplify the caching of computed compile-time constants.
Reinstate the compiler stat counter for number of constants cached.
BUG=
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/2338463003 .
Instead of one array for literal and identifier tokens for each TokenStream, share one array among all TokenStreams in an isolate.
The shared array and the token-to-index map is stored in the object store until the embedder is done loading. Then the map is thrown away (and the array remains shared, referred to by the TokenStreams).
When new files get loaded, a new shared array is created. For temporary scripts, e.g. when evaluating one-shot functions, the token arrays are not shared.
This eliminates many duplicate LiteralToken and identifier tokens. Looking at the core libraries:
Before: 30877 identifiers and 9618 literal tokens
After: 12899 identifiers and 6371 literal tokens
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org/1420103006 .
Prints the stats into a zone-allocated string that can either be dumped to the console, or displayed as a whole in the observatory.
Distinguish token consumption between class parsing and function parsing when compiling.
Change stat counter macros use thread instead of isolate.
Review URL: https://codereview.chromium.org//1300033002 .
Compile-time constant values are maintained in a cache, keyed
by script and token position. When the same code is compiled
again later, e.g. by the optimizing compiler, the value is
found in the cache and does not need to be computed again.
In this version, the key is a string concatenated from the
script url and the token position. That’s probably more overhead
than we want.
Added two compiler stat counters for number of cached constants
and number of cache hits. Running dart2js to compile a hello world
program results in about 1400 cached values and 85 cache hits.
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org//1308073005 .
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
Review URL: https://codereview.chromium.org//135123011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32385 260f80e4-7a28-3924-810f-c04153c831b5
On standalone dartium which has about 50000 tokens in the libraries (core, coreimpl, builtin, io etc.) this reduces the heap size by about 180kb. The size of the standalone snapshot buffer reduces by about 72kb.
Also moved the keyword symbol table to the object store so that it does not have to repopulated on every script compilation. Should benefit regular user script load times.
Review URL: https://chromiumcodereview.appspot.com//9462003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@4734 260f80e4-7a28-3924-810f-c04153c831b5