Printing out the flow graph before and after round trip serialization
revealed slight differences between the flow graphs that might lead
to either bugs or different results in compilation. Remove these
differences.
Also in this change:
* Remove cases where printing or serializing a flow graph could have
the side effect of creating new `CompileType`s or `AbstractType`s
not previously in the graph.
* Ensure reaching types for `Value`s are cloned if the binding
definition changes and check that reaching types either have no
owner or are owned by the `Value`'s definition with the
FlowGraphChecker. (Before this change, we had `CompileType`s in
the graph whose owner had long since been removed from it.)
* Adds `ASSERT`s to check that unexpected non-canonical `Instances`
are not allowed as the value of `ConstantInstr`s and adds some
canonicalization that did not previously occur.
Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I334ffa2a6383291a7cb318343c71bd55a41269a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117143
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Fixes the changes to assembly snapshot writer in SIMARM_X64 mode. This unfortunately can't be tested until the ELF loader is available.
Take 2 is in patchset 1.
Change-Id: Ib8b067dd4f09dcba3b142705e9cb4dfbf4e3eb53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117726
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Lazy lookup of source and line starts for scripts loaded from bytecode
(implemented in https://dart-review.googlesource.com/c/sdk/+/112680)
relied on source == Symbols::Empty() as an indication that lazy lookup is
needed. However, when Script object is written into app-jit snapshot,
its source is set to null which disables lazy lookup.
This change introduces 'LazyLookupSourceAndLineStarts' flag in Script
objects to avoid relying on value of 'source'.
Fixes service/valid_source_locations_test with bytecode in app-jit mode.
Change-Id: I38174a13d745a1ad9fecad466df745b1df527878
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117214
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Remove this unnecessary field. Both ExceptionHandlerList and ExceptionHandlers not use token position. TokenPosition passed from CatchBlockEntryInstr() is always NoSource.
Change-Id: I3857ff3d1f9217f565c2d159fa980350ebd4bc47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117040
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
Before this change, there were 2 ways of getting target of dynamic invocation
forwarder: Function::GetTargetOfDynamicInvocationForwarder() which looks up
using the name, and Function::ForwardingTarget() which returns a target saved
when dynamic invocation forwarder was created.
Apparently we should use Function::ForwardingTarget() when compiling dynamic
invocation forwarder, as we might find a different function after hot reload.
It was the last use of GetTargetOfDynamicInvocationForwarder(), so cleaned it up.
Fixes language_2/flatten_test/01 with bytecode in hot reload mode.
Change-Id: Ibe3117c16509fe5d94fcdd1a2a2b12f2049efad2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117014
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Adds support for:
AssignAssertable
BooleanNegate
LoadClassId
NativeCallInstr
Throw
Results from compiling hello world program:
* Early round trip:
* Contains unhandled instructions: 1565
* Failed during deserialization: 10
* Successful round trips: 2696
* Late round trip:
* Contains unhandled instructions: 2404
* Failed during deserialization: 12
* Successful round trips: 1755
Deserialization failure reasons:
* Early round trip:
* no handling for local functions: 10
* Late round trip:
* no handling for local functions: 7
* out of range index for pushed argument: 5
(see https://github.com/dart-lang/sdk/issues/38354)
Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I56f875a68876b4d94ac1256be207df8b98ba0ea0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116320
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Adds support for:
AssertBoolean
InstanceCall
Also handles deserializing of TypeRefs and
serialization/deserialization of non-megamorphic
ICData.
Results from compiling hello world program:
* Early round trip:
* Contains unhandled instructions: 2469
* Failed during deserialization: 9
* Successful round trips: 1772
* Late round trip:
* Contains unhandled instructions: 2892
* Failed during deserialization: 11
* Successful round trips: 1268
Deserialization failure reasons:
* Early round trip:
* no handling for local functions: 9
* Late round trip:
* no handling for local functions: 6
* out of range index for pushed argument: 5
(see https://github.com/dart-lang/sdk/issues/38354)
Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I7a3731d4cc3df0bfa1e270adbdfc2faddd110af0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115219
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Since Dart 2, library prefixes are always loaded eagerly on the VM.
Also remove reload check for deferred prefixes. This check was added to avoid behavior of library prefixes giving spurious "not loaded" errors after a reload, but now this error can never occur. Resolves a difference in reload between AST and bytecode modes, since bytecode mode isn't surfacing the deferred property.
Change-Id: Ide5fb6cac2efc90ca1b108a35bc09d342cbd60de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116051
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Until now it was possible to register classes with a default size (16 bytes on 64-bit)
and later on change the size for the cid.
This CL changes this to ensure the size information in the class table
for a given cid is either 0 or the final instance size (and adds an
ASSERT for it)
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I94c61c6a1566c13dec7b9eb80c9ae0dadf0e6b6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115861
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
The original change is in Patchset 1.
The dependency contains the fix for the non-bare-instructions bot.
Change-Id: Iab02ab0736a2ee9144b667d2777ca526341b2a36
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-bare-linux-release-x64-try,vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115241
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Handle allocation is extremely common, and it always already has a call to VMHandles::Allocate[Zone]Handle, so we save a lot of binary size by avoiding inlining the TLS and initialization code.
-488k (-2.04%) out/ProductX64/exe.stripped/dart
-256k (-5.07%) out/ProductX64/exe.stripped/dart_precompiled_runtime
Change-Id: I677005c9653c87597ba20144b4326b66d0bf0ee5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115608
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This reverts commit ecbea5a58e.
Reason for revert: broken with bare instructions and ABI bot
Original change's description:
> [vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).
>
> To do this, we add writable data sections (currently uninitialzed) to ELF and Asm snapshots
> and allow Instructions to have patchable relocations against (the start of) these sections.
>
> Issue https://github.com/dart-lang/sdk/issues/37295 (see also for design & discussion).
>
> Change-Id: If20bfa55776f4044aaa6bb8ea2101d2ada41842c
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110221
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=kustermann@google.com,rmacnak@google.com,alexmarkov@google.com,sjindel@google.com
Change-Id: I9787da6d42575ca4f5ae0a698052a19ac4275afd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-product-x64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-android-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115240
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
To do this, we add writable data sections (currently uninitialzed) to ELF and Asm snapshots
and allow Instructions to have patchable relocations against (the start of) these sections.
Issue https://github.com/dart-lang/sdk/issues/37295 (see also for design & discussion).
Change-Id: If20bfa55776f4044aaa6bb8ea2101d2ada41842c
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110221
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Adds support for:
CheckStackOverflow
Parameter
SpecialParameter
Adds handling of Integer, Double, Class, Type, and TypeArguments
in ParseDartValue. Adds handling of values visited in the graph prior
to the corresponding definition to keep traversal of block contents as
one pass.
Results from compiling hello world program:
* Early round trip:
* Contains unhandled instructions: 4157
* Failed during deserialization: 0
* Successful round trips: 21
* Late round trip:
* Contains unhandled instructions: 4023
* Failed during deserialization: 29
* Successful round trips: 126
Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: Icb2972749ee86891d5847519a3b5097ad5c63c54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113326
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The mutator has to ensure all writes to the ICData are flushed before we set the
megamorphic bit.
Similarly the BG compiler has to ensure (during cloning of ICData) that all
loads from the ICData happen after we've determined whether the megamorphic
bit has been set.
This allows us to maintain the invariant that if the ICData is marked as
megamorphic, the entries in it will have reached FLAG_max_polymorphic_checks.
Issue https://github.com/dart-lang/sdk/issues/37595
Change-Id: Idec7aef8ca1369668f5c9c57b7b32759acbd270d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114322
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Collect token positions of field declared in bytecode.
Improve debugger debugging: Disassemble both bytecode and code when applicable.
Change-Id: I56188cf24ef4bfe8a93cce11c2f4505152abdd02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112680
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
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>
This is the beginning of allowing us to - wherever we process kernel
data - make decisions based on the kernel version. Said another way,
we can actually start to change the kernel format without breaking
backwards compatibility in the VM.
Change-Id: Ied7b3d9fe72976c4f3c0895d02b6ab70e0f5dba9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111642
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Hot-reload used to be implemented by calling a tag handler (i.e. embedder),
which would load new Dart source code and call recursively into hot reloading
code.
=> This no longer happens, since the hot reload implementation obtains and
loads the kernel diffs itself in isolate_reload.cc.
With the switch to the Dart 2.0 CFE the VM no longer supports any kind of
deferred library loading. The CFE provides the VM with all sources together.
This CL cleans up some unnecessary code and outdated comments.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I63aaa6e2a1910165185172a9dd975c3974ac5dd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110720
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
While stepping, do not stop more than once in the same token range.
Adjusted tests expecting multiple stops at same location.
Fixed emitted source position of DebugCheck opcode in async op.
Ignore all possible breakpoint positions until the first DebugCheck opcode of
the function, so as to not stop in the prologue where arguments are not yet
accessible.
Fixed look up of context level in debugger.
Use receiver to look up async op closure in frame instead of named captured
variable.
Made StoreContextVar a 'debug checked' opcode.
Implemented rewind of interpreted frames.
Marked get_source_report_test as (temporarily) failing in status file.
Removed fixed and passing regression test from status file.
Change-Id: I9396d3cf4b6accc85753bb6d227b7c068acc8df7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109558
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The CheckStack bytecode does not denote a debug point anymore after the
introduction of the DebugCheck bytecode.
Fix caller/callee determination in mixed mode.
Factorize some code.
Change-Id: Ide1e0bbad022a83e6113243dc996396f9f5d2f3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108565
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>