Commit Graph

75 Commits

Author SHA1 Message Date
Ryan Macnak dce0b514d4 [vm] Defer object pools and object pool entries.
This defers literals, to effectively split binary size for libraries that are more data than code, such as localizations.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: I506722037cc0247b90756959e6a6f12bb5021b5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183781
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-03-04 23:19:30 +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
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
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 0bf8d38b3d [vm] Defer object pools.
This is a step toward deferring literals, to effectively split binary size for libraries that are more data than code, such as localizations. Bare instructions mode still has all constants in the root snapshot because it has one global ObjectPool.

dart2js+analyzer product X64 non-bare:
app.so           10072728 ->  8479824 (-15.8%)
app.so-2.part.so 14074512 -> 15016976 (6.69%)
app.so-3.part.so  9225936 ->  9888984 (7.18%)

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: If61f6156e3fc2dd539331335b3bf0458102b7c75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168991
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2021-01-08 22:11:03 +00:00
Regis Crelier b3bca1821c [VM/runtime] Decouple representation of function signatures from Function objects.
This fixes issue https://github.com/dart-lang/sdk/issues/43088

This CL improves on https://dart-review.googlesource.com/c/sdk/+/166920 by keeping the names of type parameters.

See go/dart-vm-signatures for motivation for this change.

TEST=existing suites

Change-Id: Ia82f1d322f72d07b2fb253cf914f9b868025c71e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176981
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-07 23:45:37 +00:00
Martin Kustermann 5cd0770c9c [vm/concurrency] Move closure function related state from Isolate to ClosureFunctionsCache
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).

The access of `ObjectStore::closure_functions()` was spread out over our
codebase, including from `Isolate`. This CL moves it to a centralized
place - ClosureFunctionsCache.

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

TEST=Pure refactoring - relying on existing test coverage.

Change-Id: I3b282623f07614cdc2c2a863bd5b9d6c7748d36f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177130
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-07 09:41:27 +00:00
Martin Kustermann 0f76981bb1 [vm/concurrency] Change references to class_table/object_store/heap from Isolate to IsolateGroup
As part of making the compiler and other subsystems independent
of `Isolate` we have to move various state from `Isolate` to
`IsolateGroup`.

The class_table and object_store were already moved to `IsolateGroup`.

This CL only replaces usages of `Isolate::{object_store,class_table}`
with the equivalent in `IsolateGroup`.

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

TEST=Pure refactoring - relying on existing test coverage.

Change-Id: I34a0682d715b054d6c5faff077a513980f59a348
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177126
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-06 15:22:11 +00:00
Alexander Markov 7588ed86de Remove bytecode mode from the VM
Change-Id: Ief167b7ffc128105a03cc225ab750234c9a6a7a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169147
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-28 17:42:35 +00:00
Alexander Aprelev 20b8b1c0cf [vm/concurrency] Introduce a read lock acquisition of program_lock.
Bug: https://github.com/dart-lang/sdk/issues/36097
Change-Id: I36e661cd448327e7391ed854af4173c31e523430
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159645
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-10-27 23:51:57 +00:00
Tess Strickland 45a46ca2b8 [vm] Add (S)LEB128 encoding/decoding to BaseWriteStream.
Unlike cfc8e6de, this does _not_ replace the default variable length
encoding for {Read,Write}Streams, but insteads adds separate
{Read,Write}{S,}LEB128 methods to the appropriate classes. If we later
find the cause of the issues that led to the revert of cfc8e6de, it'll
be easy to switch over then.

Note that WriteLEB128 asserts that the value is non-negative if used
with a signed type (since negative values suggests that SLEB128 should
be used instead for minimal encoding).

Also removes the various other encoding and decoding methods for
(S)LEB128 across the codebase and changes those clients to use
{Read,Write}Streams instead.

Other cleanups:

* Various constant-related cleanups in datastream.h.

* Adds DART_FORCE_INLINE to ReadStream::ReadByte and uses it in the
  default variable length decoding methods for retrieving bytes
  from the stream instead of managing current_ by hand.

* Creates a canonical empty CompressedStackMaps instance and uses
  that instead of the null CompressedStackMaps instance in most cases.
  The only remaining (expected) use of the null CompressedStackMaps
  instance is for the global table in the object store when no global
  table exists (e.g., in JIT mode before any snapshotting).

* Moves CompressedStackMapsIterator from code_descriptors.h to an
  Iterator class within CompressedStackMaps in object.h (similar to
  PcDescriptors::Iterator), to limit friend declarations and because it
  conceptually makes more sense as part of CompressedStackMaps.

* Removed CompressedStackMaps::PayloadByte, since existing clients
  (CompressedStackMaps::Iterator, StackMapEntry in program_visitor.cc)
  are better served by just operating on the payload buffer directly
  (with appropriate NoSafepointScopes).

* WriteStreams no longer allocate their initial space on construction,
  but rather on the first write, so no allocation is performed by
  constructing a never-used WriteStream.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-mac-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-precomp-win-release-x64-try,vm-kernel-ubsan-linux-release-x64-try,vm-kernel-tsan-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-msan-linux-release-x64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-msan-linux-release-x64-try,vm-kernel-asan-linux-release-x64-try
Change-Id: Ice63321abaa79157fbe9f230a864c8bba0e6dea9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/166421
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-10-09 10:08:16 +00:00
Vyacheslav Egorov 4d182203ca [vm] Include static call references into V8 profile
Code objects might be connected by static calls and these references
were not included into the profile. This lead to some objects being
unreachable from the root.

This CL also adds a test which computes dominators for all nodes
in the snapshot (this in turn verifies that there are no
unreachable nodes).

Cq-Include-Trybots: luci.dart.try:pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try
Change-Id: I2af4107fdb7f875624192e892ce1cec78cbf0dd0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161709
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-09-08 12:11:34 +00:00
Daco Harkes 44fdd8f69d [vm/ffi] fix callbacks in --no-use-bare-instructions
Closes: https://github.com/dart-lang/sdk/issues/43035

Change-Id: I3a4e972f00ef7c7436d8ce5176bdc43c7636c25d
Cq-Include-Trybots:dart/try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158399
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-08-14 12:49:37 +00:00
Ryan Macnak d8950da048 [vm] Fix --no-retain-function-objects when there are calls through Code.
With --no-use-bare-instructions or with splitting, not all calls are pc-relative. We must replace the Function with its Code in the static call table before detaching the Function's code as part of removing Function objects.

Also handle WeakSerializationReferences in AssignLoadingUnitsCodeVisitor.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: I29f9258c240f5a2b1b8dca52f74146dfe44d6401
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158165
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-08-13 17:01:24 +00:00
Ryan Macnak 91ed534139 [vm] Support --use_bare_instructions when splitting snapshots.
- Don't use PC-relative calls when calling between loading units.
 - Sort the contents of the code cluster by loading unit, then by text offset.
 - Handle binding PC-relatives calls and inserting trampolines per loading unit.
 - Create one code order table per loading unit to implement PC -> Code lookup.
 - Read code order tables directly, instead of copying into malloc'd memory.

--use_table_dispatch still not yet supported.

This slightly shrinks non-split binaries (~2% clustered part, 0.4% total snapshot) due to the new delta encoding when Code references Instructions.

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: I51052ebc7b4968b554897d1710135a6c41821302
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157820
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
2020-08-12 17:23:14 +00:00
Ryan Macnak c5a94db091 [vm] Initial implementation of deferred loading.
(Assignment of libraries to loading units is already done in the kernel generation step.)

After compiling and before serializing, we walk the program and for each Code we assign its Instructions, CodeSourceMap and CompressedStackMap to the loading unit of that Code's defining library. Deduplication may cause Instructions, CodeSourceMaps and CompressedStackMaps to belong to more than one loading unit; in this case the objects are assigned to the root loading unit. Later they can be more precisely assigned to the dominating loading unit.

All objects except some Instructions, CodeSourceMaps and CompressedStackMaps belong to the root loading unit's snapshot. This snapshot is written like an unsplit snapshot, except that when serializing Code, we will write a reference to a stub or null when the Code's Instructions, CodeSourceMap or CompressedStackMap belongs to a non-root loading unit. The snapshots of non-root loading units contain these deferred objects and references to the corresponding Code objects to patch. The types of objects we defer (Instructions, CodeSourceMaps and CompressedStackMaps) usually represent 70+% of the snapshot size.

Bare instructions mode must be disabled when splitting because we cannot have PC-relative calls between loading units. Later we can re-enable this for calls within loading units.

Broken: Compactor probably crashes we can now have an unbounded number of image pages and the compactor assumes a fixed number.

Embedder's guide:

At compile-time, gen_snapshot should be passed --loading_unit_manifest with a path, which will enable splitting and output a mapping from loading unit ids to snapshot output paths.

