OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |