Commit Graph

15405 Commits

Author SHA1 Message Date
Samir Jindel 773bea1774 [vm] Mark compilation_trace_test as Slow.
Even when it passes, it often reaches close to the timeout threshold.

Change-Id: I7bd668fe41c287c39554a8bece43c2061884131c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99023
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-04-10 12:48:36 +00:00
Daco Harkes 741b1f501f [vm/dbc] Implement CheckNull for DBC and enable optimizations
Closes: https://github.com/dart-lang/sdk/issues/36457

Change-Id: I20277a192456c91ff5d22929e4f4d9856ac6c176
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98673
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-04-10 11:40:16 +00:00
Dmitry Stefantsov 4ab4545ff7 [cfe] Add type and file offset to constant expressions
Closes #36471.

Bug: http://dartbug.com/36471
Change-Id: I5ac294057f2f69f1a8edfdf1106f65908fc257ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98677
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2019-04-10 09:55:36 +00:00
Aart Bik b76694386a [dart/fuzzer] Exclude Platform from API table
Rationale:
Using Platform strings and other features is
too subject to divergences between the different
execution modes. Nothing useful is tested here.
Change-Id: Icb96b0a6891d1b45b831fb17fa1d9d2cd7b77b6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98948
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-10 01:07:51 +00:00
Devon Carew 1bc1e483e0 Fix a typo in the service protocol docs.
Change-Id: Ib2299023c8284e39976cbf8bae8d0edf2a13d330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98800
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-04-09 23:31:21 +00:00
Ben Konyi 15b11b0183 [ VM / Service / Observatory ] The VM service now requires an authentication code by default.
Previously, a valid web socket connection would use the following URI:

`ws://127.0.0.1/ws`

Now, by default, the VM service requires a connection to be made with a
URI similar to the following:

`ws://127.0.0.1:8181/Ug_U0QVsqFs=/ws`

where `Ug_U0QVsqFs` is an authentication code generated and shared by the
service.

This behavior can be disabled with the `--disable-service-auth-codes`
flag.

Change-Id: I288aac58e3ba9d35dca8071f3f7e7a073896c271
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98433
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-04-09 22:57:29 +00:00
Alexander Aprelev 01c44ffc9a [vm/compiler] Don't restore errors we are ignoring.
In particular branch offset errors on arm result in another round of compilation in "far offset" mode.
We don't want to restore those branch offset errors.

Fixes https://github.com/dart-lang/sdk/issues/36478.

Change-Id: Iaaacc9b2e617bd582fa55e49ff676bf6266cdbe5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98705
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-09 21:52:57 +00:00
Ryan Macnak 0feba40c4b [vm] Further fixes to the interpreter for ProfilerDartStackWalker.
Adjust type of Interpreter::pc_ to reduce casting.

Change-Id: I3b2098068fb4f6b5bd5cb552a857a985a06dafb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98922
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-09 20:57:47 +00:00
Ryan Macnak 819214707b [vm] Fix crash in compilation trace loading while speculatively resolving instance calls.
Some functions have a null ic_data_array even after being compiled.

Bug: FL-232
Change-Id: I03bb3d8e47b793a42222aed632a514cd2ac9e376
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98944
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-09 20:09:47 +00:00
asiva 78c55022b1 [VM] - Fix for issue 36484 exposed when ExperimentalFlag.constantUpdate2018 is turned on in CFE
When ExperimentalFlag.constantUpdate2018 is turned on the static const
fields of _LocalMethodMirror are not yet set when VerifyMethodKindShifts
is invoked, ensure these fields are initialized before verifying the
values against the C++ values.

Fixes https://github.com/dart-lang/sdk/issues/36484

