Commit 39939eeb authored by hlopko's avatar hlopko Committed by Commit bot

Remove isolate arg from EmbedderHeapTracer methods.

As the code on the blink side sits down, we realize we don't need isolate arg
anymore. As the heap tracer is set per isolate, it can actually be confusing if
the isolate passed as argument is always the same as the isolate the heap tracer
was set for. Wdyt?

BUG=468240
LOG=no

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

Cr-Commit-Position: refs/heads/master@{#35620}
parent 8b333727
......@@ -5413,17 +5413,16 @@ enum class MemoryPressureLevel { kNone, kModerate, kCritical };
* trace through its heap and call PersistentBase::RegisterExternalReference on
* each js object reachable from any of the given wrappers.
*
* Before the first call to the TraceWrappersFrom function v8 will call
* TracePrologue. When the v8 garbage collection is finished, v8 will call
* TraceEpilogue.
* Before the first call to the TraceWrappersFrom function TracePrologue will be
* called. When the garbage collection cycle is finished, TraceEpilogue will be
* called.
*/
class EmbedderHeapTracer {
public:
/**
* V8 will call this method at the beginning of the gc cycle.
*/
virtual void TracePrologue(Isolate* isolate) = 0;
virtual void TracePrologue() = 0;
/**
* V8 will call this method with internal fields of a potential wrappers.
* Embedder is expected to trace its heap (synchronously) and call
......@@ -5431,13 +5430,12 @@ class EmbedderHeapTracer {
* any of the given wrappers.
*/
virtual void TraceWrappersFrom(
Isolate* isolate,
const std::vector<std::pair<void*, void*> >& internal_fields) = 0;
/**
* V8 will call this method at the end of the gc cycle. Allocation is *not*
* allowed in the TraceEpilogue.
*/
virtual void TraceEpilogue(Isolate* isolate) = 0;
virtual void TraceEpilogue() = 0;
protected:
virtual ~EmbedderHeapTracer() = default;
......
......@@ -2024,8 +2024,7 @@ void MarkCompactCollector::ProcessEphemeralMarking(
DCHECK(marking_deque_.IsEmpty() && !marking_deque_.overflowed());
while (work_to_do) {
if (UsingEmbedderHeapTracer()) {
embedder_heap_tracer()->TraceWrappersFrom(
reinterpret_cast<v8::Isolate*>(isolate()), wrappers_to_trace_);
embedder_heap_tracer()->TraceWrappersFrom(wrappers_to_trace_);
wrappers_to_trace_.clear();
} else if (!only_process_harmony_weak_collections) {
isolate()->global_handles()->IterateObjectGroups(
......@@ -2219,8 +2218,7 @@ void MarkCompactCollector::MarkLiveObjects() {
TRACE_GC(heap()->tracer(),
GCTracer::Scope::MC_MARK_WEAK_CLOSURE_EPHEMERAL);
if (UsingEmbedderHeapTracer()) {
embedder_heap_tracer()->TracePrologue(
reinterpret_cast<v8::Isolate*>(isolate()));
embedder_heap_tracer()->TracePrologue();
}
ProcessEphemeralMarking(&root_visitor, false);
ProcessMarkingDeque();
......@@ -2259,8 +2257,7 @@ void MarkCompactCollector::MarkLiveObjects() {
ProcessEphemeralMarking(&root_visitor, true);
ProcessMarkingDeque();
if (UsingEmbedderHeapTracer()) {
embedder_heap_tracer()->TraceEpilogue(
reinterpret_cast<v8::Isolate*>(isolate()));
embedder_heap_tracer()->TraceEpilogue();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment