Chromium Code Reviews| Index: src/heap/heap.cc |
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
| index 54a8915788237436b72762d6cb303ed9f189725b..d5c8360c06e1cd3f4231970603ca16ef11bcb47a 100644 |
| --- a/src/heap/heap.cc |
| +++ b/src/heap/heap.cc |
| @@ -395,6 +395,20 @@ void Heap::ReportStatisticsAfterGC() { |
| #else |
| if (FLAG_log_gc) new_space_.ReportStatistics(); |
| #endif // DEBUG |
| + for (int i = 0; i < static_cast<int>(v8::Isolate::kUseCounterFeatureCount); |
| + ++i) { |
| + int count = deferred_counters_[i]; |
| + deferred_counters_[i] = 0; |
| + while (count != 0) { |
|
Jakob Kummerow
2015/05/11 08:27:37
nit: I'd suggest s/!=/>/ here, as it's slightly mo
Erik Corry
2015/05/11 09:56:12
Done.
|
| + count--; |
| + isolate()->CountUsage(static_cast<v8::Isolate::UseCounterFeature>(i)); |
| + } |
| + } |
| +} |
| + |
| + |
| +void Heap::IncrementDeferredCount(v8::Isolate::UseCounterFeature feature) { |
| + deferred_counters_[feature]++; |
| } |
| @@ -925,6 +939,11 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason, |
| tracer()->Stop(collector); |
| } |
| + if (collector == MARK_COMPACTOR && |
| + (gc_callback_flags & kGCCallbackFlagForced) != 0) { |
| + isolate()->CountUsage(v8::Isolate::kForcedGC); |
| + } |
| + |
| // Start incremental marking for the next cycle. The heap snapshot |
| // generator needs incremental marking to stay off after it aborted. |
| if (!mark_compact_collector()->abort_incremental_marking() && |
| @@ -5422,6 +5441,12 @@ bool Heap::SetUp() { |
| } |
| } |
| + for (int i = 0; i < static_cast<int>(v8::Isolate::kUseCounterFeatureCount); |
| + i++) { |
| + deferred_counters_[i] = 0; |
| + } |
| + |
| + |
| LOG(isolate_, IntPtrTEvent("heap-capacity", Capacity())); |
| LOG(isolate_, IntPtrTEvent("heap-available", Available())); |