v8/test
Sathya Gunasekaran 743ce7726d [WeakRefs] Make cleanup callback run as a task
Previously, this was run as a microtask and this CL changes it to run
as a separate task as mandated by the current WeakRef spec.

This CL also introduces a FinalizationGroup type to the V8 API
representing the JSFinalizationGroup. This has a `Cleanup`
function that runs the cleanup callback associated with it.

SetHostCleanupFinalizationGroupCallback is added to set
the embedder defined HostCleanupFinalizationGroupCallback.

ClearKeptObject is exposed on the v8::Isolate to reset the strongly
held set of objects.

The general workflow is the following:

(a) When the GC notices that a given finalization group has dirty
    cells, it calls HostCleanupFinalizationGroupCallback with the given
    finalization group.

(b) As part of HostCleanupFinalizationGroupCallback, the embedder
    enqueues a task that at some point later calls
    FinalizationGroup::Cleanup.

(c) At some point in the future, FinalizationGroup::Cleanup is called,
    which runs the cleanup callback of the finalization group.

This patch also includes d8 changes to use these new APIs. Currently,
d8 cycles through the enqueued finalization groups after a synchronous
turn (and it's microtask checkpoint) and runs the cleanup callbacks.

Change-Id: I06eb4da2c103b2792a9c62bc4b98fd4e5c4892fc
Bug: v8:8179
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1655655
Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Hannes Payer <hpayer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62984}
2019-07-30 12:19:39 +00:00
..
benchmarks [test] Skip flaky test on predictable mode 2019-05-07 13:57:18 +00:00
cctest [WeakRefs] Make cleanup callback run as a task 2019-07-30 12:19:39 +00:00
common [asm.js] Propagate language mode to exported functions. 2019-07-19 11:47:48 +00:00
debugger [debugger] Fix debug-evaluate for context-allocated this. 2019-07-05 12:14:35 +00:00
fuzzer [csa] block cloning to optimize branch on phi 2019-07-30 10:30:29 +00:00
inspector Reland "[d8] Remove maximum workers limitation" 2019-07-30 07:56:17 +00:00
intl [Intl] Adding volume units. 2019-07-24 17:16:46 +00:00
js-perf-test [test] Add micro-benchmark tests for calls with local vars 2019-07-12 16:54:01 +00:00
memory [owners] Remove redundant OWNERS files in test/ 2019-06-24 12:44:32 +00:00
message Reland "Reland "Let all early errors be SyntaxErrors."" 2019-07-08 10:15:46 +00:00
mjsunit [WeakRefs] Make cleanup callback run as a task 2019-07-30 12:19:39 +00:00
mkgrokdump Revert "Add postmortem debugging helper library" 2019-07-24 16:31:54 +00:00
mozilla [regexp] Add missing case for EscapeRegExpPattern 2019-07-09 08:11:51 +00:00
preparser Add OWNERS files for src and test 2019-05-30 04:51:21 +00:00
test262 [WeakRefs] Make cleanup callback run as a task 2019-07-30 12:19:39 +00:00
torque [csa] block cloning to optimize branch on phi 2019-07-30 10:30:29 +00:00
unittests [WeakRefs] Make cleanup callback run as a task 2019-07-30 12:19:39 +00:00
wasm-api-tests [wasm-c-api] Drop Isolate::Enter/Exit calls... 2019-07-12 18:51:32 +00:00
wasm-js [testrunner] generalize test loader to accept multiple extensions 2019-06-25 12:12:11 +00:00
wasm-spec-tests [wasm][bulk-memory] Adjust elem and data segment to recent spec changes 2019-07-25 08:40:27 +00:00
webkit [regexp] Add missing case for EscapeRegExpPattern 2019-07-09 08:11:51 +00:00
BUILD.gn [wasm-c-api] Add tests and fixes 2019-05-28 09:57:04 +00:00
OWNERS [owners] Make test/ owned by COMMON_OWNERS 2019-06-06 20:56:09 +00:00