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

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 d2e768f549a92066f472c8da52284cdd4eafa446..538ca1c871c49c44f93438fbe6839f857a31ed91 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_new_space_object_to_code_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);
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698