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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 for (auto i = pending_phantom_callbacks_.begin(); | 833 for (auto i = pending_phantom_callbacks_.begin(); |
834 i != pending_phantom_callbacks_.end(); ++i) { | 834 i != pending_phantom_callbacks_.end(); ++i) { |
835 auto callback = i; | 835 auto callback = i; |
836 // Skip callbacks that have already been processed once. | 836 // Skip callbacks that have already been processed once. |
837 if (callback->node() == nullptr) continue; | 837 if (callback->node() == nullptr) continue; |
838 callback->Invoke(isolate()); | 838 callback->Invoke(isolate()); |
839 freed_nodes++; | 839 freed_nodes++; |
840 } | 840 } |
841 } | 841 } |
842 if (pending_phantom_callbacks_.length() > 0) { | 842 if (pending_phantom_callbacks_.length() > 0) { |
843 if (synchronous_second_pass) { | 843 if (FLAG_optimize_for_size || FLAG_predictable || synchronous_second_pass) { |
844 InvokeSecondPassPhantomCallbacks(&pending_phantom_callbacks_, isolate()); | 844 InvokeSecondPassPhantomCallbacks(&pending_phantom_callbacks_, isolate()); |
845 } else { | 845 } else { |
846 auto task = new PendingPhantomCallbacksSecondPassTask( | 846 auto task = new PendingPhantomCallbacksSecondPassTask( |
847 &pending_phantom_callbacks_, isolate()); | 847 &pending_phantom_callbacks_, isolate()); |
848 V8::GetCurrentPlatform()->CallOnForegroundThread( | 848 V8::GetCurrentPlatform()->CallOnForegroundThread( |
849 reinterpret_cast<v8::Isolate*>(isolate()), task); | 849 reinterpret_cast<v8::Isolate*>(isolate()), task); |
850 } | 850 } |
851 } | 851 } |
852 pending_phantom_callbacks_.Clear(); | 852 pending_phantom_callbacks_.Clear(); |
853 return freed_nodes; | 853 return freed_nodes; |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1265 blocks_[block][offset] = object; | 1265 blocks_[block][offset] = object; |
1266 if (isolate->heap()->InNewSpace(object)) { | 1266 if (isolate->heap()->InNewSpace(object)) { |
1267 new_space_indices_.Add(size_); | 1267 new_space_indices_.Add(size_); |
1268 } | 1268 } |
1269 *index = size_++; | 1269 *index = size_++; |
1270 } | 1270 } |
1271 | 1271 |
1272 | 1272 |
1273 } // namespace internal | 1273 } // namespace internal |
1274 } // namespace v8 | 1274 } // namespace v8 |
OLD | NEW |