OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/isolate.h" | 5 #include "vm/isolate.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/text_buffer.h" | 10 #include "platform/text_buffer.h" |
(...skipping 1772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 Isolate* Isolate::isolates_list_head_ = NULL; | 1783 Isolate* Isolate::isolates_list_head_ = NULL; |
1784 bool Isolate::creation_enabled_ = false; | 1784 bool Isolate::creation_enabled_ = false; |
1785 | 1785 |
1786 void Isolate::IterateObjectPointers(ObjectPointerVisitor* visitor, | 1786 void Isolate::IterateObjectPointers(ObjectPointerVisitor* visitor, |
1787 bool validate_frames) { | 1787 bool validate_frames) { |
1788 HeapIterationScope heap_iteration_scope; | 1788 HeapIterationScope heap_iteration_scope; |
1789 VisitObjectPointers(visitor, validate_frames); | 1789 VisitObjectPointers(visitor, validate_frames); |
1790 } | 1790 } |
1791 | 1791 |
1792 | 1792 |
| 1793 void Isolate::IterateStackPointers(ObjectPointerVisitor* visitor, |
| 1794 bool validate_frames) { |
| 1795 HeapIterationScope heap_iteration_scope; |
| 1796 VisitStackPointers(visitor, validate_frames); |
| 1797 } |
| 1798 |
| 1799 |
1793 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, | 1800 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, |
1794 bool validate_frames) { | 1801 bool validate_frames) { |
1795 ASSERT(visitor != NULL); | 1802 ASSERT(visitor != NULL); |
1796 | 1803 |
1797 // Visit objects in the object store. | 1804 // Visit objects in the object store. |
1798 object_store()->VisitObjectPointers(visitor); | 1805 object_store()->VisitObjectPointers(visitor); |
1799 | 1806 |
1800 // Visit objects in the class table. | 1807 // Visit objects in the class table. |
1801 class_table()->VisitObjectPointers(visitor); | 1808 class_table()->VisitObjectPointers(visitor); |
1802 | 1809 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 if (ServiceIsolate::IsServiceIsolate(this)) { | 1861 if (ServiceIsolate::IsServiceIsolate(this)) { |
1855 ServiceIsolate::VisitObjectPointers(visitor); | 1862 ServiceIsolate::VisitObjectPointers(visitor); |
1856 } | 1863 } |
1857 #endif // !defined(PRODUCT) | 1864 #endif // !defined(PRODUCT) |
1858 | 1865 |
1859 // Visit objects that are being used for deoptimization. | 1866 // Visit objects that are being used for deoptimization. |
1860 if (deopt_context() != NULL) { | 1867 if (deopt_context() != NULL) { |
1861 deopt_context()->VisitObjectPointers(visitor); | 1868 deopt_context()->VisitObjectPointers(visitor); |
1862 } | 1869 } |
1863 | 1870 |
| 1871 VisitStackPointers(visitor, validate_frames); |
| 1872 } |
| 1873 |
| 1874 |
| 1875 void Isolate::VisitStackPointers(ObjectPointerVisitor* visitor, |
| 1876 bool validate_frames) { |
1864 // Visit objects in all threads (e.g., Dart stack, handles in zones). | 1877 // Visit objects in all threads (e.g., Dart stack, handles in zones). |
1865 thread_registry()->VisitObjectPointers(visitor, validate_frames); | 1878 thread_registry()->VisitObjectPointers(visitor, validate_frames); |
1866 } | 1879 } |
1867 | 1880 |
1868 | 1881 |
1869 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor) { | 1882 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor) { |
1870 if (api_state() != NULL) { | 1883 if (api_state() != NULL) { |
1871 api_state()->VisitWeakHandles(visitor); | 1884 api_state()->VisitWeakHandles(visitor); |
1872 } | 1885 } |
1873 } | 1886 } |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2921 void IsolateSpawnState::DecrementSpawnCount() { | 2934 void IsolateSpawnState::DecrementSpawnCount() { |
2922 ASSERT(spawn_count_monitor_ != NULL); | 2935 ASSERT(spawn_count_monitor_ != NULL); |
2923 ASSERT(spawn_count_ != NULL); | 2936 ASSERT(spawn_count_ != NULL); |
2924 MonitorLocker ml(spawn_count_monitor_); | 2937 MonitorLocker ml(spawn_count_monitor_); |
2925 ASSERT(*spawn_count_ > 0); | 2938 ASSERT(*spawn_count_ > 0); |
2926 *spawn_count_ = *spawn_count_ - 1; | 2939 *spawn_count_ = *spawn_count_ - 1; |
2927 ml.Notify(); | 2940 ml.Notify(); |
2928 } | 2941 } |
2929 | 2942 |
2930 } // namespace dart | 2943 } // namespace dart |
OLD | NEW |