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

Unified Diff: src/objects-debug.cc

Issue 871253005: Use weak cells in dependent code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 5 years, 10 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.cc ('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 059406e3dc21193be8ae9d5ba7be6d75d9ab5564..4211bc5ca49a7131d54ecd7f0c689008ad47d561 100644
--- a/src/objects-debug.cc
+++ b/src/objects-debug.cc
@@ -677,6 +677,7 @@ void Code::CodeVerify() {
void Code::VerifyEmbeddedObjectsDependency() {
if (!CanContainWeakObjects()) return;
+ WeakCell* cell = CachedWeakCell();
DisallowHeapAllocation no_gc;
Isolate* isolate = GetIsolate();
HandleScope scope(isolate);
@@ -687,13 +688,13 @@ void Code::VerifyEmbeddedObjectsDependency() {
if (obj->IsMap()) {
Map* map = Map::cast(obj);
CHECK(map->dependent_code()->Contains(DependentCode::kWeakCodeGroup,
- this));
+ cell));
} else if (obj->IsJSObject()) {
- Object* raw_table = GetIsolate()->heap()->weak_object_to_code_table();
- WeakHashTable* table = WeakHashTable::cast(raw_table);
- Handle<Object> key_obj(obj, isolate);
- CHECK(DependentCode::cast(table->Lookup(key_obj))->Contains(
- DependentCode::kWeakCodeGroup, this));
+ 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.cc ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698