v8/test/unittests/heap
Leszek Swirski e659917aa3 [offthread] Add OffThreadFactory
Introduce OffThreadFactory with initial string construction support.

The OffThreadFactory shares with Factory a new CRTP base class, called
FactoryBase. Methods in FactoryBase return a FactoryHandle<Factory, T>
alias, which is Handle<T> for normal Factory and a new OffThreadHandle<T>
for OffThreadFactory. OffThreadHandle<T> behaves like Handle<T>, except
it stores the object in-line rather than needing external storage.

Any shared factory methods are moved into FactoryBase, which uses CRTP
to call the sub-class's AllocateRaw method (plus a few more customization
points which need Isolate access on the main thread).

Methods that used to take an Isolate or Factory, and are needed off the
main thread, are now expected to be templated on the factory type and
to use the appropriate handle.

Once an OffThreadFactory has finished being used (e.g. off-thread
compilation completed) its pages are "Published" into the main-thread
Heap. To deal with string internalization without creating a bunch of
ThinStrings, this is done in two stages:

  1. 'FinishOffThread': The off-thread pages are walked to
     collect all slots pointing to "internalized" strings. After this is
     called it is invalid to allocate any more objects with the factory.
  2. 'Publish': On the main thread, we transform these slots into
     <Handle to holder, offset> pairs, then for each saved slot
     re-internalize its string and update the slot to point to the
     internalized string.

Bug: chromium:1011762
Change-Id: I008a694da3c357de34362bd86fe7e1f46b535d5e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1992434
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65787}
2020-01-15 12:38:29 +00:00
..
barrier-unittest.cc Reland "[d8] Remove maximum workers limitation" 2019-07-30 07:56:17 +00:00
bitmap-test-utils.h [heap] Relax accessing markbits in ranges. 2019-02-25 15:28:41 +00:00
bitmap-unittest.cc [heap] Relax accessing markbits in ranges. 2019-02-25 15:28:41 +00:00
code-object-registry-unittest.cc [heap] Make CodeObjectRegistry a separate class. 2019-05-16 18:41:33 +00:00
embedder-tracing-unittest.cc api,handles: Support for on-stack TracedReference 2020-01-14 15:37:57 +00:00
gc-idle-time-handler-unittest.cc [heap] Simplify idle notification handler 2019-02-21 12:25:52 +00:00
gc-tracer-unittest.cc [heap, tracing] Use WorkerThreadRuntimeCallStatsScope in background GC 2019-08-29 15:55:48 +00:00
heap-controller-unittest.cc [heap] Introduce a min heap size and skip GCs below that threshold 2019-06-06 15:49:50 +00:00
heap-unittest.cc [ptr-compr] Set isolate root to the beginning of a 4Gb reservation 2019-10-07 17:26:30 +00:00
item-parallel-job-unittest.cc [heap] Do not emit background GC trace events on the main thread 2019-07-18 08:56:58 +00:00
marking-unittest.cc Move remaining files in src/ 2019-05-24 18:24:36 +00:00
marking-worklist-unittest.cc [heap] Introduce per-context marking worklists 2019-12-20 15:49:12 +00:00
memory-reducer-unittest.cc Move remaining files in src/ 2019-05-24 18:24:36 +00:00
object-stats-unittest.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
off-thread-factory-unittest.cc [offthread] Add OffThreadFactory 2020-01-15 12:38:29 +00:00
scavenge-job-unittest.cc Move remaining files in src/ 2019-05-24 18:24:36 +00:00
slot-set-unittest.cc [heap] Reland: Reduce size of possibly empty buckets 2019-12-09 11:31:58 +00:00
spaces-unittest.cc [offthread] Add OffThreadFactory 2020-01-15 12:38:29 +00:00
unmapper-unittest.cc Move utility code to src/utils 2019-05-23 14:13:34 +00:00
worklist-unittest.cc [heap] Rename IsGlobalEmpty to IsEmpty 2018-07-03 07:15:34 +00:00