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

Unified Diff: src/global-handles.cc

Issue 1034473002: run phantom handle callbacks first (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
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 5bf18f5011758929470715e49e5228f4e75a0de7..0554c53bb5deca3d5458199a29793ced681fdb1b 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -856,6 +856,12 @@ int GlobalHandles::PostGarbageCollectionProcessing(GarbageCollector collector) {
DCHECK(isolate_->heap()->gc_state() == Heap::NOT_IN_GC);
const int initial_post_gc_processing_count = ++post_gc_processing_count_;
int freed_nodes = 0;
+ freed_nodes += DispatchPendingPhantomCallbacks();
+ if (initial_post_gc_processing_count != post_gc_processing_count_) {
+ // If the callbacks caused a nested GC, then return. See comment in
+ // PostScavengeProcessing.
+ return freed_nodes;
+ }
if (collector == SCAVENGER) {
freed_nodes = PostScavengeProcessing(initial_post_gc_processing_count);
} else {
@@ -866,7 +872,6 @@ int GlobalHandles::PostGarbageCollectionProcessing(GarbageCollector collector) {
// PostScavengeProcessing.
return freed_nodes;
}
- freed_nodes += DispatchPendingPhantomCallbacks();
if (initial_post_gc_processing_count == post_gc_processing_count_) {
UpdateListOfNewSpaceNodes();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698