Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Unified Diff: include/v8.h

Issue 2291613002: [api] Add NumberOfWrappersToTrace to EmbedderHeapTracer. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index fa572b0a00e2d9f1517ef5fd4448c547453657c3..5e09beef4fb12af87a2fe9684c755442c08f5845 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -5755,23 +5755,27 @@ enum class MemoryPressureLevel { kNone, kModerate, kCritical };
class V8_EXPORT EmbedderHeapTracer {
public:
enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION };
+
struct AdvanceTracingActions {
explicit AdvanceTracingActions(ForceCompletionAction force_completion_)
: force_completion(force_completion_) {}
ForceCompletionAction force_completion;
};
+
/**
- * V8 will call this method with internal fields of found wrappers.
- * Embedder is expected to store them in it's marking deque and trace
- * reachable wrappers from them when asked by AdvanceTracing method.
+ * V8 will call this method with internal fields of found wrappers. The
+ * embedder is expected to store them in its marking deque and trace
+ * reachable wrappers from them when called through |AdvanceTracing|.
*/
virtual void RegisterV8References(
const std::vector<std::pair<void*, void*> >& internal_fields) = 0;
+
/**
- * V8 will call this method at the beginning of the gc cycle.
+ * V8 will call this method at the beginning of a GC cycle.
*/
virtual void TracePrologue() = 0;
+
/**
* Embedder is expected to trace its heap starting from wrappers reported by
* RegisterV8References method, and call
@@ -5782,9 +5786,11 @@ class V8_EXPORT EmbedderHeapTracer {
*/
virtual bool AdvanceTracing(double deadline_in_ms,
AdvanceTracingActions actions) = 0;
+
/**
- * V8 will call this method at the end of the gc cycle. Allocation is *not*
- * allowed in the TraceEpilogue.
+ * V8 will call this method at the end of a GC cycle.
+ *
+ * Note that allocation is *not* allowed within |TraceEpilogue|.
*/
virtual void TraceEpilogue() = 0;
@@ -5799,6 +5805,11 @@ class V8_EXPORT EmbedderHeapTracer {
*/
virtual void AbortTracing() {}
+ /**
+ * Returns the number of wrappers that are still to be traced by the embedder.
+ */
+ virtual size_t NumberOfWrappersToTrace() { return 0; }
+
protected:
virtual ~EmbedderHeapTracer() = default;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698