Change-Id: Ia144ee88c0a946e2d8824a6ee0d32bf96b2c163f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98962
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-04-09 18:12:27 +00:00
Ryan Macnak 46ebc493b8 [vm] Some fixes to the interpreter for ProfilerDartStackWalker.
Change-Id: If0e57ac397936400199c5571fe4358b39c1fd312
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98872
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-08 23:26:39 +00:00
Aart Bik b805c80c9d [dart/vm] fixed typo in "Unknown symbol"
Change-Id: I805d1012ad4f35ed177074b30c532159f79439e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98908
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-08 23:01:29 +00:00
Alexander Markov de6a7feb24 [vm] Add assertion to check if number of type arguments was calculated before setting type parameters
Issue: https://github.com/dart-lang/sdk/issues/36391
Change-Id: I615fa7f30c4745578c91425a2139908d7bd75c09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98362
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-08 20:20:49 +00:00
Ryan Macnak 93b4c5ca57 [vm] Improve error message for Dart_PropagateError with no exit frame.
Change-Id: Ic8aeba9344d800b443061d6ac538a87b5f5e2bc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98865
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-08 19:04:13 +00:00
Martin Kustermann 27a58d455d [vm/aot] Remove special casing of td views, allow external/internal typed data to be fast as well in string decoding
This improves the binary protobuf decoding benchmark by 6% on x64/arm64
and 17% on arm32.

Issue https://github.com/dart-lang/sdk/issues/35154

Change-Id: I23ba48b79b6e2a7698707f81ae4122cb9590ed2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98844
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-04-08 15:06:03 +00:00
Martin Kustermann 8e4dcf48c4 [vm/compiler/aot] Fix unboxing of int32/uint32 in typed data specializer
Issue https://github.com/dart-lang/sdk/issues/36521

Change-Id: I206a16479f734bf757b4641ca51adc7a42040888
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98841
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-08 14:56:00 +00:00
Daco Harkes 8e0a669e74 Revert "[vm] Refactor Location to use either dart::Register or dart::host::Register"
This reverts commit 60b3643e8e.

Reason for revert: Broke Windows+simulator builds. (Template instantiation checks are different on Windows than on Linux/MacOS)

Original change's description:
> [vm] Refactor Location to use either dart::Register or dart::host::Register
> 
> Refactoring motivation: go/dart-simulated-ffi
> 
> * template Location and PairLocation with <dart::Register, dart::FpuRegister> or <dart::host::Register, dart::host::FpuRegister>
> * move RegisterName and FpuRegisterName from assembler to constants
> 
> Change-Id: I266b97ef1f0493c184f4486c7a0482845d4ac644
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97312
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>

TBR=vegorov@google.com,sjindel@google.com,dacoharkes@google.com

Change-Id: I8b4721e3ddbe1d32c3b553555064868bce5ea089
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98843
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-04-08 10:28:12 +00:00
Daco Harkes 60b3643e8e [vm] Refactor Location to use either dart::Register or dart::host::Register
Refactoring motivation: go/dart-simulated-ffi

* template Location and PairLocation with <dart::Register, dart::FpuRegister> or <dart::host::Register, dart::host::FpuRegister>
* move RegisterName and FpuRegisterName from assembler to constants

Change-Id: I266b97ef1f0493c184f4486c7a0482845d4ac644
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97312
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-04-08 09:45:27 +00:00
Daco Harkes 544371c7f2 [vm] Refactor constants to be available in namespaces dart and dart::host
Refactoring motivation: go/dart-simulated-ffi

Change-Id: I219aba2793cfb7d7ea5ecc0a2ab93276c6cbf1e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97325
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-04-08 09:45:27 +00:00
Aart Bik fd2393d6d3 [dart/fuzzer] Re-enable optimization_counter_threshold testing
Rationale:
Underlying issues fixed by Samir.

https://github.com/dart-lang/sdk/issues/35196

Change-Id: I7baaecbe6611f9581050da09ac5375fdf70db319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98760
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-05 22:56:34 +00:00
Ryan Macnak 8e6851f0e4 [vm] Don't create edge counter arrays when edge counters are disabled.
Change-Id: I595ee38cf6a4411102ca811333227fe365864065
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98686
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-05 22:47:16 +00:00
Ryan Macnak 90c757c766 [vm, interpreter] Allocation fast paths.
Bug: https://github.com/dart-lang/sdk/issues/36410
Change-Id: If753e60ac70f7c016e1caa3b296378d3ebc0a91c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/87267
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-05 22:37:58 +00:00
Alexander Markov 43046b7f7c [vm/bytecode] Enable building of kernel service snapshot
Kernel service snapshot is built in default (non-bytecode) mode and
it is not compatible with VM running in bytecode mode.

Previously, this incompatibility was causing crashes and building of
kernel service snapshot was disabled if SDK is built with --bytecode.

With the change https://dart-review.googlesource.com/c/sdk/+/98723
that workaround is no longer needed, and we can build kernel service
snapshot once again.

Change-Id: Ia5660b637894a5ffc2723e12dc2bf9630cc2f8c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98604
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-05 22:31:58 +00:00
Alexander Markov 7beed016a0 [vm/bytecode] Add 'bytecode' into snapshot feature flags
This change makes snapshots generated in bytecode mode incompatible with
VM running in a non-bytecode mode, and vice versa.

When there are both bytecode and AST available, we should consistently
use the same source for JIT compilation, as they are not compatible in
some cases (captured contexts of closures are different in bytecode and AST).

Change-Id: Id50c42694d8db1ffaf9dd1bd902071fc3297a5a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98723
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-04-05 22:31:58 +00:00
Ryan Macnak 9e1adc54a7 [vm] When loading a compilation trace, speculatively populate ICData based on the receiver's static type.
If the receiver's static type has one concrete implementation, lookup the target for that implementation and add it to the ICData's entries. For some well-known interfaces, do the same for the most common concrete implementation (e.g., int -> _Smi).

Avoids method resolution during application startup.

Bug: https://github.com/dart-lang/sdk/issues/36428
Change-Id: I57edf9c9cb5cb13af3182a100adce2802571a3aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98445
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-05 21:12:44 +00:00
Alexander Markov 07482eeb5e [bots] Run all tests on vm-dartkb-* bots
Bytecode configurations should have the same test coverage as default mode.

