Commit Graph

303 Commits

Author SHA1 Message Date
asiva e6696267b2 [VM/GC] Fix field initialization bug.
Missed field initialization in previous commit.

Change-Id: Ia77aaeca4aff52e59204a5272404dbb24c28742a
Reviewed-on: https://dart-review.googlesource.com/c/87944
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-12-21 00:11:20 +00:00
asiva c0083a6e03 [VM/GC] Turn off concurrent marking during a reload.
Turn off concurrent marking during a reload as new instances could be allocated when loading a kernel file and this results in inconsistencies for the marking thread which is traversing the heap and expects to find instances only from the old set of classes.
(This change is related to Issue https://github.com/dart-lang/sdk/issues/35401)

Change-Id: I294b91d2cc5d86b860a77684457b0f963d2fe557
Reviewed-on: https://dart-review.googlesource.com/c/87707
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-12-20 22:18:27 +00:00
Liam Appelbe 47fec6ce00 Make capacity check and usage increase atomic.
The fiddly part of this is that the current flow is: check
capacity, allocate page, increase usage (but only if page
allocation was successful). So the idea of this CL is to
increase the usage optimistically, then decrease it if the
page allocation fails.

Closes https://github.com/dart-lang/sdk/issues/27413

Bug: https://github.com/dart-lang/sdk/issues/27413
Change-Id: I97ccf3c5a449dc377b8748a73ff4fcffe6d07f2b
Reviewed-on: https://dart-review.googlesource.com/c/86943
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-12-18 18:31:10 +00:00
Régis Crelier 25851db73d [vm/bytecode] Replace InstanceCall instruction with InterfaceCall and DynamicCall.
Dispatch interface calls via hashtable rather than inline cache.
InterfaceCall doesn't need to take arguments descriptor into account
when doing method lookup.

Change-Id: I30eae6ea638d1d2ad2cf3ff073c653fee3377f31
Reviewed-on: https://dart-review.googlesource.com/c/86106
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-12-14 16:51:51 +00:00
Ryan Macnak 3e8b335af8 [vm] Adjust concurrent marker to re-enable code W^X.
Take 2: account for encountering Instructions in the write barrier.

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: I31a8fc8965042678a861a05b09070d52fa07e4a5
Reviewed-on: https://dart-review.googlesource.com/c/87082
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-12-14 02:02:54 +00:00
Martin Kustermann 288d5f0a2a [VM] Bare instructions - Part 2: Start relocating instructions in AOT mode
Start ordering instructions before writing them out in AOT snapshots.

This is done by:

  * discovery of relevant code objects
  * ordering of the code objects (currently simply discovery order)
  * relocate any pc-relative calls by patching up pc-relative calls with
    the actual distance
  * producing image writer commands which tell it in which order and at
    which .text offsets to write out instructions

Note: Our compiler currently does not emit any pc-relative calls. This
will be added later on.

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

Change-Id: I0153c32a7427ea395e80489efadd5513fe7ca371
Reviewed-on: https://dart-review.googlesource.com/c/85745
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-12-13 12:53:09 +00:00
Ryan Macnak e15e8609aa [vm, gc] Fix merge mistake from 04941b5507 that effectively disabled concurrent marking by setting the soft and hard allocation limits to be the same.
Revert 0b66d91cd4, which has issues unmasked by the above.

Bug: https://github.com/dart-lang/sdk/issues/30433
Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: I95129dd2bbafa717989a57c5d62582fdb2e64ffe
Reviewed-on: https://dart-review.googlesource.com/c/87121
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-12-12 23:14:08 +00:00
Ryan Macnak 0b66d91cd4 [vm] Adjust concurrent marker to re-enable code W^X.
Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: I53081e8a19b21804bee776ecab0779c723907008
Reviewed-on: https://dart-review.googlesource.com/c/85624
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-12-03 17:24:58 +00:00
Ryan Macnak edba6fbfaa [vm, gc] Add --force-evacuation flag to aid finding untracked pointers.
Bug: https://github.com/dart-lang/sdk/issues/34934
Change-Id: Ibba2ae5837985a32bd84da4b33bd091dcec3427d
Reviewed-on: https://dart-review.googlesource.com/c/85141
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-21 22:58:57 +00:00
Ryan Macnak e1ffe76a36 [vm] Replace StubEntry with Code handles.
StubEntry was holding raw pointers across safepoints in several places in the compiler.

Bug: https://github.com/dart-lang/sdk/issues/34934
Change-Id: Id17cb7651f4d3508915c8cb90f5cb2353df6dac0
Reviewed-on: https://dart-review.googlesource.com/c/85040
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-21 17:45:11 +00:00
Régis Crelier f721d52163 [VM runtime] Introduce a new VM class Bytecode.
Allow pc_marker slot to hold a Code object or a new Bytecode object.

Change-Id: If11c1df6dafc5b1cfcce6f0322c36d1d68e86df9
Reviewed-on: https://dart-review.googlesource.com/c/82526
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-11-14 02:48:03 +00:00
Alexander Markov f4a80a8466 [vm/bytecode] Fix entry point when optimized code is cleared but bytecode remains
If interpreter is enabled and a function has bytecode, then its entry
point should be set to 'interpreter call' instead of 'lazy compile'
when clearing code.

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

Change-Id: Ie714ac9c4d1ffef181512c5785c374e9de22ab95
Reviewed-on: https://dart-review.googlesource.com/c/84180
Commit-Queue: Régis Crelier <regis@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-11-13 01:04:05 +00:00
Ryan Macnak 03e2be624a [gen_snapshot] Default to --deterministic.
Fix Scavenger to use the right heap verification entry point.

Bug: https://github.com/flutter/flutter/issues/23958
Change-Id: I37892e0cbfd276d81acfeb802b582c469a219eaa
Reviewed-on: https://dart-review.googlesource.com/c/83466
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-08 00:39:50 +00:00
Ryan Macnak f8c89e0d20 [vm] Allow disabling concurrent mark separately from parallel mark.
Bug: https://github.com/dart-lang/sdk/issues/34002
Bug: https://github.com/dart-lang/sdk/issues/35029
Change-Id: I3babfd1b8892da5b137f4e093901479797eccfc9
Reviewed-on: https://dart-review.googlesource.com/c/82945
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-06 21:00:28 +00:00
Ryan Macnak 04941b5507 [vm, gc] For large arrays (arrays on a large heap page), use a card-based remembered set.
Bug: https://github.com/dart-lang/sdk/issues/30433
Change-Id: I7c710d9e36ab593295d00fc5e9e72a86a1b843af
Reviewed-on: https://dart-review.googlesource.com/c/63688
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-05 22:03:34 +00:00
Ryan Macnak 80317f1c09 [vm, gc] Missing piece from "Enable concurrent marking on Android/iOS."
TBR=asiva

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: Ie2ddc4bbb6313cb4156eb1d8720c82d69d06a2ab
Reviewed-on: https://dart-review.googlesource.com/c/82468
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-01 19:37:11 +00:00
Ryan Macnak fa4fdcefb0 [vm, gc] Enable concurrent marking on Android/iOS.
On a Flutter app scrolling through a large table running on a Moto G 4, max pause time reduces from 129ms to 52ms.
Before
   6-44ms CollectNewGeneration
118-129ms CollectOldGeneration
After
   6-52ms CollectNewGeneration
   3-10ms StartConcurrentMarking
  20-42ms CollectOldGeneration (i.e., finalize marking)

Code size increases on Flutter Gallery:
ARM32 Instructions(CodeSize): 5772688 -> 5968624 (+3.39%)
ARM64 Instructions(CodeSize): 6082400 -> 6251008 (+2.77%)

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: Iac9a0b3d91b497b5016c4f89e8779c488f105a5b
Reviewed-on: https://dart-review.googlesource.com/c/76780
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-10-31 20:34:25 +00:00
Ryan Macnak 7514ce941e [vm] Assert handles are only allocated when the thread is preventing safepoints.
Threads in the native or blocked states don't prevent safepoints, so they may run concurrently with a safepoint operation like GC. It is not safe for handles to be allocated while the GC is visiting them, so these threads must not allocate handles. Assert only threads in the VM or generated states, which prevent safepoints until they check in, may allocate handles. (Generated code does not allocate handles, but leaf runtime entries remain in the generated state.)

Bug: https://github.com/dart-lang/sdk/issues/34883
Change-Id: I1a211778f7ef96b53a2405f0ee9dde7871b122b6
Reviewed-on: https://dart-review.googlesource.com/c/81540
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-31 19:51:52 +00:00
asiva f85cd162cc [VM] - put the trace message which states a safepoint is taking too long
under a flag so that it is printed only when needed.
       Addresses issue 34933.

Bug: 34933
Change-Id: Idf77dd9492498d709384b51af66c464ae8c3fe00
Reviewed-on: https://dart-review.googlesource.com/c/81521
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-10-27 02:16:13 +00:00
Ryan Macnak c699214ecd [vm] Fix race in assert in RawObject::VisitPointersPredefined.
While the concurrent marker is running RawObject::VisitPointersPredefined, the mutator may truncate the array being visited. This can cause the size in the object header and the size from the array length to temporarily disagree. Copy logic from RawObject::SizeFromClass to recompute the sizes in this case.

Bug: https://github.com/dart-lang/sdk/issues/22501
Bug: https://github.com/dart-lang/sdk/issues/34917
Change-Id: I2f1ffdc56ab69984a9d364cf0902f113d10f338b
Reviewed-on: https://dart-review.googlesource.com/c/81441
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-10-26 21:09:02 +00:00
Ryan Macnak 001343ce06 [vm, gc] Disable reads and writes to from-space after a scavenge.
Change-Id: Id44de869e9c6823baf63a80caa10ceff9758dc31
Reviewed-on: https://dart-review.googlesource.com/c/79148
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-10-11 18:15:22 +00:00
Ryan Macnak 662ff7f112 [vm] Remove TokenStream, TokenValue, CompilerStats.
(CompilerStats timers have been replaced with the timeline events.)

Change-Id: Iddcb752c085de9762eb802371b6d2905fa608a76
Reviewed-on: https://dart-review.googlesource.com/c/79086
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-10-10 21:39:45 +00:00
Ryan Macnak b8760fed67 [vm, compiler] Remove ASTs and AST flow graph builder.
Change-Id: I4d3c6500577d5285ced327954040dab42ba92341
Reviewed-on: https://dart-review.googlesource.com/c/78823
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-10-10 18:00:21 +00:00
Zachary Anderson aedf5127bd [vm] Enable bump allocation scope for kernel loader
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>
2018-10-03 17:54:43 +00:00
Ryan Macnak 0804245caa [vm] Make filtering in Heap::RecordAfterGC consistent with ServiceEvent::ServiceEvent.
Bug: https://github.com/dart-lang/sdk/issues/34640
Change-Id: Ie9771efe7af221c00d89f7f476d7faef76fc108f
Reviewed-on: https://dart-review.googlesource.com/77640
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-10-02 19:08:30 +00:00
Zach Anderson e98d5d8cc1 [vm] Wait for marker task to finish in BumpAllocateScope
Change-Id: I5a3761a120c4e99d2d62853670ba09d21f270564
Reviewed-on: https://dart-review.googlesource.com/77465
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-10-01 19:33:26 +00:00
Zach Anderson 1dfdcf3593 [vm] Add bump allocation scope
Use it in the kernel loader along with a
NoHeapGrowthControlScope.

Change-Id: I32e8c59298cbc5d022bc7965052d10af838b6b23
Reviewed-on: https://dart-review.googlesource.com/77024
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-10-01 17:19:01 +00:00
Ben Konyi 07852532e3 [ VM ] Additional cleanup in Dart_Initialize and Dart_Cleanup
Change-Id: I6dc02b3d9de16cc176eb97613bc0c7f0bb9b16eb
Reviewed-on: https://dart-review.googlesource.com/77013
Commit-Queue: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2018-09-28 23:18:59 +00:00
Ryan Macnak e811b29788 [vm, gc] Restore growth policy when concurrent marking is not enabled.
Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: If1ebe2f0375d1519214990c0d07937b87e326205
Reviewed-on: https://dart-review.googlesource.com/76782
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-27 21:28:19 +00:00
Ben Konyi 3c4c62d79a Reland "[VM] Dart_Initialize no longer crashes after Dart_Cleanup"
This is a reland of 519ee905f9

Original change's description:
> [VM] Dart_Initialize no longer crashes after Dart_Cleanup
> 
> Change-Id: I3cfdab9553aad045f024b6f9aec0b40b08234007
> Reviewed-on: https://dart-review.googlesource.com/75786
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

Change-Id: Icdd901bf1ab0b675cc5f1497061a2b7b8a05d956
Reviewed-on: https://dart-review.googlesource.com/76561
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-26 17:54:45 +00:00
Ben Konyi b6284b41e3 Revert "[VM] Dart_Initialize no longer crashes after Dart_Cleanup"
This reverts commit 519ee905f9.

Reason for revert: Seeing multiple crashes on Windows

Original change's description:
> [VM] Dart_Initialize no longer crashes after Dart_Cleanup
> 
> Change-Id: I3cfdab9553aad045f024b6f9aec0b40b08234007
> Reviewed-on: https://dart-review.googlesource.com/75786
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com,zra@google.com

Change-Id: I33ad79dbc3fcf44f93612ff63bd2d8431f6067c8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/76342
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-09-25 02:17:37 +00:00
Ben Konyi 519ee905f9 [VM] Dart_Initialize no longer crashes after Dart_Cleanup
Change-Id: I3cfdab9553aad045f024b6f9aec0b40b08234007
Reviewed-on: https://dart-review.googlesource.com/75786
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-09-25 01:20:24 +00:00
Ryan Macnak 93dcfaa289 [vm, gc] Concurrent marking.
Fall back to parallel marking
 - on IA32 (barrier unimplemented)
 - when write_protect_code is enabled (protection dependency on marking state unimplemented)

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: If093f24e4dc6bf29f407cc45e95bb2274fc53dcf
Reviewed-on: https://dart-review.googlesource.com/71389
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-21 21:30:33 +00:00
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 1d4c316d55 [vm, gc] Don't eagerly evacuate new space on old allocation failure, take 2.
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>
2018-09-04 22:51:07 +00:00
Ryan Macnak b090682ad9 [vm, gc] Fix scavenge speed estimate.
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>
2018-08-30 21:16:34 +00:00
Ryan Macnak 14bdc51ff5 [vm, gc] Update the growth policy after reading a snapshot.
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>
2018-08-30 00:47:34 +00:00
Ryan Macnak d8cfe19916 Revert "[vm, gc] Don't eagerly evacuate new space on old allocation failure."
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>
2018-08-30 00:20:17 +00:00
Ryan Macnak 2cfe3b36ab [vm, gc] Adjust header bits to allow generational and incremental barrier filters to run together in one shift-and-mask.
Claims 3 header bits :(

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: Ia4fcc9f2b38ed5aa98a28823616b7de766cdde2d
Reviewed-on: https://dart-review.googlesource.com/69222
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-08-29 22:17:55 +00:00
Ryan Macnak 2891a57322 [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>
2018-08-29 21:11:30 +00:00
Ryan Macnak e38e5aae46 [vm, gc] Force inline ScavengePointer into its sole caller.
Improves x64 SplayHarder by +20%, dart2js-compile geomean +2.28%.

Change-Id: Id6892e52378cb7ebc050615db6552d650ecaa82d
Reviewed-on: https://dart-review.googlesource.com/71887
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-08-29 17:19:36 +00:00
Ryan Macnak 14db718ed5 [vm] Add missing safepoint transitions.
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>
2018-08-28 16:40:17 +00:00
Ryan Macnak bfd86e5b22 [vm, gc] Make bypass_safepoints on helper threads sticky.
Allows concurrent marking and sweeping to continue during safepoints. However, the sweeper still cannot make much progress during a scavenge due to the scavenger holding the freelist lock.

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: I84f3f48feb81e8eeb67c418e918a6e12aa3178c9
Reviewed-on: https://dart-review.googlesource.com/70900
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-08-21 20:12:23 +00:00
Samir Jindel d8a4a3896a [vm] Multiple entrypoints: backend/assembler support.
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>
2018-08-16 17:15:32 +00:00
Ryan Macnak b268f203eb [vm, gc] More aggressively consider idle compactions.
Bug: https://github.com/flutter/flutter/issues/20245
Change-Id: Ie993f4bbac6435b2305e46cfbe0e95115e8554f8
Reviewed-on: https://dart-review.googlesource.com/69060
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-08-11 00:55:58 +00:00
Ryan Macnak bd45ec0c4b [vm, gc] Refactor PageSpace::CollectGarbage to ensure the safepoint and task count remain well-scoped even with early exits.
Landing this separately makes it easier to see the changes for concurrent marking.

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: I8e2e2ca0cddbaba079cf54b6e8cff65c42e21684
Reviewed-on: https://dart-review.googlesource.com/68980
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-08-08 22:59:08 +00:00
Ryan Macnak a2b052939e [vm] Add timeline events for GC phases.
Change-Id: I1c4b58f848d590b5dce751167a7bbb23db2cb26b
Reviewed-on: https://dart-review.googlesource.com/66862
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-08-08 17:27:29 +00:00
Ryan Macnak 9b5a4241de [vm, gc] Don't rebuild the remembered set during marking.
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>
2018-08-08 01:03:42 +00:00
Ryan Macnak ac69a3041a [vm, gc] Rename store_buffer.h as pointer_block.h as it also defines the mark stack blocks.
Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: I85ce8c639bbbfc9167c7c5462ff8756a81ecf3d3
Reviewed-on: https://dart-review.googlesource.com/68841
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-08-07 23:49:14 +00:00
Ryan Macnak c439ebead0 [vm, gc] Update old allocation stats when scanning instead of pushing.
Avoids the incremental barrier needing to deal with allocation stats, and avoids a repeated size calculation.

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: I9104ffca30174a3e659c93d20b4888678e8e759a
Reviewed-on: https://dart-review.googlesource.com/68221
Reviewed-by: Zach Anderson <zra@google.com>
2018-08-07 17:49:03 +00:00