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

Unified Diff: src/global-handles.cc

Issue 1298113003: [api,heap] Fix external GC callbacks. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Got rid of too many V8::Type vs Isolate::Type casts Created 5 years, 4 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/api.cc ('k') | src/heap/heap.h » ('j') | src/heap/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « src/api.cc ('k') | src/heap/heap.h » ('j') | src/heap/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698