Commit Graph

25 Commits

Author SHA1 Message Date
Aart Bik 0f506ba3ae Added period to comment for consistency.
Rationale:
Getting familiar with the Dart workflow.

Bug: none
Change-Id: If145b28fd3d6868b2208fa0239fd3ea5a88e79b9
Reviewed-on: https://dart-review.googlesource.com/55584
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-05-21 19:04:38 +00:00
Ryan Macnak 65d7bf8152 [vm] Align 64-bit atomic variables for 32-bit iOS.
Change-Id: I2bbe637fce59bd5d84f7db8a44960e36fe63d2d9
Reviewed-on: https://dart-review.googlesource.com/53822
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-05-07 18:37:12 +00:00
Ryan Macnak d9c3190e44 [vm] Remove some bin -> vm includes.
Change-Id: Id304de9618a299a201b946a901a54352772f56fb
Reviewed-on: https://dart-review.googlesource.com/48704
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-28 23:16:09 +00:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zachary Anderson 103881d01c Make header include guards great again
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 .
2016-10-26 00:26:03 -07:00
Matthias Hausner 3829c00e10 Improve compile time constant evaluation
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 .
2016-09-12 16:23:00 -07:00
Srdjan Mitrovic 1a9fc8b2fa Move CompilerStats from isolate to thread. Aggregate stats.
The mutator thread holds the aggregate values, the background compiler adds its value to it.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1841213003 .
2016-03-30 13:38:32 -07:00
John McCutchan fda3a9bc2b Remove more things
(stripped) dart_product before: 5307888
(stripped) dart_product after: 5275088

Reduction in size: 32800 bytes.

Removed entirely:

- debuginfo*
- elfgen*
- gdbjit*
- TraceBuffer
- vtune support

Removed in product:

- Compiler stats
- Code observers

R=asiva@google.com

Review URL: https://codereview.chromium.org/1711163002 .
2016-02-22 08:53:11 -08:00
Matthias Hausner 59dce43dfe Shared token objects
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 .
2015-10-28 16:02:58 -07:00
Srdjan Mitrovic 8915fb6fde More work for background compilation; move pending_functions_ from ObjectStore to Thread.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1409173002 .
2015-10-16 17:02:43 -07:00
Matthias Hausner bb097ec37f Add benchmark output to compiler stats.
Add two compiler stats benchmarks to unit tests

Sample output:
xcodebuild/ReleaseIA32/run_vm_tests  CorelibCompilerStats
NumberOfTokens: 271148
NumClassesParsed: 730
NumFunctionsCompiled: 8987
NumFunctionsOptimized: 0
NumFunctionsParsed: 9694
NumTokensScanned: 0 tokens
ScannerTime: 0 ms
ScannerSpeed: 0 tokens/ms
NumTokensParsed: 531066 tokens
ParserTime: 262 ms
ParserSpeed: 2026 tokens/ms
NumTokensCompiled: 433816 tokens
CompilerTime: 648 ms
CompilerSpeed: 668 tokens/ms
CodeSize: 4428 KB
CodeDensity: 138 tokens/KB
InstrSize: 3127 KB
CorelibCompilerStats(RunTime): 694788

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1352483002 .
2015-09-16 11:18:31 -07:00
Matthias Hausner d3a2f619bb Fix compiler stats
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 .
2015-09-04 13:13:56 -07:00
Matthias Hausner 62e9d05668 Introduce per-isolate cache for compile time constants
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 .
2015-08-26 16:17:20 -07:00
Daniel Andersson 00ef260503 Enable concurrent optimization test after migrating scopes to Thread*
Also move static call target table allocation into old space.

Note that stats are not thread-safe, so running two compilers concurrently may lead to inaccurate stats.

BUG=https://github.com/dart-lang/sdk/issues/24109

Review URL: https://codereview.chromium.org//1291803009 .
2015-08-19 15:16:47 -07:00
hausner@google.com feae1f7b82 Compute accurate token count when loading from snapshot
With --compiler-stats, traverse heap at isolate shutdown to
find all token streams and compute the number of tokens in
the stream. This fixes incorrect token counts when loading
from snapshot.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1131493007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45806 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 00:11:01 +00:00
hausner@google.com 9db5059098 Fix CompilerStats info
Move the counters and timers into the isolate. Statically allocated data
does not work anymore now that we always have multiple isolates.

Remove unused counters, add some counters to measure size of compiled code
and meta info.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1127383008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45751 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 23:03:48 +00:00
iposva@google.com 4c07af2487 - Ensure that all names in local scopes are symbols.
- Avoid calling Equals when comparing names in local scopes.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//190753004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33443 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 19:37:04 +00:00
hausner@google.com 295b7fd5b2 Eliminate more implicit getters
For some reason I don’t remember, we only attempt to optimize
away the implicit getter functions of const and final static
fields, but not non-final static fields. This change applies the
same optimization for all static fields, and also for all
top-level fields.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//189583003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33433 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 16:20:11 +00:00
hausner@google.com ac559f643a 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

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
2014-02-06 21:32:31 +00:00
zerny@google.com 0bc2e84cb3 Restructure code generation timers and add sub-timers for inlining phases.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//11236063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13927 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 08:14:59 +00:00
srdjan@google.com 953daeaf89 Add more timing information.
Review URL: https://chromiumcodereview.appspot.com//10116012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6697 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 15:53:20 +00:00
srdjan@google.com 242b4facdd Measure code generation time as well.
Review URL: https://chromiumcodereview.appspot.com//10084014

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6534 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 17:39:07 +00:00
asiva@google.com 33d2e2fe26 Changes to shrink the token stream representation from two words to one word.
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
2012-02-29 02:46:29 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00