Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 401f4f7948adc09cb845390ef7f37036fa179aee..ca36a5e88d451120ed06da757af4b45c8a33bc9a 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -869,9 +869,12 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector, |
GCType gc_type = |
collector == MARK_COMPACTOR ? kGCTypeMarkSweepCompact : kGCTypeScavenge; |
- for (int i = 0; i < gc_prologue_callbacks_.length(); ++i) { |
- if (gc_type & gc_prologue_callbacks_[i].gc_type) { |
- gc_prologue_callbacks_[i].callback(gc_type, kNoGCCallbackFlags); |
+ { |
+ GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); |
+ for (int i = 0; i < gc_prologue_callbacks_.length(); ++i) { |
+ if (gc_type & gc_prologue_callbacks_[i].gc_type) { |
+ gc_prologue_callbacks_[i].callback(gc_type, kNoGCCallbackFlags); |
+ } |
} |
} |
@@ -979,10 +982,13 @@ bool Heap::PerformGarbageCollection(GarbageCollector collector, |
amount_of_external_allocated_memory_; |
} |
- GCCallbackFlags callback_flags = kNoGCCallbackFlags; |
- for (int i = 0; i < gc_epilogue_callbacks_.length(); ++i) { |
- if (gc_type & gc_epilogue_callbacks_[i].gc_type) { |
- gc_epilogue_callbacks_[i].callback(gc_type, callback_flags); |
+ { |
+ GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL); |
+ GCCallbackFlags callback_flags = kNoGCCallbackFlags; |
+ for (int i = 0; i < gc_epilogue_callbacks_.length(); ++i) { |
+ if (gc_type & gc_epilogue_callbacks_[i].gc_type) { |
+ gc_epilogue_callbacks_[i].callback(gc_type, callback_flags); |
+ } |
} |
} |