Commit Graph

904 Commits

Author SHA1 Message Date
Nate Bosch cf03e96b90 Remove appJit and precompiled compiler options
Towards #37318

- appJit has been replaced by appJitk and is no longer.
- precompiled has been replaced by dartkp and is no longer used.
- For the precompiled runtime, default to dartkp.
- Remove status file references to these compiler options and normalize
  status files.

Change-Id: I48728db13dc84737092a92314e2f474a9309f4d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106942
Reviewed-by: Alexander Thomas <athom@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-24 16:07:27 +00:00
Zichang Guo 2bc78f171f [vm/kernel] Fix reading of type parameters in factory constructors
VM will crash when factory constructor was passed typedef with type arguments. procedure_type_parameter_count should not include type argument for factory function, as factory function share the same type argument with class.
Bug:  https://github.com/dart-lang/sdk/issues/37264
Change-Id: I358c6d35cf217162d2b89f7d8fa9d303f981b713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106563
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-06-21 16:48:47 +00:00
Alexander Markov da8cb470cc [vm/bytecode] Represent classes, libraries, scripts and recursive types in bytecode
Size of a large application:
Before: 26628600
After: 21480120 (-19.3%)

Size of snapshots:

isolate_snapshot_framework.bin
Before: 9322496
After: 6782976 (-27.2%)

isolate_snapshot_product_framework.bin
Before: 9166848
After: 6602752 (-27.9%)

Regressions in tests:

1) Test language_2/type_alias_equality_test/04 fails similarly to default mode, as VM
does not implement comparison of function types according to the specification.
Previously this test was passing as function types were canonicalized in bytecode,
which was not always correct. This CL fixes the problem with canonicalization of
function types in bytecode and the test starts failing again.

2) Tests standalone_2/entrypoints_verification_test, standalone_2/io/test_extension_test,
standalone_2/io/test_extension_fail_test fail as native extensions are not supported
in bytecode yet. These tests start passing after df5e7aac17,
which switched bytecode tests to kernel service (on x64), because kernel service doesn't
drop ASTs. This CL switches from reading AST library declarations to bytecode even if
AST is not removed, so tests fail again.

Change-Id: I8b7ba44bfa49d0b1599b2509553ff7c831a4e244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104700
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-20 18:27:21 +00:00
Martin Kustermann be260fef93 Skip vm/dart/disassemble_determinism_test on hot-reload, it's too slow
Change-Id: I2e147ecc2f9c0f09e1f6f4eaf5e97b2b2efcef31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106901
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
2019-06-20 13:17:20 +00:00
Nate Bosch 2b56c2c58a Normalize status files
Run `pkg/status_file/bin/normalize.dart` across all status files.

This should solve most presubmit warnings about "existing and possibly
new status file issues".

There are remaining issues in pkg/front_end/testcases/strong.status and
pkg/front_end/testcases/text_serialization.status which will need to be
fixed manually.

Change-Id: Iceae8992c4907442481590d75c1b0a84ce29521b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106726
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Auto-Submit: Nate Bosch <nbosch@google.com>
2019-06-19 23:04:01 +00:00
Ryan Macnak 240f25a940 [vm] Add --disassemble-relative to use PC offsets instead of absolute PCs in --disassemble's output.
Makes it much easier to compare the output when making VM changes.

--disassemble:
        ;; Invocation Count Check
0x7f82b8900320    498b7c2437             movq rdi,[r12+0x37]
0x7f82b8900325    ff8783000000           incl [rdi+0x83]
0x7f82b890032b    81bf8300000030750000   cmpl [rdi+0x83],0x7530
0x7f82b8900335    7c07                   jl 0x00007f82b890033e
0x7f82b8900337    41ffa6b8010000         jmp [thr+0x1b8]

--disassemble --disassemble-relative:
        ;; Invocation Count Check
0x0    498b7c2437             movq rdi,[r12+0x37]
0x5    ff8783000000           incl [rdi+0x83]
0xb    81bf8300000030750000   cmpl [rdi+0x83],0x7530
0x15    7c07                   jl +9
0x17    41ffa6b8010000         jmp [thr+0x1b8]

