Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 0a594e77ee3eb95dff3789ed5fb211d54dc7d152..b0335d0efdd5da06accdc84acf018f626cf8fd66 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -6886,6 +6886,9 @@ MaybeObject* Heap::AddWeakObjectToCodeDependency(Object* obj, |
WeakHashTable::cast(weak_object_to_code_table_)->Put(obj, dep); |
WeakHashTable* table; |
if (!maybe_obj->To(&table)) return maybe_obj; |
+ if (ShouldZapGarbage() && weak_object_to_code_table_ != table) { |
+ WeakHashTable::cast(weak_object_to_code_table_)->Zap(the_hole_value()); |
+ } |
set_weak_object_to_code_table(table); |
ASSERT_EQ(dep, WeakHashTable::cast(weak_object_to_code_table_)->Lookup(obj)); |
return weak_object_to_code_table_; |