v8
8.1.307(node14.1.0)
V8 is Google's open source JavaScript engine
|
#include <v8.h>
Data Structures | |
class | TracedGlobalHandleVisitor |
struct | TraceSummary |
Public Types | |
enum | TraceFlags : uint64_t { kNoFlags = 0, kReduceMemory = 1 << 0 } |
enum | EmbedderStackState { kUnknown, kNonEmpty, kEmpty } |
Protected Attributes | |
v8::Isolate * | isolate_ = nullptr |
Friends | |
class | internal::LocalEmbedderHeapTracer |
Interface for tracing through the embedder heap. During a V8 garbage collection, V8 collects hidden fields of all potential wrappers, and at the end of its marking phase iterates the collection and asks the embedder to trace through its heap and use reporter to report each JavaScript object reachable from any of the given wrappers.
enum EmbedderStackState |
enum TraceFlags : uint64_t |
|
virtualdefault |
|
pure virtual |
Called to advance tracing in the embedder.
The embedder is expected to trace its heap starting from wrappers reported by RegisterV8References method, and report back all reachable wrappers. Furthermore, the embedder is expected to stop tracing by the given deadline. A deadline of infinity means that tracing should be finished.
Returns |true| if tracing is done, and false otherwise.
void DecreaseAllocatedSize | ( | size_t | bytes | ) |
|
pure virtual |
Called upon entering the final marking pause. No more incremental marking steps will follow this call.
void FinalizeTracing | ( | ) |
void GarbageCollectionForTesting | ( | EmbedderStackState | stack_state | ) |
void IncreaseAllocatedSize | ( | size_t | bytes | ) |
|
inline |
Definition at line 8011 of file v8.h.
References EmbedderHeapTracer::isolate_.
|
virtual |
Returns true if the TracedGlobal handle should be considered as root for the currently running non-tracing garbage collection and false otherwise. The default implementation will keep all TracedGlobal references as roots.
If this returns false, then V8 may decide that the object referred to by such a handle is reclaimed. In that case:
Note that the |handle| is different from the handle that the embedder holds for retaining the object. The embedder may use |WrapperClassId()| to distinguish cases where it wants handles to be treated as roots from not being treated as roots.
|
virtual |
|
pure virtual |
void IterateTracedGlobalHandles | ( | TracedGlobalHandleVisitor * | visitor | ) |
Iterates all TracedGlobal handles created for the v8::Isolate the tracer is attached to.
void NotifyEmptyEmbedderStack | ( | ) |
Called by the embedder to notify V8 of an empty execution stack.
void RegisterEmbedderReference | ( | const TracedReferenceBase< v8::Data > & | ref | ) |
|
pure virtual |
Called by v8 to register internal fields of found wrappers.
The embedder is expected to store them somewhere and trace reachable wrappers from them when called through |AdvanceTracing|.
|
virtual |
Used in combination with |IsRootForNonTracingGC|. Called by V8 when an object that is backed by a handle is reclaimed by a non-tracing garbage collection. It is up to the embedder to reset the original handle.
Note that the |handle| is different from the handle that the embedder holds for retaining the object. It is up to the embedder to find the original handle via the object or class id.
void SetStackStart | ( | void * | stack_start | ) |
Called by the embedder to set the start of the stack which is e.g. used by V8 to determine whether handles are used from stack or heap.
|
inlinevirtual |
|
inlinevirtual |
|
protected |
Definition at line 8014 of file v8.h.
Referenced by EmbedderHeapTracer::isolate().