Change-Id: Ie05c532f830027b928d7d1d57509eb237157a127
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106600
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-06-19 22:36:00 +00:00
Ryan Macnak 1e24fe7d69 [vm, compiler] Specialize unoptimized monomorphic and megamorphic calls.
dart-bytecode, arm64:            +4.742% geomean
dart-bytecode-jit-unopt, arm64: +12.73% geomean
dart2js-compile, x64:            +3.635% geomean

In the polymorphic and unlinked cases, call to a stub the does a linear scan against an ICData.

In the monomorphic case, call to a prologue of the expected target function that checks the expected receiver class. There is additional indirection in the JIT version compared to the AOT version to also tick a usage counter so the inliner can make good decisions.

In the megamorphic case, call to a stub that does a hash table lookup against a MegamorphicCache.

Megamorphic call sites face a loss of precision in usage counts. The call site count is not recorded and the usage counter of the target function is used as an approximation.

Monomorphic and megamorphic calls sites are reset to the polymorphic/unlinked state on hot reload.

Monomorphic and megamorphic calls sites do not check the stepping state, so they are reset to the polymorphic/unlinked state when stepping begins and disabled.

Back-edges now increment the usage counter in addition to checking it. This ensures function with loops containing monomorphic calls will eventually cross the optimization threshold.

Fixed backwards use of kMonomorphicEntryOffset and kPolymorphicEntryOffset.

Fixed C stack overflow when bouncing between the KBC interpreter and a simulator.

Bug: https://github.com/dart-lang/sdk/issues/26780
Bug: https://github.com/dart-lang/sdk/issues/36409
Bug: https://github.com/dart-lang/sdk/issues/36731
Change-Id: I78a49cccd962703a459288e71ce246ed845df474
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102820
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-06-12 21:56:53 +00:00
Zach Anderson 97f91fecdb [vm] Mark Profiler_StringInterpolation Fail in vm.status
Change-Id: Ie2341b3d326209586852e541131e3a450c67fee9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105473
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-06-10 22:17:34 +00:00
Ben Konyi 2b76cdf1d7 [ VM ] Remove bad status file entries for data_uri_import_test/utf16
Change-Id: Ie983b82eabcafbf8ba38e3932eed581f4c049997
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105468
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-06-10 19:00:26 +00:00
Alexander Aprelev ad38f88c59 [vm/transferable] Skip oom test on mac
Change-Id: Ieb73f808638b3f32bf6ae25539a2002f87132acc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105380
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-06-07 04:01:13 +00:00
Alexander Aprelev 01b0001f8e [vm/transferable] Refactor oom transferable test out of other throwing tests.
Issue dartbug.com/37188.

Change-Id: Iba8f3bb2f9d8e399f75bd3c63e4542effa6eeb57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105347
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-06-07 00:13:44 +00:00
Alexander Aprelev 19447e1061 [vm/transferable] Skip oom transferable test on asan.
Change-Id: I105793dbf53955637922576272e20df2c02c86f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105343
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-06-06 22:40:46 +00:00
asiva 7e9a4b786d [VM/benchmarks] Rework Dart2JSCompileAll test to instead do CFE compile all
The Dart2JSCompileAll test has not been working for a while due to
- issues with package config
- issues with getting the sources compiled with CFE after the switch to
  kernel pipeline.
Revised this benchmark/test to instead load the kernel_service dill file and do a CompileAll of CFE.

Should fix
https://github.com/dart-lang/sdk/issues/36630
https://github.com/dart-lang/sdk/issues/27369

Change-Id: I07f5c81fc6938d318b84fa9ea2fa033ec30a05e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103406
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-06-06 21:36:02 +00:00
Alexander Aprelev 8270e90f84 [vm/transferable] SkipSlow long-running transferable test on sim* platforms
Change-Id: If829ee2d141abda2551945da07e03e4abdc3cf73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105341
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-06-06 20:48:47 +00:00
Ben Konyi ea60ef96dc [ VM ] Fixed data_uri_import_test which was never migrated properly to Dart 2
Change-Id: I3aa1d5b63b1815920f46691d0b5b5110d144a80b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105324
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-06-06 20:03:17 +00:00
Samir Jindel c4541e63f8 [vm/aot] Update serializer for V8's "snapshot profile" format
Fixes https://github.com/dart-lang/sdk/issues/37183
Addresses https://github.com/dart-lang/sdk/issues/37126

