}
+void HeapSnapshot::RememberLastJSObjectId() {
+ max_snapshot_js_object_id_ = collection_->last_assigned_id();
+}
+
+
void HeapSnapshot::AllocateEntries(int entries_count,
int children_count,
int retainers_count) {
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;
}
// Pass 2. Fill references.
if (!FillReferences()) return false;
+ snapshot_->RememberLastJSObjectId();
+
if (!SetEntriesDominators()) return false;
if (!CalculateRetainedSizes()) return false;
HeapEntry* gc_subroot(int index) { return gc_subroot_entries_[index]; }
List<HeapEntry*>* entries() { return &entries_; }
size_t raw_entries_size() { return raw_entries_size_; }
+ void RememberLastJSObjectId();
SnapshotObjectId max_snapshot_js_object_id() const {
return max_snapshot_js_object_id_;
}
void SnapshotGenerationFinished();
SnapshotObjectId FindObject(Address addr);
void MoveObject(Address from, Address to);
+ SnapshotObjectId last_assigned_id() const {
+ return next_id_ - kObjectIdStep;
+ }
static SnapshotObjectId GenerateId(v8::RetainedObjectInfo* info);
static inline SnapshotObjectId GetNthGcSubrootId(int delta);
SnapshotObjectId GetObjectId(Address addr) { return ids_.FindObject(addr); }
Handle<HeapObject> FindHeapObjectById(SnapshotObjectId id);
void ObjectMoveEvent(Address from, Address to) { ids_.MoveObject(from, to); }
+ SnapshotObjectId last_assigned_id() const {
+ return ids_.last_assigned_id();
+ }
private:
INLINE(static bool HeapSnapshotsMatch(void* key1, void* key2)) {
const v8::HeapSnapshot* snapshot2 =
v8::HeapProfiler::TakeSnapshot(s2_str);
- // Second snapshot has one more string, it is it's name 's2'.
- CHECK(
- snapshot1->GetMaxSnapshotJSObjectId() <=
- snapshot2->GetMaxSnapshotJSObjectId() &&
- snapshot2->GetMaxSnapshotJSObjectId() <=
- snapshot1->GetMaxSnapshotJSObjectId() + i::HeapObjectsMap::kObjectIdStep);
+ CHECK(snapshot1->GetMaxSnapshotJSObjectId() > 7000);
+ CHECK(snapshot1->GetMaxSnapshotJSObjectId() <=
+ snapshot2->GetMaxSnapshotJSObjectId());
const v8::HeapGraphNode* global1 = GetGlobalObject(snapshot1);
const v8::HeapGraphNode* global2 = GetGlobalObject(snapshot2);