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

Unified Diff: src/objects-debug.cc

Issue 2045263002: [heap] Avoid the use of cells to point from code to new-space objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index 96da68778b52dff9ca1895333707d15fde2503ce..be072b1bde089401b7260e210fc6d00937613fe0 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -698,11 +698,25 @@ void Code::VerifyEmbeddedObjectsDependency() {
CHECK(map->dependent_code()->Contains(DependentCode::kWeakCodeGroup,
cell));
} else if (obj->IsJSObject()) {
- WeakHashTable* table =
- GetIsolate()->heap()->weak_object_to_code_table();
- Handle<HeapObject> key_obj(HeapObject::cast(obj), isolate);
- CHECK(DependentCode::cast(table->Lookup(key_obj))
- ->Contains(DependentCode::kWeakCodeGroup, cell));
+ if (isolate->heap()->InNewSpace(obj)) {
+ ArrayList* list =
+ GetIsolate()->heap()->weak_code_to_new_space_ref_list();
+ bool found = false;
+ for (int i = 0; i < list->Length(); i += 2) {
+ WeakCell* obj_cell = WeakCell::cast(list->Get(i));
+ if (!obj_cell->cleared() && obj_cell->value() == obj &&
+ WeakCell::cast(list->Get(i + 1)) == cell) {
+ found = true;
+ break;
+ }
+ }
+ CHECK(found);
+ } else {
+ Handle<HeapObject> key_obj(HeapObject::cast(obj), isolate);
+ DependentCode* dep =
+ GetIsolate()->heap()->LookupWeakObjectToCodeDependency(key_obj);
+ dep->Contains(DependentCode::kWeakCodeGroup, cell);
+ }
}
}
}
« src/heap/remembered-set.cc ('K') | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698