At runtime, sometime during isolate startup, an embedder should call Dart_SetDeferredLoadHandler, probably near an existing call to Dart_SetLibraryTagHandler. The callback is given a loading unit id, and should eventually call Dart_DeferredLoadComplete[Error].

Bug: https://github.com/dart-lang/sdk/issues/41974
Change-Id: Ib597eb87c8cd634416d5ee1f00629c5550aebb00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152427
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-07-17 19:29:47 +00:00
Vyacheslav Egorov 69ec1a9965 [vm/aot] Add machine readable precompiler trace
This CL adds --trace-precompiler-to option which generates a machine readable
precompiler trace (list of all compiled functions and their dependencies).

It also expands package:vm_snapshot_analysis with tools for reading and
analysing this trace.

For example snapshot_analysis explain dynamic-calls command allows
to list all dynamic calls sorted by their impact on the size of the AOT
snapshot.

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

Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-try,pkg-win-release-try,pkg-mac-release-try
Change-Id: Ie49143f4da375067991991e2ad20a41ec67bb1c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152851
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-07-03 09:29:10 +00:00
Martin Kustermann fdeb01897f [vm] Ensure a switchable callsite never looses knowledge of it being dyn:* during transitions
Issue https://github.com/dart-lang/sdk/issues/42517

Change-Id: I6fb414740b59f7f710fba10c27c126997a4346b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152847
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-07-01 19:53:34 +00:00
Ryan Macnak 6b91f92154 [vm] Move megamorphic miss handling into the megamorphic call stub.
This removes the only stub code with a function owner.

Change-Id: I629eb3a1b231430afaf0a2777032bba8eaddd2aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148124
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-05-15 20:28:21 +00:00
Ryan Macnak 6fe15f6df9 [vm] Represent tagged pointers as C++ value types instead of C++ pointer types.
This works around bugs in UndefinedBehaviorSanitizer and Clang.

Bug: b/28638298
Change-Id: I6be595f9664516019d28017d24559583a1ae3a21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144354
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-04-25 05:21:27 +00:00
Tess Strickland a69cb6d700 [vm] Walk Functions as well as Code objects in DedupInstructions.
Previously, we used the owner field to find the function whose entry
points to fix up after deduplicating instructions/code objects. However,
this means retrieving and checking the owning Function for each Code
object that has one, even if that Code object isn't the current code
object for the owning function. Instead, now we extend the instruction
deduplication visitors to Functions, where visiting a Function means
visiting its active Code object before fixing up the entry point cache.

Since the ProgramWalker also visits Code objects, this means visiting
some Code objects twice (once in the ProgramWalker and once when
visiting the Function for which it is the current code). However, since
the deduplication process is idempotent, the additional visits will not
cause the entry points for the Code object to change further (which
would otherwise invalidate the caches of already visited Functions).
Thus, the order of the visits does not affect the results.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try
Change-Id: Idd12fc94c5fb98f1fc9eb669d09b47822b0eac1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144700
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-04-24 11:49:43 +00:00
Tess Strickland 7db07dadd6 [vm] Only visit Code objects in the static call tables when necessary.
In most cases, Code objects in the static calls tables are reachable
through other means. Thus, only add the overhead of walking the static
calls tables when we are in precompiled mode and
--retain-function-objects is disabled.

Also, when deduplicating Instructions objects in Code objects, only
adjust the entry points for the owning function if the Code object is
the current code for that function.

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

Bug: 41619
Change-Id: I51621ccfe1d1c8402088a1c24c56e0a74a02e1ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144560
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-23 15:10:49 +00:00
Alexander Markov 69791c50f8 [vm/nnbd] Use InitInstanceField instruction for late instance fields
Fixes https://github.com/dart-lang/sdk/issues/41299
Issue https://github.com/dart-lang/sdk/issues/41417

Change-Id: I1219ddaffcf3a2b17226305eeea8455c73f4ca78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143189
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-04-20 23:30:14 +00:00
Martin Kustermann bc59a40918 [vm/compiler] Use PC-relative calls in AssertAssignable when calling TTS
Additionally the TTS itself will also use pc-relative tail-call to the
slow path.

This reduces AssertAssignable by 1 instruction and generated
type testing stubs by 2 instructions.

Flutter gallery total size:

  armv8: -0.3%
  armv7: -0.27%

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

Change-Id: Ib29ff9afd1df4034c8fa47f66c80c22e226c0979
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142988
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
2020-04-18 20:27:38 +00:00
Teagan Strickland 17f62d3f3a [vm/aot] Drop more Function objects not needed at runtime when possible.
Before, use of a function in the static calls table of a Code object
would cause it to be retained. Now, like dispatch table use, we only
retain such functions if there are other uses like dynamic function
lookup that needs the function object or if the
--retain-function-objects flag is enabled.

In most modes, --retain-function-objects is enabled by default.
It is only disabled by default in product mode when
--dwarf-stack-traces is enabled, since otherwise the removed
function objects may be needed for debugging platforms like the
Observatory or when creating symbolic stack traces.

Changes on flutter gallery in release mode:

Default:
  arm7: isolate: +6.65%, total: +1.30%
  arm8: isolate: +6.67%, total: +1.28%

(The increase is due to changing back to all function objects
being retained as the default when using symbolic stack traces.)

With --no-retain-function-objects:
  arm7: isolate:  -9.95%, total: -1.73%
  arm8: isolate: -10.04%, total: -1.77%

(This measures how much dropping static call function objects
when possible affects the size compared to just dropping
function objects for dispatch table entries when possible.)

Bug: https://github.com/dart-lang/sdk/issues/41052
Change-Id: I3c834b14b0c58ccfdbaca3f154df536df29c13ef
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142146
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-16 14:26:04 +00:00
Martin Kustermann c522e79a0b [vm/compiler] Use PC-relative (tail)call for calling various stubs
This CL introduces a mechanism to allow a stub to use a pc-relative
tail-call to another stub by populating the code's static_calls table.

We use this in allocation stubs which can tail-call the generic object
allocation stub.

Flutter gallery total size:

  - armv7: -0.72%
  - armv8: -0.88%

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

Change-Id: I6afafe2a357b7833da843403f90281aee363a95b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142987
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-04-16 04:55:00 +00:00
Martin Kustermann af4bd2719e [vm/compiler] Add support for PC-relative tail calls and use it in TailCallInstr
Flutter gallery total size:
  - armv7: -0.15%
  - armv8: -0.33%

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

Change-Id: I99959de45f43ca0c892cea6382ee7252e9c4f764
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142841
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-04-15 14:10:53 +00:00
Teagan Strickland 5a965d5d0f [vm] Refactor program visitors to avoid duplicating traversals.
Instead of each Visitor being a distinct type, now FunctionVisitors
are subclasses of ClassVisitors (since we visit each class to visit
its methods) and CodeVisitors a subclass of FunctionVisitors (since
we visit each function to visit its code). Thus, we replace the
different ProgramVisitor::Visit<type> methods with a single
ProgramVisitor::WalkProgram method that walks the program, looking
for applicable objects.

Change-Id: If93638ec2eccebb8b726fad9b8ea46f94f8c099b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-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-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141604
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
2020-04-02 08:39:24 +00:00
Teagan Strickland e6e66026d2 [vm] Check the global object pool (if any) when visiting functions.
FFI trampolines are stored in the global object pool and not
reachable either via class or via the closure functions in the
object store.

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

Bug: https://github.com/dart-lang/sdk/issues/41052
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-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-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I3e1551dba80a2fd418946d7449467317463c2c61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141882
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-03-31 13:04:29 +00:00
Teagan Strickland b55342cb3e [vm/aot] Drop some Function objects not needed at runtime.
In particular, don't serialize a function if its code is used by the
dispatch table, but there's no need for the function object itself
at runtime like dynamic lookup or dynamic invocation forwarders.

However, just because the owning function is not needed at runtime,
it may be used during serialization for things like assembly label
creation. Thus, instead of just clearing out the Code's owner field,
we add a new WeakSerializationReference (WSR) object whose target is
the original contents of the owner field. The WSR allows the
serializer to access the original owner, but also signals to the
serializer that the target should not be serialized in AOT snapshots
unless there are additional strong (non-WSR) references.

If no strong references are found, then the references to the WSR
in the snapshot are replaced with a reference to a WSR that only
contains the class ID of the original target. The serializer creates
only one WSR per class ID.

If strong references are found, then the target is still serialized.
In this case, the WSR is dropped entirely and any reference to it is
replaced with a direct reference to the serialized target. Thus, WSRs
only exist in the precompiled runtime for targets with no strong
references.

Changes on the Flutter gallery in release mode:
arm7: total size -1.10%, isolate size -6.08%
arm8: total size -1.16%, isolate size -6.09%

