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

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

Issue 1769893002: Use v8::kGCCallbackFlagCollectAllAvailableGarbage in Heap::CollectAllAvailableGarbage (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | 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/global-handles.h" 5 #include "src/global-handles.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/v8.h" 8 #include "src/v8.h"
9 #include "src/vm-state-inl.h" 9 #include "src/vm-state-inl.h"
10 10
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 int GlobalHandles::PostGarbageCollectionProcessing( 977 int GlobalHandles::PostGarbageCollectionProcessing(
978 GarbageCollector collector, const v8::GCCallbackFlags gc_callback_flags) { 978 GarbageCollector collector, const v8::GCCallbackFlags gc_callback_flags) {
979 // Process weak global handle callbacks. This must be done after the 979 // Process weak global handle callbacks. This must be done after the
980 // GC is completely done, because the callbacks may invoke arbitrary 980 // GC is completely done, because the callbacks may invoke arbitrary
981 // API functions. 981 // API functions.
982 DCHECK(isolate_->heap()->gc_state() == Heap::NOT_IN_GC); 982 DCHECK(isolate_->heap()->gc_state() == Heap::NOT_IN_GC);
983 const int initial_post_gc_processing_count = ++post_gc_processing_count_; 983 const int initial_post_gc_processing_count = ++post_gc_processing_count_;
984 int freed_nodes = 0; 984 int freed_nodes = 0;
985 bool synchronous_second_pass = 985 bool synchronous_second_pass =
986 (gc_callback_flags & 986 (gc_callback_flags &
987 (kGCCallbackFlagForced | 987 (kGCCallbackFlagForced | kGCCallbackFlagCollectAllAvailableGarbage |
988 kGCCallbackFlagSynchronousPhantomCallbackProcessing)) != 0; 988 kGCCallbackFlagSynchronousPhantomCallbackProcessing)) != 0;
989 freed_nodes += DispatchPendingPhantomCallbacks(synchronous_second_pass); 989 freed_nodes += DispatchPendingPhantomCallbacks(synchronous_second_pass);
990 if (initial_post_gc_processing_count != post_gc_processing_count_) { 990 if (initial_post_gc_processing_count != post_gc_processing_count_) {
991 // If the callbacks caused a nested GC, then return. See comment in 991 // If the callbacks caused a nested GC, then return. See comment in
992 // PostScavengeProcessing. 992 // PostScavengeProcessing.
993 return freed_nodes; 993 return freed_nodes;
994 } 994 }
995 if (collector == SCAVENGER) { 995 if (collector == SCAVENGER) {
996 freed_nodes += PostScavengeProcessing(initial_post_gc_processing_count); 996 freed_nodes += PostScavengeProcessing(initial_post_gc_processing_count);
997 } else { 997 } else {
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 blocks_[block][offset] = object; 1377 blocks_[block][offset] = object;
1378 if (isolate->heap()->InNewSpace(object)) { 1378 if (isolate->heap()->InNewSpace(object)) {
1379 new_space_indices_.Add(size_); 1379 new_space_indices_.Add(size_);
1380 } 1380 }
1381 *index = size_++; 1381 *index = size_++;
1382 } 1382 }
1383 1383
1384 1384
1385 } // namespace internal 1385 } // namespace internal
1386 } // namespace v8 1386 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698