Change-Id: I1c1e516ac2bcc45e46059f4439f16aaee6d824fe
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105302
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-06 19:54:12 +00:00
Alexander Aprelev 4ccae238ea [vm/isolate] Add TransferableTypedData class that allows low-cost passing of Uint8List between isolates.
TransferableTypedData instances are one-use kind of thing: once receiver materializes it, it can't be used
again, once sender sends it out to an isolate, sender can't send it to different isolate.

Example of use:

sender isolate:

```
Future<TransferableTypedData> consolidateHttpClientResponseBytes(HttpClientResponse response) {
  final completer = Completer<TransferableTypedData>();
  final chunks = <Uint8List>[];
  response.listen((List<int> chunk) {
    chunks.add(chunk);
  }, onDone: () {
    completer.complete(TransferableTypedData.fromList(chunks));
  });
  return completer.future;
}
...
sendPort.send(await consolidateHttpClientResponseBytes(response));
```

receiver isolate:
```
    RawReceivePort port = RawReceivePort((TransferableTypedData transferable) {
      Uint8List content = transferable.materialize().asUint8List();
      ...
    });
```

31959[tr] and 31960[tr] tests were inspired by dartbug.com/31959, dartbug.com/31960 that this CL attempts to address:
```
╰─➤  out/ReleaseX64/dart 31960.dart
sending...
163ms for round-trip
sending...
81ms for round-trip
sending...
20ms for round-trip
sending...
14ms for round-trip
sending...
20ms for round-trip
sending...
14ms for round-trip
```

