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

Side by Side Diff: src/global-handles.cc

Issue 1287323002: [api] Do not force external GCs when only trying to synchronously process phantom callbacks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: forced flag still forced synchronous processing 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 unified diff | Download patch
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/global-handles.h" 8 #include "src/global-handles.h"
9 9
10 #include "src/vm-state-inl.h" 10 #include "src/vm-state-inl.h"
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 876
877 int GlobalHandles::PostGarbageCollectionProcessing( 877 int GlobalHandles::PostGarbageCollectionProcessing(
878 GarbageCollector collector, const v8::GCCallbackFlags gc_callback_flags) { 878 GarbageCollector collector, const v8::GCCallbackFlags gc_callback_flags) {
879 // Process weak global handle callbacks. This must be done after the 879 // Process weak global handle callbacks. This must be done after the
880 // GC is completely done, because the callbacks may invoke arbitrary 880 // GC is completely done, because the callbacks may invoke arbitrary
881 // API functions. 881 // API functions.
882 DCHECK(isolate_->heap()->gc_state() == Heap::NOT_IN_GC); 882 DCHECK(isolate_->heap()->gc_state() == Heap::NOT_IN_GC);
883 const int initial_post_gc_processing_count = ++post_gc_processing_count_; 883 const int initial_post_gc_processing_count = ++post_gc_processing_count_;
884 int freed_nodes = 0; 884 int freed_nodes = 0;
885 bool synchronous_second_pass = 885 bool synchronous_second_pass =
886 (gc_callback_flags & kGCCallbackFlagForced) != 0; 886 (gc_callback_flags &
887 (kGCCallbackFlagForced |
888 kGCCallbackFlagSynchronousPhantomCallbackProcessing)) != 0;
887 freed_nodes += DispatchPendingPhantomCallbacks(synchronous_second_pass); 889 freed_nodes += DispatchPendingPhantomCallbacks(synchronous_second_pass);
888 if (initial_post_gc_processing_count != post_gc_processing_count_) { 890 if (initial_post_gc_processing_count != post_gc_processing_count_) {
889 // If the callbacks caused a nested GC, then return. See comment in 891 // If the callbacks caused a nested GC, then return. See comment in
890 // PostScavengeProcessing. 892 // PostScavengeProcessing.
891 return freed_nodes; 893 return freed_nodes;
892 } 894 }
893 if (collector == SCAVENGER) { 895 if (collector == SCAVENGER) {
894 freed_nodes += PostScavengeProcessing(initial_post_gc_processing_count); 896 freed_nodes += PostScavengeProcessing(initial_post_gc_processing_count);
895 } else { 897 } else {
896 freed_nodes += PostMarkSweepProcessing(initial_post_gc_processing_count); 898 freed_nodes += PostMarkSweepProcessing(initial_post_gc_processing_count);
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 blocks_[block][offset] = object; 1267 blocks_[block][offset] = object;
1266 if (isolate->heap()->InNewSpace(object)) { 1268 if (isolate->heap()->InNewSpace(object)) {
1267 new_space_indices_.Add(size_); 1269 new_space_indices_.Add(size_);
1268 } 1270 }
1269 *index = size_++; 1271 *index = size_++;
1270 } 1272 }
1271 1273
1272 1274
1273 } // namespace internal 1275 } // namespace internal
1274 } // namespace v8 1276 } // namespace v8
OLDNEW
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698