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

Unified Diff: src/profile-generator-inl.h

Issue 10353010: Split nodes and edges into separate arrays in heap profiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 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: src/profile-generator-inl.h
diff --git a/src/profile-generator-inl.h b/src/profile-generator-inl.h
index 284e2dfa361af19df6f6f8cf159dbb977d612922..70b9ef30c9e6d2b1ad8a8d0827d2d97c47cae0bc 100644
--- a/src/profile-generator-inl.h
+++ b/src/profile-generator-inl.h
@@ -96,8 +96,35 @@ CodeEntry* ProfileGenerator::EntryForVMState(StateTag tag) {
HeapEntry* HeapGraphEdge::from() const {
- return const_cast<HeapEntry*>(
- reinterpret_cast<const HeapEntry*>(this - child_index_) - 1);
+ return &snapshot()->entries()[from_];
+}
+
+
+HeapSnapshot* HeapGraphEdge::snapshot() const {
+ return to_entry_->snapshot();
+}
+
+
+int HeapEntry::index() const {
+ return this - &snapshot_->entries().first();
mnaganov (inactive) 2012/05/03 15:44:31 I'm not sure this will compile on all platforms. H
alexeif 2012/05/07 11:04:35 I'm not sure, as I don't have a Windows machine. I
+}
+
+
+HeapGraphEdge** HeapEntry::children_arr() {
+ ASSERT(children_index_ >= 0);
+ return &snapshot_->children()[children_index_];
+}
+
+
+HeapGraphEdge** HeapEntry::retainers_arr() {
+ ASSERT(retainers_index_ >= 0);
+ return &snapshot_->retainers()[retainers_index_];
+}
+
+
+HeapEntry* HeapEntry::dominator() const {
+ ASSERT(dominator_ >= 0);
+ return &snapshot_->entries()[dominator_];
}

Powered by Google App Engine
This is Rietveld 408576698