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

Unified Diff: runtime/vm/heap_profiler.cc

Issue 11881010: - Dump Smi objects into the heap profile. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
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 | « runtime/vm/heap_profiler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/heap_profiler.cc
===================================================================
--- runtime/vm/heap_profiler.cc (revision 16999)
+++ runtime/vm/heap_profiler.cc (working copy)
@@ -124,6 +124,11 @@
HeapProfiler::~HeapProfiler() {
+ for (std::set<const RawSmi*>::iterator it = smi_table_.begin();
cshapiro 2013/01/12 02:52:26 You might consider using this idiom... for_each
+ it != smi_table_.end();
+ ++it) {
+ WriteSmiDump(*it);
+ }
delete heap_dump_record_;
}
@@ -566,7 +571,28 @@
}
}
+// INSTANCE DUMP - 0x21
cshapiro 2013/01/12 02:52:26 We probably do not need to repeat this documentati
Ivan Posva 2013/01/14 23:38:42 Done.
+//
+// Format:
+// ID - object ID
+// u4 - stack trace serial number
+// ID - class object ID
+// u4 - number of bytes that follow
+// [value]* - instance field values (this class, followed by super class, etc)
+void HeapProfiler::WriteSmiDump(const RawSmi* raw_smi) {
+ ASSERT(!raw_smi->IsHeapObject());
+ SubRecord sub(kInstanceDump, this);
+ // object ID
+ sub.WriteObjectId(raw_smi);
siva 2013/01/14 23:50:13 Since we are writing out smi values as an object i
Ivan Posva 2013/01/14 23:53:38 IDs from the heap profiler dump perspective are th
cshapiro 2013/01/14 23:55:22 It should not. We use an object's address as its
+ // stack trace serial number
+ sub.Write32(0);
+ // class object ID
+ sub.WriteObjectId(Isolate::Current()->class_table()->At(kSmiCid));
+ // number of bytes that follow
+ sub.Write32(0);
+}
+
// INSTANCE DUMP - 0x21
//
// Format:
@@ -576,6 +602,7 @@
// u4 - number of bytes that follow
// [value]* - instance field values (this class, followed by super class, etc)
void HeapProfiler::WriteInstanceDump(const RawObject* raw_obj) {
+ ASSERT(raw_obj->IsHeapObject());
SubRecord sub(kInstanceDump, this);
// object ID
sub.WriteObjectId(raw_obj);
« no previous file with comments | « runtime/vm/heap_profiler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698