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

Unified Diff: runtime/vm/scavenger.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
« runtime/vm/scavenger.h ('K') | « runtime/vm/scavenger.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.cc
diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc
index 00923d197efecd680ca9525e6a3e3ef20ea13ea1..dd8f4662feb7425c4b2fcd5aa23aec06460e6c67 100644
--- a/runtime/vm/scavenger.cc
+++ b/runtime/vm/scavenger.cc
@@ -530,14 +530,14 @@ void Scavenger::VisitObjects(ObjectVisitor* visitor) const {
}
-void Scavenger::Scavenge() {
+void Scavenger::Scavenge(const char* reason) {
// TODO(cshapiro): Add a decision procedure for determining when the
// the API callbacks should be invoked.
- Scavenge(false);
+ Scavenge(false, reason);
}
-void Scavenger::Scavenge(bool invoke_api_callbacks) {
+void Scavenger::Scavenge(bool invoke_api_callbacks, const char* reason) {
// Scavenging is not reentrant. Make sure that is the case.
ASSERT(!scavenging_);
scavenging_ = true;
@@ -552,7 +552,7 @@ void Scavenger::Scavenge(bool invoke_api_callbacks) {
}
if (FLAG_verbose_gc) {
- OS::PrintErr("Start scavenge\n");
+ OS::PrintErr("Start scavenge for %s collection\n", reason);
}
Timer timer(FLAG_verbose_gc, "Scavenge");
timer.Start();
« runtime/vm/scavenger.h ('K') | « runtime/vm/scavenger.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698