Commit Graph

13143 Commits

Author SHA1 Message Date
Ben Konyi f7cc17fb7e [ package:vm_service ] Fix issue where null was returned instead of @Instance of type Null
Also includes some cleanup for next release.

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

TEST=pkg/vm_service/test/regress_44842_test.dart

Change-Id: I250fac7c52d6d5344bd5c3ec1c143deaa97419d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182369
Reviewed-by: Gary Roumanis <grouma@google.com>
2021-02-03 21:10:28 +00:00
Ben Konyi 565dc5b6a2 Reland "[ VM / Service ] Report identity hash codes of objects at end of heap snapshot"
This reverts commit 7083692624 in order to
reland commit 8d99d295da.

TEST=N/A

Change-Id: I06c80a666a9307caf0313fef1fde212ec801203c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182600
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-03 19:13:40 +00:00
Martin Kustermann 6f704e0e97 [vm/concurrency] Avoid invoking Dart code while holding IsolateGroup read lock
Once the vm-service isolate starts up it will iterate over all isolates
to discover already started isolates. It does so via iterating over all
isolate groups and all isolates within them. Doing so requires a read
lock.

Until now it has called into Dart while holding the read lock. This can
lead to a deadlock, since calling Dart code can trigger JIT compilation
which can trigger various things that require the same lock.

Instead, this CL accumulates a list of (isolate-main-port, isolate-name)
pairs while iterating over isolate groups and the isolates therein.
Afterwards it registers those isolates in a bulk - without holding any
locks.

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

TEST=Refactoring of existing test suite. Fixes flaky timeouts.

Change-Id: Iea7013ce57cef2500700fb464972104c66357777
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182321
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2021-02-03 18:23:42 +00:00
Ben Konyi 7083692624 [ package:vm_service ] Prepare for 6.0.1 stable null-safe release
There is no diff between this version and 6.0.1-nullsafety.1.

This temporarily reverts commit 8d99d295da.

TEST=None

Change-Id: I3597b3543c9ea9122865604b9ba07c99683a5355
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182580
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-03 18:16:27 +00:00
Liam Appelbe c88e48939c [vm] Offsets extractor support for compressed pointers
TEST=CI
Change-Id: Ie39f7bc3454594ee5cb3a21fc829ee173ebc1eed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182080
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2021-02-02 19:26:34 +00:00
Vyacheslav Egorov d7a57a5df4 [vm] Add feature to connect AOT code to code comments via .debug_line
Option --write_code_comments_as_synthetic_source_to=file tells AOT
compiler to create a file which contains code comments for all code
objects written into an ELF snapshot and then emit a DWARF line number
program into .debug_line section which attributes code to code comments
in a way similar to how our own disassembler does it.

This enables tools like objdump to display our code comments as part of
the disassembly.

This CL also tweaks ifdefs in such a way that IL printer and code comments
facilities is now included into PRODUCT gen_snapshot binary.

TEST=manually run product build with --print-flow-graph and --write_code_comments_as_synthetic_source_to

Change-Id: Id6741013d43e1733b4ddeb34891a4d2fc06b9313
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181380
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-02 11:35:00 +00:00
Vyacheslav Egorov e5e88fd3cc [vm] Add vm:unsafe:no-interrupts pragma to force remove all CheckStackOverflow
For microbenchmarking it is good to be able to force VM to drop
all stack overflow checks in a given function to reduce overhead of the
measuring loop to the minimum.

This pragma might have other applications, e.g. to allow writing tight
loops in core libraries.

TEST=CheckStackOverflowElimination_NoInterruptsPragma

Change-Id: I07c7fec5c49a893bbb0e4f557d89f022b90be141
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181400
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-02-02 11:19:00 +00:00
Clement Skau 49398488da [VM] Fixes closure resolving in HandlesException
TEST=vm-kernel-precomp-*

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-debug-simarm_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-simarm_x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-nnbd-linux-debug-simarm_x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try,vm-kernel-precomp-nnbd-linux-release-simarm64-try,vm-kernel-precomp-nnbd-linux-release-simarm_x64-try,vm-kernel-precomp-nnbd-linux-release-x64-try,vm-kernel-precomp-nnbd-mac-release-simarm64-try,vm-kernel-precomp-nnbd-win-release-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try
Change-Id: Icfcfbc73d00464d8c4e287bfb43a40432837b80f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182220
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2021-02-02 09:20:00 +00:00
Clement Skau dfd5413952 [VM] Adds Debugger break for Future.catchError
TEST=Added new Future.catchError pause-on-unhandled-exceptions test.

Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: Ieb3cf834eacad4f9b98ab2db0e5813e9bfa09747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180840
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2021-02-02 06:59:54 +00:00
Alexander Aprelev 6dffbdabf1 [vm/concurrency] Deoptimize active code on all threads when debugging/hot reloading.
Issue dartbug.com/36097

TEST=existing vm test suite

Change-Id: I18951245b2c0f34e4b9a4babc0f859878c0f2109
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181560
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-02-02 02:58:23 +00:00
Ryan Macnak 1be6531474 [vm, compiler] Fold UnboxInt32(Constant(Mint)) and UnboxDouble(Constant(Mint)) to UnboxedConstant.
ConstantPropagator_Regress35371 notices the former fails to happen with compressed Smis.

TEST=ci
Change-Id: I4d1e974deec8515469dac4db79dfb0521d3a6e7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181960
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-02-01 22:50:41 +00:00
Ben Konyi 8d99d295da [ VM / Service ] Report identity hash codes of objects at end of heap
snapshot

TEST=pkg/vm_service/test/object_graph_identity_hash_test.dart

Change-Id: I71eff4e8bb2153d8ef1117bc90d078f678f358ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180484
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2021-02-01 22:37:21 +00:00
Ryan Macnak bbc7924586 [vm, arm64] Shorten some Smi tagging sequences using bit-field extract instructions.
TEST=ci
Change-Id: Ifa7f869448573f14b7075c0ebbe5737961e5423c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181961
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-02-01 21:46:41 +00:00
Ryan Macnak 6681bce565 [vm, arm64] Remove dead load from Mint unboxing.
TEST=ci
Change-Id: Icf0ff5b9b822df9184533fe7163965313b4ac1df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181962
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-02-01 21:14:51 +00:00
Alexander Aprelev 52dee1a66a [vm/concurrency] When deoptimizing, ensure mutators are stopped, then iterate over all threads stack marking the active code for deoptimization.
TEST=existing ci test suite

Issue dartbug.com/36097.

Change-Id: I166f1ebb00406693b97701407858533556bf640b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181240
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-02-01 20:50:01 +00:00
Alexander Markov 97e2f3ddc5 [vm/aot] Avoid retaining inlined functions with --dwarf_stack_traces
When --dwarf-stack-trace option is used, we don't use nor write inlined
functions information to the snapshot. However, we were retaining
Function objects corresponding to inlined functions.

On a large app, AOT-compiled in PRODUCT mode with
--dwarf-stack-traces on arm64:

Function objects in AOT snapshot -19.4%
Heap size used by objects in snapshot -4.45%
Total AOT snapshot size -2.35%

Flutter gallery AOT snapshot size
(release mode with --dwarf-stack-traces):
arm64 -1.1% (gzip -1.3%, brotli -1.4%)
arm -0.95% (gzip -1.2%, brotli -1.4%)

TEST=ci

Change-Id: Id2d7a2d6b6bff1a5929be97477b0e17a9afae475
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181700
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2021-02-01 18:26:29 +00:00
Alexander Markov 7f65bb475a [vm/snapshot] Add statistics for heap size of objects in snapshot
This statistics is printed with --print_snapshot_sizes_verbose.
It is useful in order to figure out how much memory is consumed by
program structure objects without running an application.

TEST=manual testing with --print_snapshot_sizes_verbose

Change-Id: I6eeae7b303ecaf44806deb0f532058492c1d5808
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181444
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2021-01-28 21:48:05 +00:00
Alexander Aprelev 2525e44a46 [vm/concurrency] Weaken FixCallersTarget assert so it doesn't crash if target_code has been deactivated just now.
TEST=standalone_2/io/shared_socket_test.dart

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

Issue dartbug.com/36097

Change-Id: I5abc17e7d133671a5a335d147a916559256859d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181520
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-01-28 21:16:05 +00:00
asiva 27deca1457 Revert "[vm] Defer object pools." and
"[vm] Defer object pool entries in instructions bare mode."

This reverts commit 0bf8d38b3d and
             commit 63d17b0ad8.

Reason for revert : Performance regression, please see https://github.com/flutter/flutter/issues/73794

TEST=(none it is a revert).

Change-Id: I828734f00c55d5095f632b154d7f4ab27a184baf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181542
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-01-28 21:13:35 +00:00
Vyacheslav Egorov c9da4cb257 [vm/tts] Fix TTS handling of Never
Similar to C<Never> as C<T> was not  handled on the fast path which
was caught by newly added assertion.

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

