Commit Graph

16 Commits

Author SHA1 Message Date
Vyacheslav Egorov 229d793602 [vm/compiler] Support materializing unboxed variables when entering catch.
Previously we tried to rely on the assumption that all variables would be
boxed - so the machinery for setting correct catch-entry state only
supported tagged values and constants. However this both leads to worse code
and is not entirely correct assumption.

This also:

- renames various confusingly named classes: we move away from talking
about "catch entry state" to "catch entry moves" - because we only
record a subset of moves that needs to be performed and that does
not describe the whole state;
- refactors a bunch of associated code to be more readable and maintainable;
- adds documentation about catch implementation in optimized code
to runtime/docs/compiler;

Fixes https://github.com/flutter/flutter/issues/21685.

Change-Id: I03ae361a1bb7710acbd9f661ae014e663a163c59
Reviewed-on: https://dart-review.googlesource.com/74860
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-14 17:39:12 +00:00
Ryan Macnak dd3ec65af8 [vm] Hash canonical objects by content instead of address.
Bug: https://github.com/dart-lang/sdk/issues/31427
Change-Id: Iad02b152887576f8fbdcbed6892464a0c2ffa09c
Reviewed-on: https://dart-review.googlesource.com/54662
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-05-14 20:11:27 +00:00
Alexander Markov 97bbe2f20b [vm] Avoid using objects in VM isolate heap for de-duplication
Parameter types in application isolate could be modified during
execution, so it is incorrect to de-duplicate them with
read-only objects from VM isolate.

Fixes crash in pkg/front_end/tool/incremental_perf.dart
benchmark running from appjit snapshot. This crash appears after
https://dart-review.googlesource.com/c/sdk/+/45747 is applied.

Change-Id: I42a2007d02e04e0720c7e5d15224fcb6994bc515
Reviewed-on: https://dart-review.googlesource.com/45752
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-03-09 01:53:17 +00:00
Ryan Macnak 65990d5d7e Don't use heap iteration order when seeding the VM isolate.
Bug: https://github.com/dart-lang/sdk/issues/31427
Change-Id: I74c5c9f6e992bf68913178a49916892c0ef808c9
Reviewed-on: https://dart-review.googlesource.com/26440
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-06 22:24:25 +00:00
Ryan Macnak 344a9d546b [vm] Deduplicate catch entry state maps.
Flutter gallery ARM32:
TypedData          74349 ->    22701 (-69.5%)
Total snapshot  10741228 -> 10689108 (-0.49%)

Bug: https://github.com/dart-lang/sdk/issues/31302
Change-Id: I759147e4a9cd532eb338d96558a423e675358790
Reviewed-on: https://dart-review.googlesource.com/20562
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-14 23:06:05 +00:00
Ryan Macnak a2695ad29b When deduplicating program metadata, try to use objects from the VM isolate.
Expands the mechanism that moves token streams to the VM isolate to include instructions and code metadata.

Allow the isolate snapshot to reference Instructions in the VM isolate.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2909403002 .
2017-09-01 13:26:29 -07:00
Ryan Macnak f8e47a9e26 Reapply "[vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, or later through Observatory."
Ensure we still start NativeSymbolResolver even if the profiler is off, since it is also used name weak handler finalizer functions and to produce stack traces for crashes.

R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/2992893002 .
2017-08-09 11:20:58 -07:00
Dmitry Stefantsov eddc456f29 Revert "[vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, or later through Observatory."
This reverts commit cc08f2ddd8.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2990173002 .
2017-08-02 11:30:16 +02:00
Ryan Macnak cc08f2ddd8 [vm] Don't enable the profiler by default. Enable the profiler at startup with --observe, or later through Observatory.
Note there is no option to disable the profiler. The profiler on Mac, Linux, and Android is based on SIGPROF, and there is no way to wait for all the outstanding signals as required to be able to safely free the sample buffer.

Saves ~20MB on 64-bit VMs.

R=cbernaschina@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2989093002 .
2017-08-01 17:57:08 -07:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Aske Simon Christensen ab7d9a5720 Omit JIT compiler from precompiled runtime on ARM, ARM64 and IA32.
Saves about a megabyte on the size of the precompiled runtime VM.

Next step will be to eliminate the assemblers and code stubs as well. This requires some more disentangling.

Until then, the X64 build still includes the compiler, since its assembler has a dependency on locations.cc, which is part of the compiler.

BUG= https://github.com/dart-lang/sdk/issues/30045
R=rmacnak@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2960413002 .
2017-07-11 12:01:49 +02:00
Ryan Macnak 39040a8a15 Never erase parameter types in the JIT.
Even in unchecked mode with mirrors disabled, we need to be able to forward parameter types to lazily generated implicit closure functions.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2808763008 .
2017-04-12 15:40:42 -07:00
Ryan Macnak 5cffc591aa Refactor AOT deduplication steps so they can run before an app-jit snapshot as well.
Additionally dedup PcDescriptors, deopt entries, deopt lists, and await token position lists.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2815533003 .
2017-04-12 14:23:49 -07:00
Ryan Macnak 4607e38d28 Reapply "Save and restore feedback from JIT."
Ensure ICData is attached to the callee flow graph in the inliner when built from kernel IR, not just from source.

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2572423004 .
2016-12-16 16:00:17 -08:00
Ryan Macnak 176d732cc3 Revert "Save and restore feedback from JIT."
This reverts commit 31ee20297e.

Review-Url: https://codereview.chromium.org/2579413002 .
2016-12-16 13:53:20 -08:00
Ryan Macnak 31ee20297e Save and restore feedback from JIT.
- Adjust fingerprints to be independent of the library's private key, which varies with load order.
 - Use usage_counter in AOT inlining decisions if JIT feedback is available.
 - Reduce inlining in cold functions.

dart2js product aot snapshot 15841351 -> 14436273 (-8.86%)

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2562693003 .
2016-12-16 10:21:40 -08:00