This shifts the bump allocation scope up to the Dart_ API
implementation so that an IsolateReloadContext won't try
to enter one. It also disables reload during the scope.
Change-Id: I3ca52f35c3a43f58e447e88b4fa91a84d3eacdd9
Reviewed-on: https://dart-review.googlesource.com/77522
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
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>
Large allocations and direct old space allocations are not signals that the current new space objects will be long lived.
Still perform a scavenge to handle (dead new -> dead old) references even when new space allocation is low, but a non-evacuating scavenge.
Change-Id: I4008fb163c4536abfc7ba42410ec57917a69786a
Reviewed-on: https://dart-review.googlesource.com/72340
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
UsedBefore was often bogus because it was saved before coordinating Thread and Scavenger's bump pointers. It remains incorrect for --verbose-gc. Fixing that requires fairly disruptive changes to the placement of safepoint operation scopes to allow safe access to the bump pointers in Heap::RecordBeforeGC.
Change-Id: Ia7abfe0c89c4c6d92ca6c086b2a093e793c71c87
Reviewed-on: https://dart-review.googlesource.com/72071
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
The initial growth limit is a constant value (based on --old_gen_growth_rate, 35MB). When reading a snapshot that produces a heap larger than this limit (e.g., dart2js), the first old space GC will happen soon after and fail to free much memory because objects from the snapshot have a very high survivorship rate. When reading a snapshot that produces a heap much smaller than this limit (e.g., AOT Flutter), it takes a long time to hit the first old space GC.
Also fix more missing safepoint transitions exposed by the change in GC timing.
Change-Id: I19c36e49cd8b886bd8c4652e6cfcdfb01a0d33fd
Reviewed-on: https://dart-review.googlesource.com/71621
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This reverts commit 2891a57322.
Reason for revert: greatly increases memory usage in language_2/closure_cycles_test
Original change's description:
> [vm, gc] Don't eagerly evacuate new space on old allocation failure.
>
> Large allocations and direct old space allocations are not signals that the current new space objects will be long lived.
>
> Change-Id: Id271623b84795eafa81f1b08f9511b53fb354276
> Reviewed-on: https://dart-review.googlesource.com/70541
> Reviewed-by: Zach Anderson <zra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
TBR=rmacnak@google.com,zra@google.com,asiva@google.com
Change-Id: If65600a0846d5c6f746b765bf24148880376e365
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/72080
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Large allocations and direct old space allocations are not signals that the current new space objects will be long lived.
Change-Id: Id271623b84795eafa81f1b08f9511b53fb354276
Reviewed-on: https://dart-review.googlesource.com/70541
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Mostly tests; 1 non-test bug in propagating an error through Dart_SetReturnValue.
This is progress towards asserting thread->excution_state() == kThreadInVM in Object::Allocate.
Change-Id: I6a59549868ab317b3c0d32aa42f3661289cbf456
Reviewed-on: https://dart-review.googlesource.com/71720
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Test Plan:
Will be tested by following revisions which introduce optimizations that invoke the
new entrypoint.
Change-Id: I56d714bceb92c44a13c46d52457154b82577aa8c
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try,vm-kernel-optcounter-threshold-linux-release-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/67345
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Instead, only filter dead objects from the remembered set at the end of marking.
Allows scavenges to occur during concurrent marking, and avoids changing the mutator to handle a race with the concurrent marker for the remembered bit.
Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: I116d7acc8fb57b8c3088febe6c196030a40fb319
Reviewed-on: https://dart-review.googlesource.com/67841
Reviewed-by: Siva Annamalai <asiva@google.com>