}
void VisitPointers(Object** start, Object** end) {
for (Object** p = start; p < end; p++) {
+ ++next_index_;
if (CheckVisitedAndUnmark(p)) continue;
- generator_->SetHiddenReference(parent_obj_, parent_, next_index_++, *p);
+ generator_->SetHiddenReference(parent_obj_, parent_, next_index_, *p);
}
}
static void MarkVisitedField(HeapObject* obj, int offset) {
SetInternalReference(code, entry,
"constant_pool", code->constant_pool(),
Code::kConstantPoolOffset);
+ if (code->kind() == Code::OPTIMIZED_FUNCTION) {
+ SetWeakReference(code, entry,
+ "next_code_link", code->next_code_link(),
+ Code::kNextCodeLinkOffset);
+ }
}
AllocationSite::kTransitionInfoOffset);
SetInternalReference(site, entry, "nested_site", site->nested_site(),
AllocationSite::kNestedSiteOffset);
- SetInternalReference(site, entry, "pretenure_data",
- site->pretenure_data(),
- AllocationSite::kPretenureDataOffset);
- SetInternalReference(site, entry, "pretenure_create_count",
- site->pretenure_create_count(),
- AllocationSite::kPretenureCreateCountOffset);
SetInternalReference(site, entry, "dependent_code", site->dependent_code(),
AllocationSite::kDependentCodeOffset);
+ // Do not visit weak_next as it is not visited by the StaticVisitor,
+ // and we're not very interested in weak_next field here.
+ STATIC_CHECK(AllocationSite::kWeakNextOffset >=
+ AllocationSite::BodyDescriptor::kEndOffset);
}
GetProperty(lazy, v8::HeapGraphEdge::kInternal, "shared");
CHECK_NE(NULL, lazy_code);
+ // Check that there's no strong next_code_link. There might be a weak one
+ // but might be not, so we can't check that fact.
+ const v8::HeapGraphNode* code =
+ GetProperty(compiled_code, v8::HeapGraphEdge::kInternal, "code");
+ CHECK_NE(NULL, code);
+ const v8::HeapGraphNode* next_code_link =
+ GetProperty(code, v8::HeapGraphEdge::kInternal, "code");
+ CHECK_EQ(NULL, next_code_link);
+
// Verify that non-compiled code doesn't contain references to "x"
// literal, while compiled code does. The scope info is stored in FixedArray
// objects attached to the SharedFunctionInfo.