Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: runtime/vm/heap.cc

Issue 3000293002: Don't blame old-space GC time against a new-space GC that triggered it. (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 7f0472ca2bfcdae09f67dceedf703ca0d9498786..59f61af3cc6c58b90bcfbd2ba7d3a0b88cef0d92 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -431,15 +431,17 @@ void Heap::CollectNewSpaceGarbage(Thread* thread,
if (BeginNewSpaceGC(thread)) {
bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
RecordBeforeGC(kNew, reason);
- VMTagScope tagScope(thread, VMTag::kGCNewSpaceTagId);
- TIMELINE_FUNCTION_GC_DURATION(thread, "CollectNewGeneration");
- NOT_IN_PRODUCT(UpdateClassHeapStatsBeforeGC(kNew));
- new_space_.Scavenge(invoke_api_callbacks);
- NOT_IN_PRODUCT(isolate()->class_table()->UpdatePromoted());
- RecordAfterGC(kNew);
- PrintStats();
- NOT_IN_PRODUCT(PrintStatsToTimeline(&tds));
- EndNewSpaceGC();
+ {
+ VMTagScope tagScope(thread, VMTag::kGCNewSpaceTagId);
+ TIMELINE_FUNCTION_GC_DURATION(thread, "CollectNewGeneration");
+ NOT_IN_PRODUCT(UpdateClassHeapStatsBeforeGC(kNew));
+ new_space_.Scavenge(invoke_api_callbacks);
+ NOT_IN_PRODUCT(isolate()->class_table()->UpdatePromoted());
+ RecordAfterGC(kNew);
+ PrintStats();
+ NOT_IN_PRODUCT(PrintStatsToTimeline(&tds));
+ EndNewSpaceGC();
+ }
if ((reason == kNewSpace) && old_space_.NeedsGarbageCollection()) {
// Old collections should call the API callbacks.
CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kPromotion);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698