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

Unified Diff: vm/zone.cc

Issue 11879005: Added code to trace zone and handles creation/deletion under flags (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 11 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 | « vm/handles_test.cc ('k') | vm/zone_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/zone.cc
===================================================================
--- vm/zone.cc (revision 16932)
+++ vm/zone.cc (working copy)
@@ -14,7 +14,7 @@
namespace dart {
-DEFINE_DEBUG_FLAG(bool, trace_zone_sizes,
+DEFINE_DEBUG_FLAG(bool, trace_zones,
false, "Traces allocation sizes in the zone.");
@@ -84,7 +84,7 @@
handles_(),
previous_(NULL) {
#ifdef DEBUG
- // Zap the entire initial buffer.
+ // Zap the entire initial buffer.
memset(initial_buffer_.pointer(), kZapUninitializedByte,
initial_buffer_.size());
#endif
@@ -92,16 +92,16 @@
Zone::~Zone() {
+#if defined(DEBUG)
+ if (FLAG_trace_zones) {
+ DumpZoneSizes();
+ }
+#endif
DeleteAll();
if (HeapTrace::is_enabled()) {
Isolate* isolate = Isolate::Current();
isolate->heap()->trace()->TraceDeleteZone(this);
}
-#if defined(DEBUG)
- if (FLAG_trace_zone_sizes) {
- DumpZoneSizes();
- }
-#endif
}
@@ -141,7 +141,9 @@
uword Zone::AllocateExpand(intptr_t size) {
#if defined(DEBUG)
ASSERT(size >= 0);
- if (FLAG_trace_zone_sizes) {
+ if (FLAG_trace_zones) {
+ OS::PrintErr("*** Expanding zone 0x%"Px"\n",
+ reinterpret_cast<intptr_t>(this));
DumpZoneSizes();
}
// Make sure the requested size is already properly aligned and that
@@ -205,8 +207,9 @@
for (Segment* s = large_segments_; s != NULL; s = s->next()) {
size += s->size();
}
- OS::Print("Size in bytes allocated, Total = %"Pd" Large Segments = %"Pd"\n",
- SizeInBytes(), size);
+ OS::PrintErr("*** Zone(0x%"Px") size in bytes,"
+ " Total = %"Pd" Large Segments = %"Pd"\n",
+ reinterpret_cast<intptr_t>(this), SizeInBytes(), size);
}
#endif
@@ -214,6 +217,13 @@
StackZone::StackZone(BaseIsolate* isolate)
: StackResource(isolate),
zone_() {
+#ifdef DEBUG
+ if (FLAG_trace_zones) {
+ OS::PrintErr("*** Starting a new Stack zone 0x%"Px"(0x%"Px")\n",
+ reinterpret_cast<intptr_t>(this),
+ reinterpret_cast<intptr_t>(&zone_));
+ }
+#endif
zone_.Link(isolate->current_zone());
isolate->set_current_zone(&zone_);
}
@@ -222,6 +232,13 @@
StackZone::~StackZone() {
ASSERT(isolate()->current_zone() == &zone_);
isolate()->set_current_zone(zone_.previous_);
+#ifdef DEBUG
+ if (FLAG_trace_zones) {
+ OS::PrintErr("*** Deleting Stack zone 0x%"Px"(0x%"Px")\n",
+ reinterpret_cast<intptr_t>(this),
+ reinterpret_cast<intptr_t>(&zone_));
+ }
+#endif
}
« no previous file with comments | « vm/handles_test.cc ('k') | vm/zone_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698