Index: src/global-handles.cc |
diff --git a/src/global-handles.cc b/src/global-handles.cc |
index fcf896fe5f5b766c409d96836078e34e257d8e3d..befa173767064e871062dcf36e7428fa590404ab 100644 |
--- a/src/global-handles.cc |
+++ b/src/global-handles.cc |
@@ -507,7 +507,11 @@ class GlobalHandles::PendingPhantomCallbacksSecondPassTask |
} |
void RunInternal() override { |
+ isolate_->heap()->CallGCPrologueCallbacks( |
+ GCType::kGCTypeProcessWeakCallbacks, kNoGCCallbackFlags); |
InvokeSecondPassPhantomCallbacks(&pending_phantom_callbacks_, isolate_); |
+ isolate_->heap()->CallGCEpilogueCallbacks( |
+ GCType::kGCTypeProcessWeakCallbacks, kNoGCCallbackFlags); |
} |
private: |
@@ -841,7 +845,11 @@ int GlobalHandles::DispatchPendingPhantomCallbacks( |
} |
if (pending_phantom_callbacks_.length() > 0) { |
if (FLAG_optimize_for_size || FLAG_predictable || synchronous_second_pass) { |
+ isolate()->heap()->CallGCPrologueCallbacks( |
+ GCType::kGCTypeProcessWeakCallbacks, kNoGCCallbackFlags); |
InvokeSecondPassPhantomCallbacks(&pending_phantom_callbacks_, isolate()); |
+ isolate()->heap()->CallGCEpilogueCallbacks( |
+ GCType::kGCTypeProcessWeakCallbacks, kNoGCCallbackFlags); |
} else { |
auto task = new PendingPhantomCallbacksSecondPassTask( |
&pending_phantom_callbacks_, isolate()); |