Bug: https://github.com/dart-lang/sdk/issues/41052

Change-Id: I5b435ca71ef85f50fe3484789087471a91aa4fe2
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-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-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137104
Commit-Queue: Tess Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-03-30 18:33:48 +00:00
Liam Appelbe 9e03c2c506 [vm] Add required flag to parameters, and implement subtyping rules.
This CL only covers AST mode, and doesn't address function resolution.

Bug: https://github.com/dart-lang/sdk/issues/39755
Change-Id: I19280fb0d373aa9eb17da13677fd5bb1230385da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131701
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-02-26 00:38:54 +00:00
Ryan Macnak d9226ff693 [build] Fix warnings in newer versions of Clang.
Change-Id: I94767c7e1d262ce7a2f2aaced4cf9fa9abe09425
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136705
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-02-20 20:29:25 +00:00
Ryan Macnak d71b1e5b04 [vm] Remove 'dynamic' from 'dart:core'; add missing accessors to the embedding API for dynamic, void and Never.
Fix crash when create type errors involving Never.

Bug: https://github.com/dart-lang/sdk/issues/12478
Bug: https://github.com/dart-lang/sdk/issues/40176
Change-Id: I8cff7042850717d02da36ad935cf0a49ace80c3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134886
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-02-07 23:47:50 +00:00
Teagan Strickland d854375bc0 [vm] Make dedup-instructions a global VM flag.
Also check the flag in all code that possibly deduplicate instructions
or needs to know whether instructions may have been deduplicated, so we
can test this code in non-product builds by turning on the flag.

Change-Id: Iefd1aa13a0f5a8a1cd51b547d554c9ae8e7410ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134820
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-07 15:15:32 +00:00
Jens Johansen 8d11c1dce6 [kernel][vm] Add uris only from mixins to libraries sourceReferences
index to fix VMs coverage issue

This CL fixes the VM not always reporting coverage for mixin usages
properly.

* When asking the VM for coverage you can do it in one of two ways
  * Ask the VM for coverage for everything; or
  * Ask the VM for coverage for a specific script
* Asking the VM for coverage for everything works perfectly fine.
  The VM goes through everything and reports coverage correctly.
* Asking the VM for coverage for a specific script (which is, at least
  now, what the flutter tools does) doesn't work in the simple mixin
  case described at http://dartbug.com/39779: The VM goes through the
  libraries, asking for the list of scripts they "know about",
  and checks for matches against what you asked for.
  In this case, when asking for 'master.dart', the library for
  'lib.dart' says no when it shouldn't --- because of the way the mixin
  transformation works the content is actually in lib.dart.

This CL updates the content of the field 'sourceReferences' on Library
to fix the issue.


Fixes #39779

Change-Id: I0c38a323c81d1784ade704837b67ece549fc95d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128585
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-12-19 06:59:28 +00:00
Teagan Strickland f6d433dc5e [vm] Remove the unchecked entry point offset field from RawInstructions.
There's just one case where we can't get the offset for Instructions
from somewhere else, and that's when we reset active_instructions_ to
instructions_ in Code::Enable(). Thus, we add a caching field for the
uncached offset to RawCode, but only when the active_instructions_
field is added (when not running in the precompiled runtime).

We also output the unchecked offset in snapshots for Code objects so
we can recalculate the entry point cache on loading. (For full JIT
snapshots, we output both the cached offset and the offset for
active_instructions_.)

Bug: https://github.com/dart-lang/sdk/issues/38451
Change-Id: I78572ec83d1574b00820df148bccb57e5c79eaaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125400
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-12-11 10:00:29 +00:00
Teagan Strickland dc808f3fcb [vm/compiler] Canonicalize CompressedStackMaps payloads when possible.
When we are writing a snapshot, canonicalize all entries within
CompressedStackMaps payloads. We do this by creating a global table
of stack map information (bit counts + bit payload) that we store
in the isolate object store, and then for each existing CSM, we
replace it with an alternate version that refers to the global table.
This gets back some of the canonicalization we lost when we moved from
individual StackMap objects to per-Code CompressedStackMaps objects.

Here, we also represent the global table as a CompressedStackMaps
object. This means that there are three types of CompressedStackMaps:
 * The original version that directly contains all entry information.
 * The version where each entry is just the PC offset delta and an
   offset into the global table payload.
 * A version representing the global table where the entries are like
   the original version except they don't contain a PC offset delta.

-----