(notice no "since last checking" pauses") vs

```
╰─➤  out/ReleaseX64/dart 31960.dart
sending...
154ms since last checkin
174ms for round-trip
sending...
68ms since last checkin
9ms since last checkin
171ms for round-trip
sending...
13ms since last checkin
108ms for round-trip
sending...
14ms since last checkin
108ms for round-trip
sending...
14ms since last checkin
107ms for round-trip
```

Change-Id: I0fcb5ce285394f498c3f1db4414204531f98199d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99623
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-06 19:49:07 +00:00
Samir Jindel dab26bbd60 [vm/aot] Re-enable vm/dart tests in AOT.
Change-Id: I406e65157c4aa322872c4194dc7e84b699835e69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105247
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-06-06 16:05:42 +00:00
Ben Konyi 46ae4c5f0a [ VM ] Removed tests that are no longer valid as of Dart 2.0.
Fixes #32704

Change-Id: I4d45002f62a73c4b050663d449b277ec023b599d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103484
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-05-28 19:14:44 +00:00
Vyacheslav Egorov bd39cca700 [compiler] Mark each variable stored on entry to catch block.
We do not generate explicit control flow and phis for exceptional
edges. Instead CatchBlockEntry has a Parameter instruction for
each local variable. These Parameter-s represent that state
of local variables on entry into the catch block. This means
that we should mark all variables assigned on entry to the
catch block.

Previous version of the code was incorrectly marking only
direct parameters as stored.

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

Bug: 36953
Change-Id: I2e8040d75ba23d2483e451300f44bbdcef458655
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103802
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-05-27 09:12:04 +00:00
asiva 2736dab879 [VM/tests] Use appropriate type when invoking Isolate.spawn
Fixes https://github.com/dart-lang/sdk/issues/36917

Change-Id: I83ae6ad6afefb62da4228d168bbec805aa74cf92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102101
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-05-09 23:04:28 +00:00
Alexander Markov 6436104712 [vm/tests] Fix flaky crashes on vm/cc/GenKernelKernelMaxRSS test
vm/cc/GenKernelKernel* tests enabled interpreter by setting
FLAG_enable_interpreter in order to benchmark bytecode reading.
As a side effect, this enables interpretation of special functions
(like implicit getters) on other isolates such as kernel-service isolate.
They may even reach compilation threshold and unoptimized background
compilation is triggered. However, as isolate was created with
FLAG_enable_interpreter == false, unoptimized BackgroundCompiler was not
created, so it causes flaky crashes.

A less intrusive way to enable bytecode reading is to set
FLAG_use_bytecode_compiler.

Change-Id: Ie0601d43816b29c62fb0278ed4666d38fc4328c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100788
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-29 21:37:58 +00:00
Martin Kustermann 832668ff6c Reland "[Infra] Let run_vm_tests --list output a test expectation marker"
Due to not having support for __VA_OPT__ yet the CL introduces a new
wet of macros ..._WITH_EXPECTATIONS() which can be given an expectation
marker.

Change-Id: I33812937f1b226fa89b3ab17a8a3483914abf2e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100643
Reviewed-by: Stevie Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-04-26 12:15:19 +00:00
Martin Kustermann 76c6b86915 Revert "[Infra] Let run_vm_tests --list output a test expectation marker"
This reverts commit 7cb73d97d2.

Reason for revert: It caused windows build to fail (reason unknown):

c:\b\s\w\ir\cache\builder\sdk\runtime\vm\compiler\assembler\assembler_x64_test.cc(1097): error C3861: 'AssemblerTestGenerate_BitScanReverse': identifier not found
c:\b\s\w\ir\cache\builder\sdk\runtime\vm\compiler\assembler\assembler_x64_test.cc(5499): error C3861: 'AssemblerTestGenerate_bittest': identifier not found

Original change's description:
> [Infra] Let run_vm_tests --list output a test expectation marker
> 
> Due to not having support for __VA_OPT__ yet the CL introduces a new
> wet of macros ..._WITH_EXPECTATIONS() which can be given an expectation
> marker.
> 
> Change-Id: Icaac4672f04340fe4644d13a14c32704ba36daec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96940
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

TBR=sortie@google.com,kustermann@google.com,regis@google.com

Change-Id: Ica07ef5e7302e3d8e4b131427ff5ab20be8c6a63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100581
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-04-25 14:35:45 +00:00
Martin Kustermann 7cb73d97d2 [Infra] Let run_vm_tests --list output a test expectation marker
Due to not having support for __VA_OPT__ yet the CL introduces a new
wet of macros ..._WITH_EXPECTATIONS() which can be given an expectation
marker.

Change-Id: Icaac4672f04340fe4644d13a14c32704ba36daec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96940
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-04-25 12:07:01 +00:00
Martin Kustermann f0da03ca36 [vm/compiler] Do not include FPU registers on ARM if VFP is not supported
Closes https://github.com/dart-lang/sdk/issues/36636

Change-Id: I5a07edb12af8d012e9fcbdc058abb57102a56436
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99462
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-04-17 09:28:46 +00:00
Alexander Markov 6e28c24a01 [vm/compiler/bytecode] Ensure CheckStackOverflow is in the join block
Fixes https://github.com/dart-lang/sdk/issues/36590

Change-Id: Ie18f0f61a437c58b452bbcde8f4bafe58125328f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99377
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-16 16:37:25 +00:00
Samir Jindel 409b68a4ce [vm] Mark type_feedback_test as Slow.
Even when it passes, it often reaches close to the timeout threshold.

Change-Id: Ifab28dc013e628e78c54c0fd65a8feb4079c83a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99024
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-04-10 12:49:56 +00:00
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
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
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
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
asiva dc9370a07d [vm/runtime] Create separate background compilation queues for optimized and unoptimized compilations.
- create separate compilation queues for optimized and compilation
queues
- remove option FLAG_background_compilation_stop_alot doesn't seem to be used in any format testing
- remove some class finalization checks before starting the background compiler

Change-Id: I98f1773987e33a43e7b43ace4c383d17bd0a1710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98453
Reviewed-by: Zach Anderson <zra@google.com>
2019-04-03 00:58:43 +00:00
Siva Annamalai 057497e57b Revert "[vm/runtime] Create separate background compilation queues for optimized and unoptimized compilations."
This reverts commit bcb6df13b9.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vm/runtime] Create separate background compilation queues for optimized and unoptimized compilations.
> 
> - create separate compilation queues for optimized and compilation
> queues
> - remove option FLAG_background_compilation_stop_alot doesn't seem to be used in any format testing
> - remove some class finalization checks before starting the background compiler
> 
> Change-Id: I09feb500c2a5cc9c6e93347f63bfca41b83b35cf
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98301
> Reviewed-by: Zach Anderson <zra@google.com>
> Commit-Queue: Siva Annamalai <asiva@google.com>

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

