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

Unified Diff: runtime/vm/heap.cc

Issue 10872074: Report the reason for a garbage collection when verbose GC is enabled. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: runtime/vm/heap.cc
diff --git a/runtime/vm/heap.cc b/runtime/vm/heap.cc
index 6c9a7d1d858613cd89848ffcb6d9fb2edb4d0101..08fd72acbd203360f36087b5d99f8c20d6a74564 100644
--- a/runtime/vm/heap.cc
+++ b/runtime/vm/heap.cc
@@ -178,17 +178,17 @@ void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) {
bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
switch (space) {
case kNew:
- new_space_->Scavenge(invoke_api_callbacks);
+ new_space_->Scavenge(invoke_api_callbacks, "new space");
if (new_space_->HadPromotionFailure()) {
- old_space_->MarkSweep(true);
+ old_space_->MarkSweep(true, "promotion failure");
}
break;
case kOld:
- old_space_->MarkSweep(invoke_api_callbacks);
+ old_space_->MarkSweep(invoke_api_callbacks, "old space");
break;
case kCode:
UNIMPLEMENTED();
- code_space_->MarkSweep(invoke_api_callbacks);
+ code_space_->MarkSweep(invoke_api_callbacks, "code space");
siva 2012/08/27 16:54:49 Can we list these reasons in heap.h as static cons
Ivan Posva 2012/08/27 22:04:23 I like the suggestion of having the different reas
break;
default:
UNREACHABLE();
@@ -211,10 +211,10 @@ void Heap::CollectGarbage(Space space) {
void Heap::CollectAllGarbage() {
- new_space_->Scavenge(kInvokeApiCallbacks);
- old_space_->MarkSweep(kInvokeApiCallbacks);
+ new_space_->Scavenge(kInvokeApiCallbacks, "full");
+ old_space_->MarkSweep(kInvokeApiCallbacks, "full");
// TODO(iposva): Merge old and code space.
- // code_space_->MarkSweep(kInvokeApiCallbacks);
+ // code_space_->MarkSweep(kInvokeApiCallbacks, "full");
if (FLAG_verbose_gc) {
PrintSizes();
}
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | runtime/vm/pages.h » ('j') | runtime/vm/scavenger.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698