TEST=added cases to vm/cc/TTS* suite
R=alexmarkov@google.com

Fixed: 44789
Change-Id: If2d4ad66cbde036b0d81f7f63512396ed1164883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181406
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2021-01-28 09:36:40 +00:00
Alexander Aprelev 6b3abe0a98 [vm/concurrency] Add --experimental_enable_isolate_groups_jit flag, make --enable_isolate_groups AOT only.
Issue b/177800357.

TEST=existing test suite
Change-Id: Id6b113932ab7014b8fa6c105845c5c490b60f5e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181320
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-27 17:11:29 +00:00
Alexander Aprelev 645166a4df [vm/concurrency] Enable optimized compiler in JIT enable-isolate-groups configuration.
Add safepoint around patching the code.

TEST=existing test suite that runs with --enable-isolate-groups=true

Issue dartbug.com/36097.

Change-Id: I55c2763d71bbe90801b980969055d266d44a673c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181062
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-26 21:57:35 +00:00
Ryan Macnak a2a9bbbb0c [vm] Rename dart:_internal's is64Bit to has63BitSmis.
Uses of this property care about the range of Smis rather than the range of machine words.

TEST=ci
Change-Id: Ia2c4324590d3aab27d97da4ee40b0e701731e7e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181080
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-26 20:14:14 +00:00
Ryan Macnak 378dfc241d [vm, arm64] Add double-to-int32 conversion.
For compressed Smis. Ported from cf78da8a48.

TEST=ci
Change-Id: Iabdaf8ac0b7836c7656e60f5a3ddf19836fee8c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181021
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-26 20:07:39 +00:00
Ryan Macnak 69134ec75c [vm, arm64] Fix CallPattern assertion.
TEST=vm/cc/Call
Bug: https://github.com/dart-lang/sdk/issues/44623
Change-Id: I22197a345a7971353f59856efed5aa45af7d22ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181061
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-26 20:06:09 +00:00
Clement Skau c3ec3e53a1 [VM] Adds Future.then stack unwind. (3)
TEST=ASAN; Various 'causal' tests updated below.

Issues addressed in this revision:
- https://github.com/dart-lang/sdk/issues/44708 ASAN
- https://github.com/dart-lang/sdk/issues/44700 SegFault

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-asan-linux-release-x64-try,analyzer-linux-release-try,analyzer-analysis-server-linux-try,analyzer-nnbd-linux-release-try
Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
Change-Id: I8b8f6ee2e5d4ca2e6bea988ec1cd9f912ddf8240
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180186
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-26 14:02:39 +00:00
Vyacheslav Egorov 0f371f2dba [vm] Fix problems with TTS specialization
* Correctly handle _Smi type when producing TTS for it.
 Previously it would not correctly establish that an instance
 of _Smi is assignable to _Smi causing it to always fall through
 into runtime system;
* Correctly handle Null type as a type argument when checking C<Null>
 is C<X>, if Null is assignable to X we need to explicitly check if
 type argument is Null because cid ranges don't really handle this
 check.
* Strengthen the assert checking that TTS specialization succeeded:
 check that specialization is (bitwise) different from the previous
 version of the stub. If they are equal that means specialization
 failed.

TEST=vm/cc/TTS_SubtypeRangeCheck,vm/cc/TTS_Smi

Change-Id: I151a89b52ae07d7e5acce14f59bcb3226bfa1f36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180842
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-01-26 11:03:29 +00:00
asiva ac520f984d [ VM / CLI ] Add --verbosity to VM options
The verbosity option allows for specifying the CFE output verbosity

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

TEST=existing tests compile_test.dart and run_test.dart have new tests

Change-Id: I3d4e50811f84650aacf774ddb370a6eb765b9b24
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181100
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2021-01-26 03:01:58 +00:00
Ben Konyi 3187be979d [ VM ] Fix vm/cc/DartAPI_TypeGetParameterizedTypes using Dart_IdentityEquals() to compare types in unsound null safety mode
Fixes https://github.com/dart-lang/sdk/issues/44749

Fixed: 44749
TEST=Fixed test
Change-Id: Ibc378e0a82ca8317ba340ef7ac91b965281913b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180607
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2021-01-22 22:26:54 +00:00
Johnni Winther 55b34a467c Reland "[vm] Pass snapshot flag to kernel_service"
Enable reporting of null safety compilation mode when running
`dart compile aot-snapshot`, `dart compile jit-snapshot`,
and `dart compile kernel`.

Closes #44234

TEST=pkg/dartdev/test/commands/compile_test.dart

Change-Id: Id9e72751068d5f208055ab953d2c8392e84c4798
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180187
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-21 21:18:32 +00:00
Alexander Aprelev b01318a160 [vm/concurrency] Grab program_lock in type feedack loader for dynamic invocation forwarder creation.
Follow-up to efa1e18428.

Issue dartbug.com/36097.

TEST=vm\dart_2\type_feedback_test.dart

Change-Id: I6619adc17b89b1c63293954bcf8da592e3d4f919
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180262
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2021-01-20 23:10:23 +00:00
Ryan Macnak 9fd4b10fe5 [vm, reload] Allow reload of libraries containing deferred imports.
Previously, deferred imports were really deferred, and the VM would have needed to trigger more loading as part of checking the validity of a reload and handle the re-entrancy of the tag handler and restart the checking a reload: all messy control flow that was side-stepped by just erroring-out. Currently, the language and kernel are incapable of truly deferred imports, so we need only propagate the state bit that checks loadLibrary was called and completed before members are accessed through the deferred prefix.

TEST=deferred_import_reload_test
Bug: https://github.com/dart-lang/sdk/issues/26878
Bug: https://github.com/flutter/flutter/issues/73602
Change-Id: I48bf3e8331630b732d96393e02b12f86de8cc5b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179620
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-20 21:58:04 +00:00
Ryan Macnak 7a567a1b0b [vm, compiler] Don't try to inline implicit accessors that haven't been compiled yet.
Inlining will evaluate metadata, which can involve creating constants if the metadata wasn't previously evaluated. We currently can't handle creating new constants in the compiler because we lack a mechanism to trigger the field guard deopts from threads other than the main thread. Compare the general inlining case, which aborts if the inlining candidate wasn't previously compiled (on the main thread).

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/44714
Change-Id: Ib06d5697be6151f373f3242345be49d5c6ec61be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180084
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-01-20 20:54:27 +00:00
Alexander Aprelev efa1e18428 [vm/concurrency] Allow class finalization done by background compiler
This CL removes asserts that prevented background compiler from doing class finalization.
It adds program_lock synchronization for when object properties are updated during class finalization.
It also encloses code instructions installation into safepoint scopes to ensure that no code is executed during installation.

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

TEST=existing test suite

Change-Id: If297e44f51b187242eca2cdcfff066c8f6386d97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178163
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-20 20:08:25 +00:00
Ben Konyi fc48e553d5 [ Service / package:vm_service ] Allow for Sentinel value in Field.staticValue, fix null values in ClassList
Field.staticValue has always been able to take a Sentinel as a value but
was not correctly specified in the service spec. Updates the spec and
package:vm_service to allow for this case.

Also fixed an issue where FreeListElement and ForwardingCorpse were
being returned from getClassList.

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

TEST=pkg/vm_service/test/regress_44588_test.dart

Change-Id: I059717657533ff623a70d159a918d63e9e4b6cc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179020
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-20 19:25:46 +00:00
David Morgan 88c1be7e3b Revert "Reland "[VM] Adds Future.then and Future.catchError stack unwinding.""
This reverts commit 9978a246c1.

Reason for revert: VM crashes in google3, b/177506826

Original change's description:
> Reland "[VM] Adds Future.then and Future.catchError stack unwinding."
>
> This reverts commit 978b838461.
>
> Reason for revert: Fix: https://dart-review.googlesource.com/c/sdk/+/179762
>
> TEST=Various 'causal' tests updated below.
>
> Original change's description:
> > Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
> >
> > This reverts commit 8f2c47f24b.
> >
> > Reason for revert: We suspect this is causing VM crashes: http://b/177506826
> >
> > Original change's description:
> > > [VM] Adds Future.then and Future.catchError stack unwinding.
> > >
> > > TEST=Various 'causal' tests updated below.
> > >
> > > Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
> > > Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
> > > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
> > > Commit-Queue: Clement Skau <cskau@google.com>
> > > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> >
> > TBR=vegorov@google.com,cskau@google.com
> >
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/40815
> > Bug: https://github.com/dart-lang/sdk/issues/37953
> > Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998
> > Reviewed-by: Michal Terepeta <michalt@google.com>
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> > Commit-Queue: Michal Terepeta <michalt@google.com>
>
> TBR=vegorov@google.com,cskau@google.com,michalt@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: https://github.com/dart-lang/sdk/issues/40815
> Bug: https://github.com/dart-lang/sdk/issues/37953
> Change-Id: I8a1eb6679b01571b850499cac2dadc5bf9ef2dcd
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179763
> Reviewed-by: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Clement Skau <cskau@google.com>

