Commit Graph

15705 Commits

Author SHA1 Message Date
Ryan Macnak 37183f8865 [observatory] Remove stale asserts from heap snapshot processing.
The new heap snapshot format includes VM isolate objects as objects with size 0 instead of excluding them.

Bug: https://github.com/dart-lang/sdk/issues/37919
Change-Id: I5bfd2ca1982e4d7a184907b8981838bdc280d8d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113751
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-20 17:08:10 +00:00
Samir Jindel 663a8630e6 Revert "[vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable."
This reverts commit bab592fd28.

Reason for revert: Breaks SIMARM_X64 build and crashes in hot-reload.

Original change's description:
> [vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable.
> 
> Issue https://github.com/dart-lang/sdk/issues/37629
> 
> Change-Id: Ib61c32bde5a8b38d90b4da77e27e3874b8bfb7e2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111432
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,alexmarkov@google.com,sjindel@google.com

Change-Id: Id7dc3068a97debc7a8f757df31ef33fb68bdcb44
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113827
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-20 16:27:32 +00:00
Samir Jindel e8c82c6784 [vm/ffi] Suppress irrelevant lint failures in FFI sources.
Change-Id: I63893f54a43e7ea5deb8e5e62a0f91e7d0c44d70
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113826
Commit-Queue: Samir Jindel <sjindel@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-08-20 15:55:19 +00:00
Samir Jindel bab592fd28 [vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable.
Issue https://github.com/dart-lang/sdk/issues/37629

Change-Id: Ib61c32bde5a8b38d90b4da77e27e3874b8bfb7e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111432
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-20 15:54:50 +00:00
Johnni Winther d153e98447 Revert "[cfe] Gather constraints from both possibilities for FutureOr"
This reverts commit 00e9561798.

Original change's description:
> [cfe] Gather constraints from both possibilities for FutureOr
> 
> Closes #37778.
> 
> Bug: http://dartbug.com/37778
> Change-Id: Ic06da9cf4e24e397e1f2a180b743190a4165dc3e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113033
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>

TBR=dmitryas@google.com,johnniwinther@google.com

Change-Id: I64677971c865180334958de13d2d82fec3daec85
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: http://dartbug.com/37778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113821
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-08-20 10:57:52 +00:00
Johnni Winther 00e9561798 [cfe] Gather constraints from both possibilities for FutureOr
Closes #37778.

Bug: http://dartbug.com/37778
Change-Id: Ic06da9cf4e24e397e1f2a180b743190a4165dc3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113033
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-20 08:43:22 +00:00
Ryan Macnak 6e2b3f0326 [vm] Greatly reduce handle allocation during reload.
Saves 10ms from non-empty reloads of Flutter Gallery.

Change-Id: If9a1f9970d562f8fd7996de875dfe231350efaa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113282
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-20 00:49:52 +00:00
Ryan Macnak f37fdef1c2 [vm, service] Fix out-of-bounds access when processing requestHeapSnapshot's arguments.
As detected by the ASAN bots.

Change-Id: Ia10ad883afe886d573f0fa32c2096f9e0ac07083
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113757
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-19 23:46:32 +00:00
Devon Carew 0ad703b534 [pkg:vm_service] re-generate the library based on the latest spec
Change-Id: Ie04198ae8726f3cbb3619c97e5c3bb83ee005dc2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113752
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-08-19 22:09:53 +00:00
Ryan Macnak f7902889b6 [vm, bytecode] Add missing class declaration loading during reload.
Change-Id: I7e9fa36a0cc028aa194bba10ae2711894847df9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113742
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-19 20:43:02 +00:00
Ryan Macnak 6e987b6eb5 [vm, service] Add requestHeapSnapshot.
This replaces _requestHeapSnapshot and _getObjectByAddresses, which relied on the invalid assumption that objects don't move and the heap hasn't mutated since the initial snapshot.

Updates Observatory to the new format. Adds treemap visualization of the dominator tree. Adds the ability to save and load heap snapshots to files. Removes analysis grouping references by source and target class. Removes ability to navigate from a pixel in the fragmentation view to inspector. Removes ability to query the top retaining instance from an ordinary class browser.

Change-Id: Ia7781c05d43bf3ec149f8b4ecab803b37c3ee981
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112181
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-08-19 19:31:42 +00:00
Martin Kustermann 8a9448138a [vm/compiler] Ensure the class check we insert is based on the same CidTargets we made the HasSingleTarget decision on
This is a temporary fix until we implement some abstraction to ensure the BG compiler
has always a consistent view of megamorphic caches it's interested in.

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

Change-Id: I98ec29db7a4ecd5776f724e11d50fb4535bacdd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113694
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-08-19 19:02:22 +00:00
Alexander Markov 11910a0c9c [vm] Add --verbose-stack-overflow option to simplify investigation of stack overflow errors
Change-Id: I646b0b27e88064665b8bb1f51b20d2de94614903
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113483
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-08-19 18:34:42 +00:00
Samir Jindel e64738ffbc [vm/ffi] DynamicLibrary.process() and DynamicLibrary.executable()
Change-Id: I6be84f24f0ac245ba176748e4a3ec1ba782798ce
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-debug-x64-try,vm-kernel-mac-debug-x64-try,vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113687
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-08-19 14:24:01 +00:00
Jens Johansen 2891ec679b [CFE/VM] Fix merge/typo for bump to kernel version 29
Before this fix, trying to run a dill with version 28 (with named types
in it) on a new VM would crash.

Change-Id: I47851c236332aa14511f595b4b129e6354b395a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113689
Commit-Queue: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Auto-Submit: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-08-19 14:11:11 +00:00
Alexander Markov 79e6c74337 [vm/bytecode] Fix VM unit tests which load kernel with bytecode
Apparently these tests finalize everything which would trigger
loading of vm_service and fail with error

../../runtime/vm/benchmark_test.cc: 156: error: expected 'result' to be a valid handle but found an error handle:
    'error: native function 'VMServiceIO_NotifyServerState' (1 arguments) cannot be found'

Change-Id: Ibb280d103c4bfe3020d43887df0d2307a4a10fff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113274
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-17 00:07:40 +00:00
Alexander Markov de45a3f765 [vm/bytecode] Fix vm/cc/TryCatchOptimizer unit tests
These tests look for local variables by names in LocalScope.
However, in bytecode we keep information about local variables only
for debugging and LocalScope objects are not created.

This change adds implementation of local variables lookup using bytecode
debugging information. In PRODUCT mode (which doesn't have debugging
information) these tests are disabled.

Change-Id: Ia5eafb440fa19bc1007582a360c36a87aa637e6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113271
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 23:38:40 +00:00
Felicitas Hetzelt 2a41a800fe [vm/fuzzer] Add FFI methods
Rationale:
To test the dart FFI we add method calls which are tunnelled through the
FFI.

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

Change-Id: I3852ea48cab3e542dcc48520df279ec6ac850b51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113260
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-08-16 23:10:30 +00:00
Alexander Markov ea7348c5f0 Revert "[vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode"
This reverts commit beee442625.

Reason for revert: StackOverflow on language_2/deep_nesting_expression_test/01 in interpreted mode.

Original change's description:
> [vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode
> 
> Temporary setting of FLAG_enable_interpreter is avoided in the VM unit tests as
> this flag is global and used by kernel service isolate while running tests.
> Flipping this flag causes assertion failures in kernel isolate's background compiler
> or infinite loop between LazyCompile stub and CompileFunction as AttachBytecode
> doesn't set entry point to InterpretCall.
> 
> The less intrusive way to ensure compilation of functions in unit tests is to set
> FLAG_compilation_counter_threshold to 0.
> 
> Change-Id: Ia46ff8d03d66ab8b147b9d89336548c4a9c29f5d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113123
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

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

Change-Id: I67cd03a56f9a2d29aa6597d38779e77ca3a16b18
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113480
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 22:39:52 +00:00
Alexander Markov beee442625 [vm/bytecode] Switch kernel service dill to bytecode if building Dart SDK with --bytecode
Temporary setting of FLAG_enable_interpreter is avoided in the VM unit tests as
this flag is global and used by kernel service isolate while running tests.
Flipping this flag causes assertion failures in kernel isolate's background compiler
or infinite loop between LazyCompile stub and CompileFunction as AttachBytecode
doesn't set entry point to InterpretCall.

The less intrusive way to ensure compilation of functions in unit tests is to set
FLAG_compilation_counter_threshold to 0.

Change-Id: Ia46ff8d03d66ab8b147b9d89336548c4a9c29f5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113123
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-08-16 20:53:10 +00:00
Alexander Markov 6728a9f515 [vm] Add more descriptive error messages to VM unit tests
New error messages simplify triaging problems related to kernel compilation
and loading of snapshot.

Change-Id: I46e8cb51fd2d209c5af97a3edb99f22bae2020f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113401
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 20:39:15 +00:00
Johnni Winther eae781c73e [cfe] Add Field.isLate, VariableDeclaration.isLate and VariableDeclaration.isRequired
Add support for the `late` modifier on fields and local variables in
CFE, and `required` on named parameters When using the option
--enable-experiment=non-nullable the `isLate` and `isRequired` flags will be set
accordingly on Field and VariableDeclaration nodes.

Closes #37686
Closes #37684

Change-Id: If37fc93defdabc5cc974f3f068f57752a665f4cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113036
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2019-08-16 19:39:05 +00:00
Alexander Markov b4b1d5ddac [vm/bytecode] Avoid eagerly reading all bytecode in app-jit snapshots
Reading all bytecode results in significantly higher memory usage due to
more classes finalized and more Function, Field, OneByteString, ObjectPool
and Bytecode objects.

dart2js-compile/CompileHelloMemoryUse benchmark with bytecode:
heap.old.capacity.max 121.387 -> 112.016 MB

Change-Id: Ic702a1c61613e1fc0c2d1f0b3a972da238bab838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113140
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-16 19:31:40 +00:00
Teagan Strickland 2a3b844b41 [vm] Disallow copy assignment for hash maps.
Also disallow copy constructors where there are not current users.

Change-Id: I1cf6419e697a8e92eadd017faa71394a3572311a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113322
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-16 14:34:57 +00:00
asiva 2023f09b56 [VM] For app-jit snapshot on MacOS 10.15 and higher mmap ANONYMOUS pages and
read the app-jit snapshot into this memory instead of directly mapping
the app-jit snapshot.

use MAP_JIT option only for executable pages and do not use it on iOS.

Change-Id: I8db6f29293677bbf36209473709077115b7b489e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113219
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-08-16 04:39:02 +00:00
Régis Crelier f236abc902 [vm/bytecode] Emit DebugStepCheck calls when compiling bytecode.
Change-Id: I3a5afbdbefbf7c034e6ee01a6bcf5f6922fedf43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113261
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-16 02:38:52 +00:00
Ryan Macnak 9ae1d02537 [vm] Reduce Code::ResetSwitchableCalls from quadratic to log-linear time.
Change-Id: Iee7bc59bd3364270f8e3d26e4d776a7f95342ba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113206
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-15 22:48:42 +00:00
Ben Konyi 1219c5e3ab [ VM / Service ] Use the name of the a function's defining mixin instead of the
mixin application to qualify function names in profiler and exception stack traces.

Given:

```
class Foo {
  foo() => "foo";
}

class Bar with Foo {}
```

The stack frame for `foo()` currently displays as `Bar&Foo.foo`. Now,
the stack frame for `foo()` will have the name `Foo.foo`.

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

Change-Id: Ic1c0d00f38725ee088812ff0926eef4f343ebdf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111482
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-08-15 21:10:47 +00:00
Aart Bik 1523fbd96e [vm/compiler] Fixed bug with clamping on 32-bit arch
Rationale:
Feel the power of value-guided fuzzing that, in combination
with new types, founds this issue in the graph intrinsifier.
The deopt on the speculative code for Smi was missing.

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

Change-Id: I9f310f62eb6cf1cdb3e39685caed5b7792024565
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113203
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-08-15 21:05:02 +00:00
Zichang Guo 306f8e04bb [vm] path containing spaces when creating process On Windows
path may contain spaces. When it is passed into CreatProcessW, it will interpret in several ways. Escape path for CreateProcessW to remove ambiguity. Make sure [path] won't be escaped again.

Bug:https://github.com/dart-lang/sdk/issues/37751
Change-Id: I70914c7c2e17aad660126662ab0e83eebe348892
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112934
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-08-15 18:04:10 +00:00
Ryan Macnak 64e407bc04 [vm] Remove stale filtering of SendPorts when writing snapshots.
Change-Id: Iec1fb01fa1e43bbb93f3482cf295656e42150a36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113137
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-15 17:35:10 +00:00
Alexander Markov b60def0de4 [vm] Fix notifications of code observers from background compiler
This CL fixes crash in vm/cc/DartAPI_DartInitializeCallsCodeObserver
test after kernel service is switched to bytecode (so background
compilations are more likely to happen).

Change-Id: Idfc97f16f8658c953628ba0a878b1d6dd2d46186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113134
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-15 16:45:10 +00:00
Ryan Macnak cd16fba718 [vm, bytecode, reload] Rebind static referents instead of clearing bytecode.
Fixes vm/cc/IsolateReload_SavedClosure.

Change-Id: I792dad83c1d96c17bac9f65eb80cefa2875b5307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113132
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-15 16:31:01 +00:00
Teagan Strickland 2c49015cd5 [vm] Add (Zone*) overload for Object::ZoneHandle()
This aligns the overloads for ZoneHandle() in Object to match those
available in other classes.

Change-Id: I92ea915699b96966d67a030f011b371ea88ee756
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113180
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-08-15 09:12:00 +00:00
Teagan Strickland c30a2be812 [vm/compiler] Check current_ssa_temp_index in FlowGraphChecker.
Change-Id: I6da7fa6c37d65ce9d7c2adc4ee71ccc3d86e2ada
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113027
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-08-15 07:39:54 +00:00
Teagan Strickland e14300e7d9 [vm] Adding zone-passing constructor to IntMap.
Change-Id: I5d598b8e322b749793d4154751f9211e746daa10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113031
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-08-15 07:39:02 +00:00
Aart Bik 2ea18498e9 [vm/compiler] Improve range analysis over MOD
Rationale:
Improves range analysis over MOD with the goal
of removing more bounds checks in a[i % length]
array accesses.

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

Change-Id: I1fb275d53a00400e2343628295fa010ac9b21786
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112933
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-08-14 17:44:09 +00:00
Siva Annamalai ec2d06d4b9 Use MAP_JIT when doing an mmap for executable pages (needed for macOS Catalina).
Please refer to https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-jit for more details.

This is the Dart VM part for https://github.com/flutter/flutter/issues/36714

Change-Id: Ifbc0ce82921d5f05421e01ce2d19423a5f3e32f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112849
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-08-14 16:51:49 +00:00
Alexander Markov f87237c4e4 [vm/bytecode] Check context level when accessing await jump variable in debugger
Change-Id: I31250140d8410122c8358c16c4acf34833fe6852
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112982
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-14 16:31:19 +00:00
Ryan Macnak a2de29095e [vm] Implement fingerprints for bytecode functions.
To be used as an approximate check of the compatibility of closure contexts.

Change-Id: Ib5685cf652ddb86628e718bc4f18a81667515d04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112846
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-08-14 15:47:09 +00:00
Alexander Markov e35e8833ee [vm/bytecode] Take context level into account when accessing async context vars
Previously this was done only for interpreted frames. However, this
adjustment should be done for both compiled and interpreted frames
coming from bytecode.

Change-Id: Ia832f1cc2d0cf8e2b4ed736257abfc501f928e3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112983
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-14 15:13:39 +00:00
Teagan Strickland 812796ff3d [vm/compiler] Make BlockScheduler AllStatic.
The FlowGraph on which to run is available at each method call site, so
we don't need to store it.

This also avoids issues in the future if we ever rebuild the FlowGraph
entirely during compilation, since we won't be using a BlockScheduler
object that caches an older version of the FlowGraph.

Change-Id: I5653e1230131fbada3fe01cfa6c1ac37846fccb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113024
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-08-14 10:52:14 +00:00
Ryan Macnak 13005eec86 [vm] Limit heap size to 15GB on 64-bit systems to avoid fatal errors on page table exhaustion.
Compare 2d22b6ee6b.

Change-Id: I67c25030fca1aca144d6affb3108f10d20de5b6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99092
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-13 21:36:14 +00:00
Alexander Markov 449446571f [vm/bytecode] Collect context levels for compiled code generated from bytecode
Change-Id: Ia2047440e05fce3263f8feb38be4cedd4357ab10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112920
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-13 20:32:49 +00:00
Zichang Guo d83425be57 [vm] DirectoryWatch on windows stop immeidate issueRead after initialization
Once DirectoryWatcherHandle is created, it immediately send IssueRead() request to start monitoring the changes in the dicectory. But when changes are comming too fast, the following dart side stream has not been listened. The stream will hang forever.

Bug: https://github.com/dart-lang/sdk/issues/37233
Change-Id: I6100e62331009c2922d84c970d911867370eaeab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111342
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-08-13 19:58:01 +00:00
Felicitas Hetzelt 3707f39530 [vm/fuzzer] Track variables to avoid inf. loops
Rationale:
Many cases of the the loop iteration variable being modified within the
loop body, leading to infinite loops and timeouts. This patch tracks
currently active iteration variables and avoids emitting them on the lhs
of an assignment or within a pre/post operation.
Change-Id: I5e7c84f0de72410dc98d115d75b1f09e6631ece2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112843
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-08-13 19:39:12 +00:00
Zichang Guo 45f892df68 Revert "[vm] escape path when creating process on Windows"
This reverts commit 8a0ae573a1.

Reason for revert: Block 'flutter upgrade'. The manual escaped string should be escaped again.

Original change's description:
> [vm] escape path when creating process on Windows
> 
> path may contain spaces. When it is passed into CreatProcessW, it will interpret in several ways. Escape path for CreateProcessW to remove ambiguity.
> The api doc of CreateProcessW: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw#parameters
> 
> Bug: https://github.com/dart-lang/sdk/issues/37751
> Change-Id: Ia3486d9a8c6b38c526c651dd6a801e0b8dad8655
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112267
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: https://github.com/dart-lang/sdk/issues/37751
Change-Id: Ifae15d01b96d91ee88b24469e08ecb4ecc97a832
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112921
Reviewed-by: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-08-13 16:38:00 +00:00
Alexander Markov 20407e28db [vm/compiler] Follow redefinitions in Value::NeedsWriteBarrier()
This is needed in order to account for redefinitions with less precise
type, such as AssertAssignable of Smi to a generic T.

x64, bytecode compiler:
CryptoDecrypt(RunTime): 8516.8 -> 8190.6 us

Change-Id: I8c5b8eb3efcc7ae1ccf204f5081772081be29c2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112755
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-13 16:15:11 +00:00
Lasse R.H. Nielsen 9dcd7267ba Remove unnecessary completers from async_patch code.
Use _Future directly.

Add ability to get trace of awaited continuations.

Change-Id: I6c3aba0bdc2e54afe1d84fdd802fb5210d7598ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112721
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2019-08-13 10:49:50 +00:00
Felicitas Hetzelt 62aa02e716 [dart/vm] Fix type of loop variable to int
Rationale:
Some programs generated by dartfuzz.dart cause failures when executed
due to the type of a loop variable being inferred as 'num'.
By setting the type of such variables explicitly to 'int' we avoid such cases.
Change-Id: Ibdfd06ece28914ee26fd38f2b3efa20cd93ba9ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112754
Commit-Queue: Felicitas Hetzelt <felih@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-08-12 23:26:52 +00:00