The former contents of the VM isolate are now included into each isolate group. This makes each isolate group's heap independent, and in particular allows each heap to be allocated to a separate pointer cage (not done in this CL).
The duplicated stubs that allowed PC relative calls are removed, since the originals can now be the target of PC relative calls.
The bootstrapping needing to load an AppJIT or AppAOT snapshot is reduced to allocating the oddballs. The code is entirely dropped in the AOT runtime, but the JIT runtime still has it to allow for flags to affect the compilation of the stub code. Further refactoring might be able to remove this for the JIT runtime too, with only gen_snapshot knowing how to bootstrap.
Class serialization no longer distinguishes predefined classes.
The page containing null is marked as never-evacuate. null, false and true must not move because the compiler relies on their low bits having certain patterns for some optimizations. (Previously, the entire VM isolate heap never moved.)
Compaction is disabled for IA32. Due to register pressure, some stub calls must not use a scratch register and embed the address of Code.
The page containing the call-through-safepoint stub is frozen when running with --write-protect-code and the stub is created at runtime (instead of loaded from an AppJIT or AppAOT snapshot). This stub must remain executable even during a safepoint, as a foreign call might during return during a safepoint and only block after the stub directs it to the runtime.
The snapshot symbols are renamed to kDartSnapshotData and kDartSnapshotText. There is no need to distinguish the VM isolate's snapshot, and snaphots are per isolate group not per isolate. Aliases with the old names are added to ease migration.
Some global flags that were automatically set based on the VM isolate's snapshot are now isolate group flags and automatically set by the isolate group's snapshot.
TEST=ci
Change-Id: Iee82016057d609112e9b021d178fc3d4d18b5044
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/500621
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
SLSA-Policy-Verified: SLSA Policy Verification Service <devtools-gerritcodereview-exitgate@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Since null safety, all static fields with initializers are implicitly
late. This change cleans up transition_sentinel which was used in
the detection of cyclic initialization of legacy static fields.
TEST=ci
Change-Id: I6a990dc8ba030f5bd40eb0b86706cbfb0f725e33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/373520
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Previously, inliner was able to inline closure calls only when closure
was allocated in the current function (or in a function which was
inlined so far). This is not true for local functions declared in outer
functions (they are allocated at declaration site).
Now, when calling local functions, target of closure call is always
known regardless of where the function is declared, so calls to local
functions can be inlined.
TEST=runtime/tests/vm/dart/inline_local_functions_il_test.dart
Fixes https://github.com/dart-lang/sdk/issues/52695
Fixes https://github.com/dart-lang/sdk/issues/15558
Change-Id: I0e51dbaf63a6d4427bff366b40414ca5fac3d418
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311465
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL changes how canonical sets for some specific types are written
into the root snapshot: instead of writing canonical set as a separate
object we reorder objects within a canonical cluster in such a way that
the order matches order of elements in the backing store of a canonical
set and then we write canonical set layout out using differential
encoding (essentially writing gaps between elements instead of writing
absolute indices).
This significantly reduces the overhead of having canonical sets in the
snapshot while maintaining fast deserialisation: for example on build
microbenchmark this brings regression in the snapshot size from 4% to
.3%.
On sizeopt benchmarks:
flutter_gallery_app_so_gzip_size -1.5%
flutter_gallery_app_so_size -4.7%
flutter_gallery_total_heap_size -16.2%
TEST=ci
Change-Id: I2be7fd073668e9b52098e2acda9f11d128cfda95
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,pkg-linux-release-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185381
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
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>
Reverse use of the backing store and transition sentinel as bookkeeping values. Use transition sentinel to mark unused entries, since it has a short object id during clustered serialization. Use the backing store to mark deleted entries; deletion seems to only be used for enum values during a hot reload.
Change-Id: I52f0edcbc7e26f73843500cd378da31ea3b1e0ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137680
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Summary:
The constants table contains a concatenation of the variable-length encodings of
each constant used in the serialized component. Previously, we referenced the
constants in the code by index into the constants table, which requires reading
potentially the entire constants table to dereference. Now, we refer to the
constant by the binary offset into the constants table, which allows us to peek
into it in constant time.
Test Plan:
The constants table is used by all the precompiler modes, so the new encoding
will inherit the coverage of the existing encoding.
Results from debug and release precompiler bots are available under the
"cl-linux-try" button.
Change-Id: I4782bc0035d0b0cbd5bd6b9d086561ea601286c8
Reviewed-on: https://dart-review.googlesource.com/55470
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This reverts commit 3ad4bff4e7.
Reason for revert: failures in language_2/cyclic_type_test/03
Original change's description:
> [VM] Use quadratic probing in hash_table.h
>
> On my workload this reduces the probing by 19% for the CanonicalType
> table, and reduces the number of insertions that take 25 probes or
> more by 74%. Max load is reduced from 0.75 to 0.71. The size is now
> a power of 2 so we can use masking instead of integer division, and
> we use quadratic probing in order to reduce clustering.
>
> R=kustermann@google.com
>
> Change-Id: I806197680a839dac99b7c7f5f09d2bce4d015235
> Reviewed-on: https://dart-review.googlesource.com/34760
> Commit-Queue: Erik Corry <erikcorry@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=kustermann@google.com,erikcorry@google.com
Change-Id: If1b917d5b8200add80ddfcc7427b134bfb1bee38
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/35320
Reviewed-by: Erik Corry <erikcorry@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
On my workload this reduces the probing by 19% for the CanonicalType
table, and reduces the number of insertions that take 25 probes or
more by 74%. Max load is reduced from 0.75 to 0.71. The size is now
a power of 2 so we can use masking instead of integer division, and
we use quadratic probing in order to reduce clustering.
R=kustermann@google.com
Change-Id: I806197680a839dac99b7c7f5f09d2bce4d015235
Reviewed-on: https://dart-review.googlesource.com/34760
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The counters for growing and collisions are not needed otherwise.
This avoid data races on concurrent reads (which would previously
update the counters, even if reporting is disabled)
BUG=
R=rmacnak@google.com
Review-Url: https://codereview.chromium.org/2575913002 .
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER
This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.
R=asiva@google.com, rmacnak@google.com
Review URL: https://codereview.chromium.org/2450713004 .
This CL removes the use of STL map from freelist.cc by adding
MallocDirectChainedHashMap in hash_map.h and adding an iterator for
BaseDirectChainedHashMap there.
It also removes a use of STL map from hash_table.h that was dead code.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/2083103002 .
- Do not create/add function when looking them up in TryCreatICData
- Do not allow background compilation to add/remove functions
- Cache function hash array as it may change or be set to null.
Check VMObject only if FLAG_verify_handles is true.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org/1709273003 .
A combination of two independent interface changes:
1. Constructor takes a RawArray* and allocates its own Array handle.
2. Release provides access to the entire handle, rather than just the raw.
This results in a very clean usage pattern, like:
FooTable table(get_foo_table());
table.Insert(obj);
...
set_foo_table(table.Release());
Having the isolate inside HashTable also allows faster allocation of temporary handles.
R=iposva@google.com
Review URL: https://codereview.chromium.org//428273002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38794 260f80e4-7a28-3924-810f-c04153c831b5
(Patch Set 1 is identical to r37716; Patch Set 2 renames some typedefs to avoid confusing MSVC)
Highly customizable to support various internal uses as well as the basis for user-level classes.
Use in Library's resolved names cache.
Next step is to add new instance classes for the user-level maps/sets (akin to GrowableObjectArray).
TBR=asiva@google.com
Review URL: https://codereview.chromium.org//348313005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37800 260f80e4-7a28-3924-810f-c04153c831b5