The impact on AOT snapshot size when compiling the Flutter Gallery
in release mode:

   armv7: Total size -0.88% (Isolate RO: -5.05%, Isolate snapshot: +0.00%)
   armv8: Total size -1.04% (Isolate RO: -5.28%, Isolate snapshot: +0.00%)

-----

Bug: https://github.com/dart-lang/sdk/issues/35274
Change-Id: I1ce0f8b3cc58e2f11584f3c218e0fdf8984b799b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120667
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-14 12:49:06 +00:00
Samir Jindel c885bdde1d [vm] DBC is obsolete. Remove dead code.
Change-Id: Ica33af158cca53c8e951e4b2582de83660e8a60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121851
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-27 18:18:29 +00:00
Martin Kustermann e2faac751e [vm/aot] Fully enable deduplication of instructions in bare mode
Currently the switchable calls require there to be a unique PC -> Code
-> Function mapping to re-construct the arguments descriptor which was
lost when transitioning from unlinked to monormophic.
=> This prevents instruction deuplication in bare mode for those
   functions, because the PC -> Function mapping is amgiguous (the
   frames don't have a Code object on the stack we can use)

This CL preserves the (name, args-descriptor) per switchable call site when we
go from unlinked to monomorphic state by remembering it in a map. When
transitioning out of monomorphic we can use this map to re-construct the
name and arguments descriptor (and delete the map entry).

Flutter gallery release size impact:

  * arm64: total -2.33 % (-3.62% RX)
  * arm:   total -1.72 % (-2.65% RX)

From local testing it seems like running flutter gallery in profile mode
and connecting via observatory the memory consumed by UnlinkedCall
instances seems minimal.

Change-Id: I55902e6f11c9941493c610ed18f26bc5fc3dcf59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121421
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-22 11:13:14 +00:00
Teagan Strickland c9f6e669f9 [vm/compiler] Reland "Further compress the information... in StackMaps."
Fixes an assumption that CompressedStackMapsIterator::Find() is never
passed a PC offset of 0. Adds back an ASSERT that was dropped which checks
for specific cases where a given PC offset does not have a stack map entry.

Original commit message:

Lifting the PC offset in a2bb730 was a small, lightweight change that
gave us big gains, at least on 32-bit architectures. Here, we make
much more invasive changes that will improve the amount of memory used
by the information previously stored in StackMap objects.

Instead of allocating separate objects for StackMaps, we instead compress
all StackMap information for a given Code object into a single object
(CompressedStackMaps, or CSM for short). This replaces the Array used to
store PC offsets (as Smis) and the individual StackMap objects.

While we lose all canonicalization for individual StackMap entries, the
drop in space required to store stack map information more than offsets that.

-----

The impact on AOT snapshot size when compiling the Flutter Gallery
in release mode:

   armv7: Total size -2.58% (Isolate RO: +14.46%, Isolate snapshot: -22.93%)
   armv8: Total size -1.85% (Isolate RO: +15.69%, Isolate snapshot: -22.97%)

The impact on in-memory, not on-disk, size for the Flutter Gallery as seen
in the Observatory while running a profile (not release) build:

   armv7: Drops from 7.1 MB to 6.2MB (-0.9 MB)
   armv8: Drops from 13.5MB to 11.7MB (-1.8 MB)

-----

Bug: https://github.com/dart-lang/sdk/issues/35274, https://github.com/dart-lang/sdk/issues/38873
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try,vm-kernel-mac-debug-simdbc64-try
Change-Id: I111b129b0ed64f03184370bceb7cda69d5d4b3c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121700
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-16 08:25:53 +00:00
Alexander Markov 017a7a6221 Revert "[vm/compiler] Further compress the information previously in StackMaps."
This reverts commit d77f4913a1.

Reason for revert: large number of flaky crashes on flakiness dashboard (https://github.com/dart-lang/sdk/issues/38873); crashes on vm-kernel-mac-debug-simdbc64 bot.

Original change's description:
> [vm/compiler] Further compress the information previously in StackMaps.
> 
> Lifting the PC offset in a2bb730 was a small, lightweight change that
> gave us big gains, at least on 32-bit architectures. Here, we make
> much more invasive changes that will improve the amount of memory used
> by the information previously stored in StackMap objects.
> 
> Instead of allocating separate objects for StackMaps, we instead compress
> all StackMap information for a given Code object into a single object
> (CompressedStackMaps, or CSM for short). This replaces the Array used to
> store PC offsets (as Smis) and the individual StackMap objects.
> 
> While we lose all canonicalization for individual StackMap entries, the
> drop in space required to store stack map information more than offsets that.
> 
> -----
> 
> The impact on AOT snapshot size when compiling the Flutter Gallery
> in release mode:
> 
>    armv7: Total size -2.58% (Isolate RO: +14.46%, Isolate snapshot: -22.93%)
>    armv8: Total size -1.85% (Isolate RO: +15.69%, Isolate snapshot: -22.97%)
> 
> The impact on in-memory, not on-disk, size for the Flutter Gallery as seen
> in the Observatory while running a profile (not release) build:
> 
>    armv7: Drops from 7.1 MB to 6.2MB (-0.9 MB)
>    armv8: Drops from 13.5MB to 11.7MB (-1.8 MB)
> 
> -----
> 
> Bug: https://github.com/dart-lang/sdk/issues/35274
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try
> Change-Id: Ie3bb898d557215146260a560423f5fa27bdff512
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119640
> Commit-Queue: Teagan Strickland <sstrickl@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=kustermann@google.com,rmacnak@google.com,sstrickl@google.com

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

Bug: https://github.com/dart-lang/sdk/issues/35274
Change-Id: Ib844b4d52e3aa4aca62a896cfe349c680bda7461
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121642
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-14 20:20:58 +00:00
Teagan Strickland d77f4913a1 [vm/compiler] Further compress the information previously in StackMaps.
Lifting the PC offset in a2bb730 was a small, lightweight change that
gave us big gains, at least on 32-bit architectures. Here, we make
much more invasive changes that will improve the amount of memory used
by the information previously stored in StackMap objects.

Instead of allocating separate objects for StackMaps, we instead compress
all StackMap information for a given Code object into a single object
(CompressedStackMaps, or CSM for short). This replaces the Array used to
store PC offsets (as Smis) and the individual StackMap objects.

While we lose all canonicalization for individual StackMap entries, the
drop in space required to store stack map information more than offsets that.

-----

The impact on AOT snapshot size when compiling the Flutter Gallery
in release mode:

   armv7: Total size -2.58% (Isolate RO: +14.46%, Isolate snapshot: -22.93%)
   armv8: Total size -1.85% (Isolate RO: +15.69%, Isolate snapshot: -22.97%)

The impact on in-memory, not on-disk, size for the Flutter Gallery as seen
in the Observatory while running a profile (not release) build:

   armv7: Drops from 7.1 MB to 6.2MB (-0.9 MB)
   armv8: Drops from 13.5MB to 11.7MB (-1.8 MB)

-----

Bug: https://github.com/dart-lang/sdk/issues/35274
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try
Change-Id: Ie3bb898d557215146260a560423f5fa27bdff512
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119640
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-10-11 11:28:57 +00:00
Martin Kustermann 55d1c95e08 [vm] Fix instruction deduplication for bare-AOT mode
Though we disable deduplication for instance methods because switchable
calls rely on a unique PC -> Code mapping atm.

Change-Id: I80915e97f5e06c3f1251ea3176d5c4f8413a81ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120041
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-09 19:45:42 +00:00
Martin Kustermann 7376167b2a Revert "[vm/compiler] Fix Code equality comparison in DedupInstructions."
This reverts commit 4cd5d773de.

Reason for revert: Broke flutter benchmarks (e.g. animation, build benchmark).

Original change's description:
> [vm/compiler] Fix Code equality comparison in DedupInstructions.
> 
> Change-Id: Ide07e8dd174cec407b2f19346330985b612f098e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119844
> Auto-Submit: Teagan Strickland <sstrickl@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Teagan Strickland <sstrickl@google.com>

TBR=kustermann@google.com,sstrickl@google.com

Change-Id: I5ab180ddd40fecf769d544184dfffeb034bc2eeb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119941
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-03 19:43:15 +00:00
Teagan Strickland 4cd5d773de [vm/compiler] Fix Code equality comparison in DedupInstructions.
Change-Id: Ide07e8dd174cec407b2f19346330985b612f098e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119844
Auto-Submit: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-10-03 16:49:13 +00:00
Teagan Strickland a2bb7301c5 [vm/compiler] Lift PC offsets out of StackMaps.
Instead of storing the PC offset inside the StackMap object, store it instead
in the `Array` containing `StackMap`s in `Code` objects. That is, the `Array`
provided by `Code::stackmaps()` no longer contains just `StackMap` objects, but
instead contains `Smi`s and `StackMap` objects in alternating fashion.  Each
`Smi` is the PC offset for the `StackMap` object that follows.

This ends up changing very little code outside of `StackMap`,
`Code::GetStackMap`, and `StackMapTableBuilder`, as there are only two types of
`StackMap` users:

* Users that call `Code::GetStackMap` already have the PC offset.
* Users that call Code::stackmaps() can just fetch the PC offset from the
  returned `Array` instead.

On 64-bit architectures, we will use more space to represent the PC offset
as a Smi in the Array than the old uint32_t field. However, the drop in total
number of StackMap objects due to an increased ability to canonicalize
them should offset this. On 32-bit architectures, we can only represent
30 bit PC offsets, not 32 bit PC offsets, but that shouldn't be a problem
in practice except for pathological cases.

_Numbers from building the Flutter gallery in android_release mode_

Since PC offsets are no longer in the `StackMap` objects, this enables
a lot more canonicalization than before. Previously, we generated
49379 `StackMap`s, but now we only generate 16139 `StackMap`s, just under
a third of the original number. This is because there were a lot of
`StackMap`s that differed only in their PC offset, and now they can
be canonicalized into the same `StackMap` object.

When building the Flutter gallery with android_release, the app.so size
drops from 11276896 bytes to 10908256 bytes, a difference of 368640
bytes, or 3.27%.

Using the AOT snapshot profiling support, we see the following drops:

Heap snapshot size drops from 10.7 MB to 10.4 MB.

`Code`              | Before  | After   | Difference
---------------------------------------------------------
Shallow size        | 352363  | 352363  | 0
Retained size       | 9114801 | 8796064 | -318737
Percent of snapshot | 81.2%   | 80.7%   | -0.5%

`(RO)StackMap`      | Before  | After   | Difference
---------------------------------------------------------
Shallow size        | 49381   | 16141   | -33240
Retained size       | 893965  | 286613  | -607352
Percent of snapshot | 7.97%   | 2.63%   | -5.34%

`StackMap`          | Before  | After   | Difference
---------------------------------------------------------
Shallow size        | 844584  | 270472  | -574112
Retained size       | 844584  | 270472  | -574112
Percent of snapshot | 7.53%   | 2.48%   | -5.05%

As we'd expect from the `StackMap` numbers above, we end up using a little
under a third of the space for `StackMap`s. We actually use even less space
(32.0% of the original) than the drop in `StackMap` numbers (32.7%), because
each `RawStackMap` instance is 32 bits smaller due to dropping the `pc_offset_`
field. Note that even though these PC offsets now show up in the
`Code::stackmaps()` `Array`, we can see this is still a net drop in space used
by looking at the retained size of `Code` objects.

Bug: https://github.com/dart-lang/sdk/issues/35274
Change-Id: I0910a43e7a5a7e2e721676209196be1884c5a71c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119147
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-10-01 09:12:22 +00:00
Régis Crelier 4403c58640 [vm] Delete obsolete await_token_positions_ from Code object and flow graph.
Change-Id: I80fff049c8d0b45ec7276b1d0ae71f492ad97b9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106564
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-06-19 23:38:02 +00:00
Matthew Dempsky 4ce3aa7af1 [vm] Replace ^= assignments with = where possible
Change-Id: I04ac2e9c4b8bb654b7c660e728be3867aa4e1513
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100923
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
2019-05-01 00:04:44 +00:00
Jens Johansen 1555594ddb Include a per-library index of owned sources in kernel
This for instance allows the VM to include all patches
(e.g. the previously missing `runtime/lib/date_patch.dart`)
in what's returned from `LoadedScripts()`.

Over time this also allows for `LoadedScripts()` to be simplified and
become faster (it's currently something like O(m + m*n) where m is the
number of results in DictionaryIterator(*this) and n is the number of
returned scripts).

Change-Id: I4b5a6a0fe666b774fc0987d099ed02e81ac97b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-11 12:40:49 +00:00
Alexander Aprelev 59b8a9c4bb [vm] Free readonly header bit so it can be used for other uses.
This is reland of https://dart-review.googlesource.com/c/sdk/+/97340 rebased on top of removal of GraphMarked bit, which was not compatible with this ReadOnly->InVMIsolateHeap change(due to how write-pages are not covered by Contains check)

Change-Id: I34c6421afb4baeafa5a449787020dab9fa800d05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97545
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-03-22 23:46:51 +00:00