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

Unified Diff: src/profile-generator.cc

Issue 9918005: Current schema of calculation max_snapshot_js_object_id is not always correct. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index acab8a092f1a81d999af7bc94160bb057d14d4dd..2abf9a37fb873bdcb5846314a0a4cf9bf49c8b7a 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -1158,6 +1158,11 @@ void HeapSnapshot::Delete() {
}
+void HeapSnapshot::RememberLastSnapshotJSObjectId() {
mnaganov (inactive) 2012/03/29 12:12:17 I think, the word 'Snapshot' in the method name is
+ max_snapshot_js_object_id_ = collection_->max_snapshot_js_object_id();
+}
+
+
void HeapSnapshot::AllocateEntries(int entries_count,
int children_count,
int retainers_count) {
@@ -1224,11 +1229,6 @@ HeapEntry* HeapSnapshot::AddEntry(HeapEntry::Type type,
int retainers_count) {
HeapEntry* entry = GetNextEntryToInit();
entry->Init(this, type, name, id, size, children_count, retainers_count);
-
- // Track only js objects. They have odd ids.
- if (id % HeapObjectsMap::kObjectIdStep && id > max_snapshot_js_object_id_)
- max_snapshot_js_object_id_ = id;
-
return entry;
}
@@ -3163,9 +3163,11 @@ bool HeapSnapshotGenerator::FillReferences() {
// layout and affecting retainer counts. This is not acceptable because
// number of retainers must not change between count and fill passes.
// To avoid this there's a separate postpass that set object names.
- return v8_heap_explorer_.IterateAndExtractReferences(&filler)
+ bool result = v8_heap_explorer_.IterateAndExtractReferences(&filler)
&& dom_explorer_.IterateAndExtractReferences(&filler)
&& v8_heap_explorer_.IterateAndSetObjectNames(&filler);
+ snapshot_->RememberLastSnapshotJSObjectId();
mnaganov (inactive) 2012/03/29 12:12:17 I would place this call into GenerateSnapshot. Hav
+ return result;
}

Powered by Google App Engine
This is Rietveld 408576698