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