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

Unified Diff: src/objects-debug.cc

Issue 2090983002: Revert of Reland [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
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-debug.cc
diff --git a/src/objects-debug.cc b/src/objects-debug.cc
index caba887e3c6ccaebfbb7c278231ad69ad6c47ebb..0c92f2093247e8940353efa8b9f283ff753ff9d2 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -701,25 +701,11 @@
CHECK(map->dependent_code()->Contains(DependentCode::kWeakCodeGroup,
cell));
} else if (obj->IsJSObject()) {
- 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);
- }
+ 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));
}
}
}
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698