Change-Id: I3faf74c95dce7741c75f8836cce30f9dba2e154c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98448
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-04-02 01:17:24 +00:00
asiva bcb6df13b9 [vm/runtime] Create separate background compilation queues for optimized and unoptimized compilations.
- create separate compilation queues for optimized and compilation
queues
- remove option FLAG_background_compilation_stop_alot doesn't seem to be used in any format testing
- remove some class finalization checks before starting the background compiler

Change-Id: I09feb500c2a5cc9c6e93347f63bfca41b83b35cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98301
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-04-02 00:32:33 +00:00
Alexander Markov 4ae5b272cb [vm/bytecode/compiler] Fix dropping of expression stack values when generating Throw
Fixes https://github.com/dart-lang/sdk/issues/36374

Change-Id: I1477ddb110c19674b82de4edbd7a71b7fbaba090
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98220
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-04-01 15:49:23 +00:00
Martin Kustermann c185945507 [vm/aot] Ensure global object pool is relocated by compactor and reloaded when returning from natives
When the compactor moves the global object pool the pointer in Thread
was not updated because it was in a macro list which can only hold
objects inside the read-only VM isolate.

All calls into dart need to populate PP as well as all calls returning
from C++ need to restore PP.  There was a missing case where we return
from natives and don't restore PP (i.e. not normal runtime calls).

This started to be an issue after we started moving old space objects.

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: I14776be226431e2c53ae888b3c98a1b8c540c4ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98343
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-29 15:13:25 +00:00
Ryan Macnak 580e5731d6 [vm] Test compilation traces, type feedback, reused instructions.
Improve error for failure to reuse instructions.

Change-Id: I38b30a0da508f686d73dffebbf5893d6c939f19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95940
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-03-13 23:36:06 +00:00
Vyacheslav Egorov ed5bc9c538 [vm] Fix AssertAssignable strengthening sometimes using wrong deopt_id.
For some reason this code used deopt_id from the environment attached
to the AssertAssignable instruction, rather than deopt_id from the
instruction itself.

Under certain conditions this deopt_id is -1 which usually does
not cause any problems because no other code uses it.

Compiler is now changed in a way that only sets Environment::deopt_id_
for outer environments and innermost environment always has deopt_id_ set
to DeoptId::kNone.

This bug manifested itself as a very rare crash on lib_2/convert/chunked_conversion_utf8_test.dart
test on optcounter bot.

This change also converts an assertion that verifies that deoptimization target
always exists into a FATAL to make such crashes more informative.

TEST=runtime/tests/vm/dart/licm_and_assert_strengthening_test.dart

Change-Id: Ib58237b0f4ae279dcf9d88cac031156e88bf4828
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96657
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-03-13 12:13:12 +00:00
Régis Crelier a39833d957 Reland "Reland "[VM runtime] Dual mapping of executable pages.""
This is a reland of 6da340bf76

Original change's description:
> Reland "[VM runtime] Dual mapping of executable pages."
> 
> This is a reland of 44186dfdcd
> 
> Original change's description:
> > [VM runtime] Dual mapping of executable pages.
> > 
> > Change-Id: Iaad78d324e25462ce951f4df26974a6a368c50b7
> > Reviewed-on: https://dart-review.googlesource.com/c/93377
> > Commit-Queue: Régis Crelier <regis@google.com>
> > Reviewed-by: Ryan Macnak <rmacnak@google.com>
> 
> Change-Id: I7a0caa078950637d9fe831732577fd2467061099
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95263
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Change-Id: I3a01f0e67d733c5db41618f691431e72c1e1cb2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96422
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-03-12 20:45:45 +00:00
Vyacheslav Egorov 9ff0a654ca Revert "Reland "[VM runtime] Dual mapping of executable pages.""
This reverts commit 6da340bf76.

Reason for revert: almost all benchmarks are now failing on Golem linux-x64 target. Flutter Golem build is broken 

