Adds:
- dart2aot, a script similar to dart2js which compiles my.dart to my.dart.aot.
- dartaotruntime, a minimal Dart runtime that only runs AOT blobs.
- some extra tooling like gen_kernel and gen_snapshot used by the above.
- build rules for all of the above, including adding it to the full SDK builds.
Bug:https://github.com/dart-lang/sdk/issues/27596
Change-Id: Ic35f832b2b86be959212b8d21cfc5a082da5ced4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97627
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
In the VM-specific async transformation, an index is used to generate
fresh temporary names for values that are live across an await.
Before it was always 0 when translating a statement because there are
no live values on entry or exit to a statement.
When translating statements nested inside block expressions there can
be live values, so the index should not be reset.
Closes https://github.com/dart-lang/sdk/issues/36466
Change-Id: I6103d75c25f312ab1538a7c0f8fee0fea9f01b27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98664
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Change-Id: I82036fa3babc65ffa96f56309b073dd72f07c6f6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98695
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
AllocateClosure bytecode is used to convey information about closure
function into an instance allocation site. This allows VM inliner to see
closure function very early at the optimization pipeline and enables
inlining of closure calls.
DeltaBlueClosures in JIT/bytecode mode (--use-bytecode-compiler):
Before: DeltaBlueClosures(RunTime): 1746.5404424083767 us.
After: DeltaBlueClosures(RunTime): 1291.4649496449324 us.
Issue: https://github.com/dart-lang/sdk/issues/36342
Issue: https://github.com/dart-lang/sdk/issues/36429
Issue: https://github.com/dart-lang/sdk/issues/36428
Change-Id: I6e94cdc2eb30110b0651a86bd2bdc40dcdd63207
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98439
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
I was adding default constructor to classes and found another problem
with shadowing exported declarations with local ones - we shadow
the class, but not its constructor. So, I'm changing it to keep
constructors and enum constants in corresponding parent declaratiosn.
R=brianwilkerson@google.com
Change-Id: I4e49b57f9fe1ac8bf611f241d2c279c746ad55ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
When tests are executed on certain configurations like dartkb or simarm,
the test script is first compiled into a dill file, so the VM command
line for running a test looks like
dart .../generated_compilations/dartkb/foo_test/out.dill
Certain tests have the logic to replace '_test.dart' in Platform.script
with '_test_body.dart' and execute the resulting script.
However, as out.dill does not contain '_test.dart', the script remains
the same after replacement. As a result, test was infinitely re-executing
itself, overloading bots and not making any progress.
Change-Id: I7257d3553a7f0a0de2f6d8218a9eb5c8981af17d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98685
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
To support this, we need to download the current version during gclient
sync, and change the way the --use-abi-version flag is processed so that
there's a distinction between the current version and the flag being
unset (-1). Also bump the oldest supported ABI version.
Bug: https://github.com/dart-lang/sdk/issues/36047
Change-Id: If3fb5e1ba1ebddf11e9f0a9a7c42b7bb0b820ad8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98609
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Before this CL the range analysis was only constraining bounds for the
JIT-based CheckArrayBounds. This CL enables doing the same for
GenericCheckBound by extracting a common base class and make the range
analysis use it
Issue https://github.com/dart-lang/sdk/issues/35154
Change-Id: Ie23b297ea0b133dd9dee2cff460cd9f24301152f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98460
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Thread assert enable flag through in dart2js to make the dart2js cfe
constant evaluation unit test properly pass the flag.
Fixes https://github.com/dart-lang/sdk/issues/36454
Change-Id: Ie4ac86ce96feda1548120fed54ece9ca03387496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98570
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
This is used in constant evaluation to represent const constructor
invocations with unevaluated field values or asserts.
Change-Id: I1d2d60a18f967a4dd195b3b5895db9a126c47803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98561
Reviewed-by: Kevin Millikin <kmillikin@google.com>
I added TODOs for removing the old code after the constants update has landed.
Change-Id: Icde8d68e4e7c4b51e9536f09ce4e514e3b00336d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98661
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
This is the first CL which takes advantage of the newly added inner
pointer in the RawTypedDataBase in a polymorphic way (so far this
pointer was only used if we knew the object is external typed data).
Issue https://github.com/dart-lang/sdk/issues/35154
Change-Id: I80f915774aa650b7943bd6b4a1d5ffdcb7952b21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98571
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The two existing places where IR is built are changed to use this new
helper. It supports running normal JIT/AOT passes as well as a
user-specified set of passes.
In order to allow vm/cc tests to make assertions about AOT pipeline this CL
enables the DART_PRECOMPILER define in run_vm_tests binary (similar to
gen_snapshot, run_vm_tests has now JIT and AOT support)
Change-Id: Ib51a024a81e0291e89d20860b8b9a2762611426c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98482
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Bytecode format version 2 was introduced Feb 05 2019 in
https://dart-review.googlesource.com/c/sdk/+/91108
This change cleans up code related to old constant pool entries which
were removed in v2.
Change-Id: Ic9cccd2fdec26758f377691bf4edc26d1309a524
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98610
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Rationale:
We should test for *empty* stack. As written, we basically
never generate OSR points for the bytecode path except for
the cases we can' handle yet :-)
https://github.com/dart-lang/sdk/issues/36421
Change-Id: Ie70a626f9fd24d63442e681ab120087f9d1b010b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98625
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
In bytecode we track null-initialized fields for each constructor,
so there is no need to record stores to such fields eagerly.
This enables more accurate tracking of fields which don't have initializer
or initialized with null, but they are always overwritten by initializers
in constructors.
Change-Id: I08edc65c18a644f69109f0eced736e5e859f1715
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98624
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This helps triage/resolve various issues in testRuntimeErrors:
* for_non_bool_condition_test isolates the code causing a crash on the
dart2js-production-linux-d8 configuration. (See
https://github.com/dart-lang/sdk/issues/36442 and the status file.)
* for_null_condition_test will be an approved failure for all dart2js
configurations due to https://github.com/dart-lang/sdk/issues/36446.
* for_runtime_error_test contains all the remaining expected type
errors. On the dart2js-production-linux-d8 configuration (which runs
with -O3), we assume no type errors exist - even ones guarded by
Expect.throwsTypeError - so the optimized code produces runtime errors
instead. See https://dart-review.googlesource.com/c/sdk/+/97820 for a
similar discussion.
* for_test contains the remaining tests, which are valid on all dart2js
configurations.
Change-Id: Ifef4f7d2e27e2731cdd4a3fec03754ea63b6328d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98606
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This prepares the compiler to accept a modular mode that contains several
libraries as user-code locations
Change-Id: I04f6c1fe36eea23de79b3573855896c560996fe1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98457
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>