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