Commit Graph

22 Commits

Author SHA1 Message Date
Ryan Macnak d965998d1c [vm] Begin a sliding compactor.
Improves the space overhead of compaction from O(size of live objects) to O(number of live objects).

Future work includes: 
 - a smaller, faster representation the forwarding table via a bitmap of used allocation units
 - sorting class sizes off-heap to allow sliding classes
 - running forwarding in parallel

Removes unnecessary sweep from evacuating compactor.

Change-Id: If0991bfb75573201c6e8feed142ca0cc69fccab4
Bug: https://github.com/dart-lang/sdk/issues/30978
Reviewed-on: https://dart-review.googlesource.com/15988
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Erik Corry <erikcorry@google.com>
2017-10-25 21:57:08 +00: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
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Florian Schneider 3d4a7b1ca3 Remove invalid assertion in store buffer code.
This code is also used by other threads (e.g. background compiler).

BUG=#26783
R=asiva@google.com

Review URL: https://codereview.chromium.org/2104073002 .
2016-06-28 13:15:36 -07:00
Siva Annamalai 56e888d4cd - Move
stack_limit_,
   stack_overflow_flags_,
   saved_stack_limit_,
   stack_overflow_count_ and
   other interrupts mask fields from Isolate structure to Thread structure

- Change the stack overflow check in the prolog to load the stack limit
  from the THR register, this removes the back to back dependent loads to
  load the stack limit from the Isolate structure

R=johnmccutchan@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/1812753002 .
2016-03-17 12:57:36 -07:00
Daniel Andersson e98fcf9354 Distinct block sizes for StoreBuffer/MarkingStack.
Remove typedef hack by templatizing the shared structures,
parameterized by block size.

Smaller marking stack blocks are needed for better work distribution during parallel GC.

As a consequence, MarkingStack and StoreBuffer have separate global caches of empty blocks.

Also, use inheritance to differentiate: only StoreBuffer needs the threshold-checking functionality.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1350933004 .
2015-09-17 12:21:55 -07:00
Daniel Andersson 74e02785b0 Fix reuse of free store buffer blocks from the global cache of free blocks.
Add StoreBuffer::ShutDown to delete global cache of free blocks on VM shutdown.

BUG=https://github.com/dart-lang/sdk/issues/24129
R=iposva@google.com

Review URL: https://codereview.chromium.org//1309603003 .
2015-08-21 08:37:09 -07:00
Daniel Andersson eb1bcef36f Process marking stack chunk-wise.
Prepares for parallel processing of a shared marking stack, but code remains
unsynchronized for now.

Share basic data structures with the StoreBuffer.

BUG=

Review URL: https://codereview.chromium.org//1271833002 .
2015-08-07 06:43:07 -07:00
Daniel Andersson 500eb6d79d Safepoint interface and unit tests.
Add infrastructure to enable all threads in an isolate to rendezvous at GC-safe points, and exercise it through unit tests.

* Use existing interrupt mechanism for Dart threads, but a cooperative approach for non-Dart threads (concurrent compiler, etc.): they must periodically call CheckSafepoint (may block).

* Add unit tests to exercise and verify various scenarios: organizing the rendezvous from helper/main thread, with/without Dart code executing, etc.

The next step is to use this interface in old-space allocation and garbage collection, respectively, to allow helper threads to perform allocations that potentially trigger GC (needed for concurrent compiler).

Limitations:

* A thread that is executing a long-running native function is currently not considered at a safepoint, and will delay the rendezvous until it returns to Dart or indirectly calls CheckSafepoint. In a future CL, we can use the saved stack pointer to detect and support this case, and intercept the thread if/when it re-enters Dart or the VM.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1259223005 .
2015-07-31 19:53:14 -07:00
Daniel Andersson 8b4ac45038 Reuse empty StoreBufferBlocks.
Keep cache of empty blocks shared among all isolates, limited in size.
Change overflow threshold check to include partially filled blocks.
Make Isolate::store_buffer_ a pointer, now that it's less frequently accessed, to keep the offsets of other fields small

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1173043002.
2015-06-18 16:16:50 -07:00
Daniel Andersson a410c0f993 Thread-local store buffers, v2
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1168483003.
2015-06-09 09:33:36 -07:00
regis@google.com 8f62a87598 Switch code generation on ARM from softfp ABI to hardfp ABI.
Support leaf float runtime calls in ARM simulator.
Enable previously failing tests.

R=zra@google.com

Review URL: https://codereview.chromium.org//16638012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23868 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 16:47:01 +00:00
iposva@google.com 083c9e5e95 - Remember the fact that an object has been added to the
store buffer by a bit in the header.
- This bit can be used to filter out redundant additions
  into the store buffer making the dedup sets not needed.
- Remove the need for a HashSet when remembering old to
  new references.

Review URL: https://codereview.chromium.org//14307013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22393 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 20:59:42 +00:00
vegorov@google.com 6c60285f23 Drain StoreBufferBlock into store buffer instead of iterating over it directly.
This will deduplicate its entries. StoreBufferBlock might be contain the same large object dozens of times and without deduplication this will severely degrade GC performance by revisiting the same large object for every time it is recorded in the StoreBufferBlock.

BUG=dart:10048

Review URL: https://codereview.chromium.org//14348026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21766 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-19 20:14:44 +00:00
iposva@google.com 4dff6b8e2b - Remember objects (not addresses) in the old generation containing new pointers.
Review URL: https://codereview.chromium.org//13406004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20828 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-02 22:45:18 +00:00
iposva@google.com b21d7c16f6 - Tighten assertions around store buffers.
- Use the correct object when filtering in store barriers.
Review URL: https://chromiumcodereview.appspot.com//10796075

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9797 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-21 01:08:14 +00:00
iposva@google.com 7f843b0fc9 - Start using the collected store buffer entries to find
old->new references during Scavenge.
Review URL: https://chromiumcodereview.appspot.com//10797021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9791 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 21:41:55 +00:00
iposva@google.com dd800b6870 - On store buffer block overflow call a VM leaf function to
add the entries into the store buffer.
- Add a way to preserve and restore caller saved registers.
- Clean up the implementation of the stub for Assembler::Stop.
Review URL: https://chromiumcodereview.appspot.com//10758008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9490 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 22:58:27 +00:00
iposva@google.com 65d96de4e8 - Separate store buffer data in the isolate into the StoreBufferBlock and
the actual StoreBuffer.
- Add a HashSet class to use for the StoreBuffer data.
- Fix allocation sites for definite old objects.
- Remove obsolete leaf runtime entry StoreBuffer.
Review URL: https://chromiumcodereview.appspot.com//10702067

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9323 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-03 00:10:23 +00:00
iposva@google.com dbd08016de - Inline the store buffer update into a stub instead of
calling out into the C++ runtime.
Review URL: https://chromiumcodereview.appspot.com//10578046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8929 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-20 18:05:51 +00:00
sgjesse@google.com bf67f24098 Move assert.h/assert.cc from runtime/vm to runtime/platform
The purpose of this change is twofold:

1. Source in the bin directory can now use the same assertions as
   source in the vm directory. The ASSERT macro used by the code
   in runtime/bin was just defined to use assert from the standard
   C library.
2. Moving other implementation parts from runtime/vm to
   runtime/platform (e.g. classes Monitor and Mutex) for sharing
   between runtime/bin and runtime/vm will be easier as these
   implementations rely on these assertion macros.

Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.

All the code for asserts is still in the dart namespace.

Also re-arranged the order of includes to be alphabetically in
the files touched.

R=ager@google.com, iposva@google.com

BUG=
TEST=

Review URL: http://codereview.chromium.org//9189003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 12:28:10 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00