Index: src/handles.cc |
diff --git a/src/handles.cc b/src/handles.cc |
index 054dde38eb6ca149cfe7cbbf01c8acde9313c6f2..20fe116dde996afe8fd1a8b8ff4ce89c82c9cd76 100644 |
--- a/src/handles.cc |
+++ b/src/handles.cc |
@@ -881,4 +881,15 @@ DeferredHandles* DeferredHandleScope::Detach() { |
} |
+void AddWeakObjectToCodeDependency(Heap* heap, |
+ Handle<Object> object, |
+ Handle<Code> code) { |
+ heap->EnsureWeakObjectToCodeTable(); |
+ Handle<DependentCode> dep(heap->LookupWeakObjectToCodeDependency(*object)); |
+ dep = DependentCode::Insert(dep, DependentCode::kWeaklyEmbeddedGroup, code); |
+ CALL_HEAP_FUNCTION_VOID(heap->isolate(), |
+ heap->AddWeakObjectToCodeDependency(*object, *dep)); |
+} |
+ |
+ |
} } // namespace v8::internal |