Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Use a different GCCallbackFlag for GCs triggered by CollectAllAvailab…
Browse files Browse the repository at this point in the history
…leGarbage

Blink wants to distinguish GCs triggered by CollectAllAvailableGarbage
from GCs forced by testing. This CL introduces a new flag to differentiate
the two GC types.

BUG=591463
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#34494}
  • Loading branch information
xharaken authored and Commit bot committed Mar 4, 2016
1 parent 6fecd17 commit 10f6a9e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -5090,11 +5090,24 @@ enum GCType {
kGCTypeIncrementalMarking | kGCTypeProcessWeakCallbacks
};

/**
* GCCallbackFlags is used to notify additional information about the GC
* callback.
* - kGCCallbackFlagConstructRetainedObjectInfos: The GC callback is for
* constructing retained object infos.
* - kGCCallbackFlagForced: The GC callback is for a forced GC for testing.
* - kGCCallbackFlagSynchronousPhantomCallbackProcessing: The GC callback
* is called synchronously without getting posted to an idle task.
* - kGCCallbackFlagCollectAllAvailableGarbage: The GC callback is called
* in a phase where V8 is trying to collect all available garbage
* (e.g., handling a low memory notification).
*/
enum GCCallbackFlags {
kNoGCCallbackFlags = 0,
kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1,
kGCCallbackFlagForced = 1 << 2,
kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3
kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3,
kGCCallbackFlagCollectAllAvailableGarbage = 1 << 4,
};

typedef void (*GCCallback)(GCType type, GCCallbackFlags flags);
Expand Down

0 comments on commit 10f6a9e

Please sign in to comment.