The following tests are excluded in dartkb mode as there are too many crashes:
 - service/* (debugging capabilities are not supported);
 - lib_2/mirrors/* (mirrors are not supported);
 - vm/cc/* (bytecode modes are not wired up in run_vm_tests).

Change-Id: I11eead94b96f43ab454acd6e6f6861af943c0488
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97847
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-05 18:25:34 +00:00
Martin Kustermann dbfd00f44d [vm/compiler] Add new optimization pass which inlines typed data accesses
Based on the unified typed data layout, we can now inline accesses to
typed data interface classes if there are no 3rd party implementations
of those interfaces.

Example: If a receiver is of type Uint8List and we call `[]` or `[]=` we
will inline the byte access.

Instead of changing the existing inliner / call specializer we add this
as an extra pass: If the inliner / call specializer infer that the
receiver type is e.g. internal typed data then it will perform the
inlining itself using more optimized LoadIndexed instruction.

=> Only if those existing optimization passes have not been able to inline
   the access will we, later on in the compilation pipeline, run a
   specialized pass which will inline the accesses using LoadUntagged +
   LoadIndexed (which is slightly less efficient than using only LoadIndexed
   for internal typed data).

As a first step this is only done for AOT.

For ease of writing tests matching certain IR graphs this CL also adds a
IR pattern matcher.

Issue https://github.com/dart-lang/sdk/issues/35154

Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try, vm-dartkb-linux-debug-x64-try, vm-dartkb-linux-release-x64-try, vm-kernel-asan-linux-release-x64-try, vm-kernel-checked-linux-release-x64-try, vm-kernel-linux-debug-ia32-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-debug-x64-try, vm-kernel-linux-product-x64-try, vm-kernel-linux-release-ia32-try, vm-kernel-linux-release-simarm-try, vm-kernel-linux-release-simarm64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-linux-release-x64-try, vm-kernel-optcounter-threshold-linux-release-ia32-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-android-release-arm-try, vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-product-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-obfuscate-linux-release-x64-try, vm-kernel-precomp-win-release-simarm64-try, vm-kernel-precomp-win-release-x64-try, vm-kernel-reload-linux-debug-x64-try, vm-kernel-reload-linux-release-x64-try, vm-kernel-reload-rollback-linux-debug-x64-try, vm-kernel-reload-rollback-linux-release-x64-try, vm-kernel-win-debug-ia32-try, vm-kernel-win-debug-x64-try, vm-kernel-win-product-x64-try, vm-kernel-win-release-ia32-try, vm-kernel-win-release-x64-try

Change-Id: I5f2e01a55f46b473f64478b05679f65b9fd7c4c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98662
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-05 15:51:34 +00:00
Clement Skau 907c514c89 [SDK] Adds build targets, wrappers and SDK builds for Dart AOT.
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>
2019-04-05 13:23:44 +00:00
Samir Jindel a2709992a2 [vm] Support optcounter=1 and randomize it for testing.
Change-Id: I1d371ca9644a65f8fe9864ac708689c1469da17d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97242
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-04-05 10:15:44 +00:00
Alexander Markov 38dbddc90d [vm/bytecode] Add AllocateClosure bytecode
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>
2019-04-05 00:00:13 +00:00
Zichang Guo b45c67a933 [vm] improve vm help messages
Bug: https://github.com/dart-lang/sdk/issues/36312
Change-Id: Ibbfdf1467d94bba5784889c4539f6d660f9bcc7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98687
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-04-04 22:46:33 +00:00
Liam Appelbe 5a5b58db7e Reland "[vm] Allow running with the latest ABI dill files."
This reverts commit 69ff056b51.

Reason for revert: Relanding with fix.

Original change's description:
> Revert "[vm] Allow running with the latest ABI dill files."
>
> This reverts commit 35c4af445b.
>
> Reason for revert: Broke a bunch of tests, eg:
> https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8917088905682853152/+/steps/test_results/0/logs/tests_that_began_failing__logs_/0
>
> Original change's description:
> > [vm] Allow running with the latest ABI dill files.
> >
> > 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>
>
> TBR=asiva@google.com,liama@google.com
>
> Change-Id: I40f83fcc7f9d785353fb05d4296376ec04af8309
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/36047
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98700
> Reviewed-by: Liam Appelbe <liama@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

TBR=asiva@google.com,liama@google.com

Change-Id: I909fd649eb41911a7b15e682b669708ebe083c8e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/36047
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98690
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2019-04-04 22:45:25 +00:00
Liam Appelbe fd9e32df56 Reland "Spawn isolates using platform kernel when using old ABIs"
This reverts commit 2a8117c341.

Reason for revert: I think it was actually https://dart-review.googlesource.com/c/sdk/+/98609 that caused the breakage

Original change's description:
> Revert "Spawn isolates using platform kernel when using old ABIs"
> 
> This reverts commit c3113b0818.
> 
> Reason for revert: Broke some tests, eg https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8917089062837512336/+/steps/test_results/0/logs/tests_that_began_failing__logs_/0
> 
> Original change's description:
> > Spawn isolates using platform kernel when using old ABIs
> > 
> > Bug: https://github.com/dart-lang/sdk/issues/36047
> > Change-Id: I4a95ec336e1ba6b955563cca5498a18310b51379
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98260
> > Reviewed-by: Siva Annamalai <asiva@google.com>
> > Commit-Queue: Liam Appelbe <liama@google.com>
> 
> TBR=asiva@google.com,liama@google.com
> 
> Change-Id: I33a714add2858752015dec38b8d973347a3ba79a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/36047
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98684
> Reviewed-by: Liam Appelbe <liama@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

TBR=asiva@google.com,liama@google.com

Change-Id: I8ce6b050f0c3aeb7ac4f15b83bbec0b3b0e909bd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/36047
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98688
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-04-04 19:15:35 +00:00
Alexander Markov 652a8be7a7 [Tests] Fix inifinite replication of Dart processes in tests
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>
2019-04-04 19:14:44 +00:00
Liam Appelbe 69ff056b51 Revert "[vm] Allow running with the latest ABI dill files."
This reverts commit 35c4af445b.

Reason for revert: Broke a bunch of tests, eg:
https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8917088905682853152/+/steps/test_results/0/logs/tests_that_began_failing__logs_/0

Original change's description:
> [vm] Allow running with the latest ABI dill files.
> 
> 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>

TBR=asiva@google.com,liama@google.com

Change-Id: I40f83fcc7f9d785353fb05d4296376ec04af8309
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/36047
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98700
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-04-04 18:12:18 +00:00
Liam Appelbe 2a8117c341 Revert "Spawn isolates using platform kernel when using old ABIs"
This reverts commit c3113b0818.

Reason for revert: Broke some tests, eg https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8917089062837512336/+/steps/test_results/0/logs/tests_that_began_failing__logs_/0

Original change's description:
> Spawn isolates using platform kernel when using old ABIs
> 
> Bug: https://github.com/dart-lang/sdk/issues/36047
> Change-Id: I4a95ec336e1ba6b955563cca5498a18310b51379
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98260
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

TBR=asiva@google.com,liama@google.com

Change-Id: I33a714add2858752015dec38b8d973347a3ba79a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/36047
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98684
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-04-04 17:47:26 +00:00
Aart Bik 5e8b0b7a97 [dart/fuzzer] Fuzz support for spread and control flow collections
Rationale:
Follows the documented grammar to allow for arbitary nested
spead/if/for inside collections (list, set, maps).

https://github.com/dart-lang/sdk/issues/36218
https://github.com/dart-lang/sdk/issues/36214

Change-Id: Ie5b5828a323401c4db14045e6edd0587677f2c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98261
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-04 17:22:24 +00:00
Liam Appelbe c3113b0818 Spawn isolates using platform kernel when using old ABIs
Bug: https://github.com/dart-lang/sdk/issues/36047
Change-Id: I4a95ec336e1ba6b955563cca5498a18310b51379
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98260
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-04-04 16:56:23 +00:00
Liam Appelbe 35c4af445b [vm] Allow running with the latest ABI dill files.
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>
2019-04-04 16:55:03 +00:00
Martin Kustermann 9814cb1b9c [vm/compiler] Make new CheckBoundBase and allow range analysis contrain values after GenericCheckBound
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>
2019-04-04 12:53:50 +00:00
Aske Simon Christensen f63eaab3af [kernel] Add instance creation kernel node.
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>
2019-04-04 12:22:50 +00:00
Martin Kustermann 76f3630d04 [vm/compiler] Remove polymorphic typed data access in inliner
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>
2019-04-04 11:09:30 +00:00
Martin Kustermann 31d558c81c [vm/compiler] Add il_test_helper.h with support for running compilation pipelines for testing
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>
2019-04-04 05:58:29 +00:00
Alexander Markov bf293ea34c [vm/bytecode] Remove support for old version of bytecode format (v1)
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>
2019-04-03 22:44:21 +00:00
Aart Bik e9f5b85492 [vm/bytecode] fixed typo in stack test
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>
2019-04-03 22:38:41 +00:00
Ryan Macnak 603a57e4c2 [vm, interpreter] Increment implicit accessor usage counts.
Fixes NBody regression from 298dacfef5.

Change-Id: I04634750c76668376bf449f97c2f6b79a3a06b92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98621
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-03 21:52:42 +00:00
Alexander Markov 4d37977473 [vm/bytecode] Do not mark null-initialized instance fields as nullable too early
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>
2019-04-03 21:35:23 +00:00
Ryan Macnak e3164c9078 [vm, reload] ResetICDatas may allocate, so it cannot run during heap iteration.
Change-Id: Ida3fc538bd7f7f05fa5451f5f0f37e9fccbdf769
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98447
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-04-03 19:00:51 +00:00
Vyacheslav Egorov 26c45e78a4 [vm/compiler] Prevent incorrect caching of mutable CompileType objects as reaching types.
In general we would like to keep previous results of type propagation passes, however this
leads to situations where CompileType objects owned by definitions are cached as reaching
types at uses that are no longer directly connected to the definition itself.

This leads to situations when type propagator updates the type of the definition in place
via Definition::UpdateType, but does not enqueue an instruction which uses this type which
leads to incorrect fix-point computation.

As a fix we make the fact that some CompileType objects are owned by definitions explicit
by assigning [CompileType::owner_] field. Whenever we encounter situation that reaching type's
owner does not match current definition flowing into use we clone compile type to disconnect
it from original owner and prevent hidden mutation.

This CL also fixes two minor issues:

- incorrect computation of non-nullable type from a nullable CompileType with a cid;
- assings CompileType to LoadIndexedUnsafe instructions emitted by prologue builder;

Fixes https://github.com/dart-lang/sdk/issues/36156

Bug: 36156
Change-Id: I6536cfe1fda033cba3524336bfbdb871b88a8b3f
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm-try, vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98358
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-03 17:53:36 +00:00
Ryan Macnak dc655d9e1a [vm, bytecode] Propagate interface targets to the flow graph and ICData.
Bug: https://github.com/dart-lang/sdk/issues/36342
Bug: https://github.com/dart-lang/sdk/issues/36428
Change-Id: I7a22537b83d500ebb0a764963a789720a64467ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98437
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-03 17:27:07 +00:00