Commit b00b2c25 authored by mlippautz's avatar mlippautz Committed by Commit bot

[heap] Fix RuntimeCallTimerScope usages

BUG=v8:6343

Review-Url: https://codereview.chromium.org/2857213003
Cr-Commit-Position: refs/heads/master@{#45077}
parent 752cdce6
...@@ -896,7 +896,8 @@ void Heap::CollectAllAvailableGarbage(GarbageCollectionReason gc_reason) { ...@@ -896,7 +896,8 @@ void Heap::CollectAllAvailableGarbage(GarbageCollectionReason gc_reason) {
if (gc_reason == GarbageCollectionReason::kLastResort) { if (gc_reason == GarbageCollectionReason::kLastResort) {
InvokeOutOfMemoryCallback(); InvokeOutOfMemoryCallback();
} }
RuntimeCallTimerScope(isolate(), &RuntimeCallStats::GC_AllAvailableGarbage); RuntimeCallTimerScope runtime_timer(
isolate(), &RuntimeCallStats::GC_AllAvailableGarbage);
if (isolate()->concurrent_recompilation_enabled()) { if (isolate()->concurrent_recompilation_enabled()) {
// The optimizing compiler may be unnecessarily holding on to memory. // The optimizing compiler may be unnecessarily holding on to memory.
DisallowHeapAllocation no_recursive_gc; DisallowHeapAllocation no_recursive_gc;
...@@ -979,7 +980,7 @@ bool Heap::CollectGarbage(GarbageCollector collector, ...@@ -979,7 +980,7 @@ bool Heap::CollectGarbage(GarbageCollector collector,
const v8::GCCallbackFlags gc_callback_flags) { const v8::GCCallbackFlags gc_callback_flags) {
// The VM is in the GC state until exiting this function. // The VM is in the GC state until exiting this function.
VMState<GC> state(isolate()); VMState<GC> state(isolate());
RuntimeCallTimerScope(isolate(), &RuntimeCallStats::GC); RuntimeCallTimerScope runtime_timer(isolate(), &RuntimeCallStats::GC);
#ifdef DEBUG #ifdef DEBUG
// Reset the allocation timeout to the GC interval, but make sure to // Reset the allocation timeout to the GC interval, but make sure to
...@@ -1430,7 +1431,8 @@ bool Heap::PerformGarbageCollection( ...@@ -1430,7 +1431,8 @@ bool Heap::PerformGarbageCollection(
void Heap::CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags) { void Heap::CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags) {
RuntimeCallTimerScope(isolate(), &RuntimeCallStats::GCPrologueCallback); RuntimeCallTimerScope runtime_timer(isolate(),
&RuntimeCallStats::GCPrologueCallback);
for (int i = 0; i < gc_prologue_callbacks_.length(); ++i) { for (int i = 0; i < gc_prologue_callbacks_.length(); ++i) {
if (gc_type & gc_prologue_callbacks_[i].gc_type) { if (gc_type & gc_prologue_callbacks_[i].gc_type) {
if (!gc_prologue_callbacks_[i].pass_isolate) { if (!gc_prologue_callbacks_[i].pass_isolate) {
...@@ -1448,7 +1450,8 @@ void Heap::CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags) { ...@@ -1448,7 +1450,8 @@ void Heap::CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags) {
void Heap::CallGCEpilogueCallbacks(GCType gc_type, void Heap::CallGCEpilogueCallbacks(GCType gc_type,
GCCallbackFlags gc_callback_flags) { GCCallbackFlags gc_callback_flags) {
RuntimeCallTimerScope(isolate(), &RuntimeCallStats::GCEpilogueCallback); RuntimeCallTimerScope runtime_timer(isolate(),
&RuntimeCallStats::GCEpilogueCallback);
for (int i = 0; i < gc_epilogue_callbacks_.length(); ++i) { for (int i = 0; i < gc_epilogue_callbacks_.length(); ++i) {
if (gc_type & gc_epilogue_callbacks_[i].gc_type) { if (gc_type & gc_epilogue_callbacks_[i].gc_type) {
if (!gc_epilogue_callbacks_[i].pass_isolate) { if (!gc_epilogue_callbacks_[i].pass_isolate) {
......
...@@ -2937,8 +2937,8 @@ HeapObject* CompactionSpace::SweepAndRetryAllocation(int size_in_bytes) { ...@@ -2937,8 +2937,8 @@ HeapObject* CompactionSpace::SweepAndRetryAllocation(int size_in_bytes) {
HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) { HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) {
VMState<GC> state(heap()->isolate()); VMState<GC> state(heap()->isolate());
RuntimeCallTimerScope(heap()->isolate(), RuntimeCallTimerScope runtime_timer(heap()->isolate(),
&RuntimeCallStats::GC_SlowAllocateRaw); &RuntimeCallStats::GC_SlowAllocateRaw);
return RawSlowAllocateRaw(size_in_bytes); return RawSlowAllocateRaw(size_in_bytes);
} }
......
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