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

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: 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
« include/v8.h ('K') | « 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 kGCCallbackFlagSynchronousPhantomCallbackProcessing) != 0;
jochen (gone - plz use gerrit) 2015/08/13 15:26:14 if FlagForced is set, we also need to do the secon
Michael Lippautz 2015/08/13 16:33:15 Done.
887 freed_nodes += DispatchPendingPhantomCallbacks(synchronous_second_pass); 888 freed_nodes += DispatchPendingPhantomCallbacks(synchronous_second_pass);
888 if (initial_post_gc_processing_count != post_gc_processing_count_) { 889 if (initial_post_gc_processing_count != post_gc_processing_count_) {
889 // If the callbacks caused a nested GC, then return. See comment in 890 // If the callbacks caused a nested GC, then return. See comment in
890 // PostScavengeProcessing. 891 // PostScavengeProcessing.
891 return freed_nodes; 892 return freed_nodes;
892 } 893 }
893 if (collector == SCAVENGER) { 894 if (collector == SCAVENGER) {
894 freed_nodes += PostScavengeProcessing(initial_post_gc_processing_count); 895 freed_nodes += PostScavengeProcessing(initial_post_gc_processing_count);
895 } else { 896 } else {
896 freed_nodes += PostMarkSweepProcessing(initial_post_gc_processing_count); 897 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; 1266 blocks_[block][offset] = object;
1266 if (isolate->heap()->InNewSpace(object)) { 1267 if (isolate->heap()->InNewSpace(object)) {
1267 new_space_indices_.Add(size_); 1268 new_space_indices_.Add(size_);
1268 } 1269 }
1269 *index = size_++; 1270 *index = size_++;
1270 } 1271 }
1271 1272
1272 1273
1273 } // namespace internal 1274 } // namespace internal
1274 } // namespace v8 1275 } // namespace v8
OLDNEW
« include/v8.h ('K') | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698