TBR=vegorov@google.com,cskau@google.com,michalt@google.com

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

Bug: https://github.com/dart-lang/sdk/issues/40815
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I1274bcb375bf6f9cb0609d372b0b451d51eb99c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180147
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2021-01-20 12:44:55 +00:00
Aske Simon Christensen 903e92a196 Revert "[vm] Pass snapshot flag to kernel_service"
This reverts commit f8b0d26cc3.

Reason for revert: Multiple test failures in app-jit and simarm(64)

Original change's description:
> [vm] Pass snapshot flag to kernel_service
>
> Enable reporting of null safety compilation mode when running
> `dart compile aot-snapshot`, `dart compile jit-snapshot`,
> and `dart compile kernel`.
>
> Closes #44234
>
> TEST=pkg/dartdev/test/commands/compile_test.dart
>
> Change-Id: I0d4b35c6ccb4167c0c7539a4eb24a5139e29cf53
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178990
> Commit-Queue: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

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

Change-Id: I83aeaa8620c640d02d5ccfd1fe8112d8209a9ad4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179773
Auto-Submit: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-18 21:00:03 +00:00
Clement Skau 9978a246c1 Reland "[VM] Adds Future.then and Future.catchError stack unwinding."
This reverts commit 978b838461.

Reason for revert: Fix: https://dart-review.googlesource.com/c/sdk/+/179762

TEST=Various 'causal' tests updated below.

Original change's description:
> Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
>
> This reverts commit 8f2c47f24b.
>
> Reason for revert: We suspect this is causing VM crashes: http://b/177506826
>
> Original change's description:
> > [VM] Adds Future.then and Future.catchError stack unwinding.
> >
> > TEST=Various 'causal' tests updated below.
> >
> > Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
> > Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
> > Commit-Queue: Clement Skau <cskau@google.com>
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
>
> TBR=vegorov@google.com,cskau@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Bug: https://github.com/dart-lang/sdk/issues/40815
> Bug: https://github.com/dart-lang/sdk/issues/37953
> Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998
> Reviewed-by: Michal Terepeta <michalt@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Michal Terepeta <michalt@google.com>

TBR=vegorov@google.com,cskau@google.com,michalt@google.com

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

Bug: https://github.com/dart-lang/sdk/issues/40815
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I8a1eb6679b01571b850499cac2dadc5bf9ef2dcd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179763
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-01-18 12:15:49 +00:00
Clement Skau 6313c1c47c [VM] Fixes wrong static_type_exactness_state_
This fixes an internal test crash where snapshots are compiled
with an x64 toolchain and run on ia32:

`runtime/vm/compiler/backend/il_ia32.cc: 1859: error: unimplemented code`

TEST=tools/test.py -n dartk-linux-debug-ia32 vm/dart_2/causal_stacks/

Change-Id: I9ac652e428e5463926052e0c94c430c86eadd4bc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179762
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-18 12:03:29 +00:00
Johnni Winther f8b0d26cc3 [vm] Pass snapshot flag to kernel_service
Enable reporting of null safety compilation mode when running
`dart compile aot-snapshot`, `dart compile jit-snapshot`,
and `dart compile kernel`.

Closes #44234

TEST=pkg/dartdev/test/commands/compile_test.dart

Change-Id: I0d4b35c6ccb4167c0c7539a4eb24a5139e29cf53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178990
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2021-01-18 09:27:59 +00:00
Martin Kustermann 1b38b85223 [vm/concurrency] Rename IsolateReloadContext -> ProgramReloadContext
As part of making the compiler and other subsystems independent
of `Isolate` we have to move various state from `Isolate` to
`IsolateGroup` (or to another place).

Part of that is `Isolate::reload_context()`. In order to avoid name
conflict of what a `reload_context()` is, we separate it into
`reload_context()` and `program_reload_context()` where the former
contains GC information and the latter contains information about
changes in program structure.

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

TEST=Pure refactoring - relying on existing test coverage.

Change-Id: I7e1b732ce8b34c8842718699d618be542bd59ff6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177863
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-16 15:42:53 +00:00
Ryan Macnak b1c09ecd8f [vm] Make naming more consistent when converting between handles, tagged and untagged pointers.
Currently we have things called XPtr which are not what you get from ptr().