Original change's description:
> Reland "[VM runtime] Dual mapping of executable pages."
> 
> This is a reland of 44186dfdcd
> 
> Original change's description:
> > [VM runtime] Dual mapping of executable pages.
> > 
> > Change-Id: Iaad78d324e25462ce951f4df26974a6a368c50b7
> > Reviewed-on: https://dart-review.googlesource.com/c/93377
> > Commit-Queue: Régis Crelier <regis@google.com>
> > Reviewed-by: Ryan Macnak <rmacnak@google.com>
> 
> Change-Id: I7a0caa078950637d9fe831732577fd2467061099
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95263
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,regis@google.com

Change-Id: I3342de2584537269ffe9a53946bef27cb25a69fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96161
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-03-09 14:15:39 +00:00
Régis Crelier 6da340bf76 Reland "[VM runtime] Dual mapping of executable pages."
This is a reland of 44186dfdcd

Original change's description:
> [VM runtime] Dual mapping of executable pages.
> 
> Change-Id: Iaad78d324e25462ce951f4df26974a6a368c50b7
> Reviewed-on: https://dart-review.googlesource.com/c/93377
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

Change-Id: I7a0caa078950637d9fe831732577fd2467061099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95263
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-08 18:33:02 +00:00
Ben Konyi cbc404b6de [VM] Cleanup status files some more
Change-Id: Ib7560d864b5506b2629413ccb1d70b8281e16315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95040
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2019-03-05 23:47:14 +00:00
Régis Crelier 0491d5cde7 Revert "[VM runtime] Dual mapping of executable pages."
This reverts commit 44186dfdcd.

Reason for revert: not working on vm-kernel-precomp-android-release-arm

Original change's description:
> [VM runtime] Dual mapping of executable pages.
> 
> Change-Id: Iaad78d324e25462ce951f4df26974a6a368c50b7
> Reviewed-on: https://dart-review.googlesource.com/c/93377
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,regis@google.com

Change-Id: I793ceee6252111eafbcbfe6e28268f4f6f2d7215
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/94989
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-03-01 22:55:14 +00:00
Régis Crelier 44186dfdcd [VM runtime] Dual mapping of executable pages.
Change-Id: Iaad78d324e25462ce951f4df26974a6a368c50b7
Reviewed-on: https://dart-review.googlesource.com/c/93377
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-01 22:19:31 +00:00
Ben Konyi 1a9f40b1c5 [VM] Remove unnecessary assert to fix cc/PrintJSON test
Change-Id: If6f44a3136002cd4c682f6b88bbd772db8f467b3
Reviewed-on: https://dart-review.googlesource.com/c/94984
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-01 19:07:30 +00:00
Ben Konyi e8d6e2f704 [ VM ] Updated SourceReport tests with correct token positions
Change-Id: I6aa49e715043a1ba463425e53018c5078a272129
Reviewed-on: https://dart-review.googlesource.com/c/94962
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-03-01 00:48:59 +00:00
Alexander Markov 55c07c6d7a [vm] Fix null checks when CodeSourceMap is missing
This change fixes null checks in case of missing CodeSourceMap,
which happens when --dwarf_stack_traces is used.

Issue: https://github.com/dart-lang/sdk/issues/35851
Change-Id: I7d79533cc42c988618e2efe988f530d169d9aec1
Reviewed-on: https://dart-review.googlesource.com/c/93989
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-02-25 05:50:14 +00:00
Régis Crelier b66dc30334 [VM/interpreter] Skip tests enabling interpreter when not supported (fixes #35943).
Emit FATAL in interpreter constructor when on sim* architecture.

Change-Id: Ifd429638423e1e83d0f3520896409929018e14f1
Reviewed-on: https://dart-review.googlesource.com/c/93343
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-02-15 00:51:52 +00:00
Samir Jindel 010a12330e [vm] Fix ThrowErrorSlowPath-derived instructions (e.g. CheckNull) in JIT mode.
Previously these instructions were not safe to use on JIT, because they
crated catch-entry moves which are not used in JIT.

Now we assign deopt-infos to these slow paths so they can handle exceptions
correctly in JIT.

I considered removing uses of CheckNull in JIT mode, but I did not find a simple
replacement for all the existing uses.

Fixes #35887.

Change-Id: I05dfb46200679934d0ff6114cae8723f4908af8e
Reviewed-on: https://dart-review.googlesource.com/c/92783
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
2019-02-13 16:39:55 +00:00