Old world:
handle->raw() returns RawObject* (tagged)
raw_obj->ptr() returns RawObject* (untagged)

After 6fe15f6df9:
handle->raw() returns ObjectPtr
obj_ptr->ptr() returns ObjectLayout*

New world:
handle->ptr() returns ObjectPtr
obj_ptr->untag() returns UntaggedObject*

TEST=ci
Change-Id: I6c7f34014cf20737607caaf84979838300d12df2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149367
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-15 23:32:02 +00:00
Ryan Macnak 63d17b0ad8 [vm] Defer object pool entries in instructions bare mode.
dart2js+analyzer product X64 bare:
app.so            9289320 ->  8491864 (-8.58%)
app.so-2.part.so 12010936 -> 12315880 (2.53%)
app.so-3.part.so  7579704 ->  7847768 (3.53%)

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: I8e695966bc11c3912a01cd525ca69be6ef8e5ea2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171102
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2021-01-15 03:32:44 +00:00
Ryan Macnak 7fcdd65b45 [vm] Ensure release-acquire ordering for variously lazily populated fields that are consumed without acquiring a lock.
TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/36097
Change-Id: I20c871ae4b4451b876b9b8bc5dde910dfedb6d65
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179400
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-15 01:44:12 +00:00
Ryan Macnak b02cd95263 [vm, compiler] Fix per-Code ObjectPools to track all the objects used by a Code in bare instructions mode.
Fix disassembly in bare instructions mode to query the global object pool.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: I3ad66a8cd7d9ee19c848b68ed584d58dca6bf583
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179300
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-14 23:06:56 +00:00
Ryan Macnak fe93564d77 [vm] Fix compile-time errors building for ARM64 Mac.
TEST=build
Change-Id: I07b83f7f86211baf6d0b1b4b517eb1bf08e5c0db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178923
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-01-14 21:23:43 +00:00
Regis Crelier f978dbe054 [VM/runtime] Replace kernel provided type parameter names by canonical ones.
When a function type does not describe the signature of a function (e.g. when it just describes a function type literal), the names of the type parameters are not relevant and can be replaced by canonical names allowing proper canonicalization of type literals.

TEST=fixes upcoming language/nnbd/const/type_literals_test

Change-Id: I62924ef619ae3f5a2fe5964f45c8d60990f3aa69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179060
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-01-14 19:59:33 +00:00
Ryan Macnak 5052848af3 [vm] Finalize early when building flow graph for a constructor call to synchronize populating Class::num_type_arguments_.
Hold the program structure read lock during private function lookup to acquire initializing stores.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/36097
Change-Id: I4a35560feddeaffd6e3a5ba3705547af8f492b51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179061
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-01-14 18:01:03 +00:00
Michal Terepeta 978b838461 Revert "[VM] Adds Future.then and Future.catchError stack unwinding."
This reverts commit 8f2c47f24b.

Reason for revert: We suspect this is causing VM crashes: http://b/177506826

Original change's description:
> [VM] Adds Future.then and Future.catchError stack unwinding.
>
> TEST=Various 'causal' tests updated below.
>
> Bug: https://github.com/dart-lang/sdk/issues/40815, https://github.com/dart-lang/sdk/issues/37953
> Change-Id: I1420d6163ac2e3b22e0971f7b0ad516895dded70
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176662
> Commit-Queue: Clement Skau <cskau@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,cskau@google.com

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

Bug: https://github.com/dart-lang/sdk/issues/40815
Bug: https://github.com/dart-lang/sdk/issues/37953
Change-Id: I870f0202f43588f71a5d2b0f82338978b5a5dda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178998
Reviewed-by: Michal Terepeta <michalt@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Michal Terepeta <michalt@google.com>
2021-01-14 13:56:53 +00:00
Regis Crelier 16f2a1edc5 [VM/runtime] Implement constant canonical type erasure when reading from kernel.
Modify the constant verification when writing a full snapshot in agnostic mode.
The implemented changed are specified in https://github.com/dart-lang/language/pull/1389
This (partially) fixes issue https://github.com/dart-lang/sdk/issues/44643
More work may be required for type parameter names of type literals.

TEST=new tests added in https://dart-review.googlesource.com/c/sdk/+/178929

Change-Id: Ie42bbe482763f8e737c3f5bd26e7752511e7398e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178927
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-01-13 20:26:18 +00:00