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 1762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1773 if (heap_ != NULL) { | 1773 if (heap_ != NULL) { |
1774 PageSpace* old_space = heap_->old_space(); | 1774 PageSpace* old_space = heap_->old_space(); |
1775 MonitorLocker ml(old_space->tasks_lock()); | 1775 MonitorLocker ml(old_space->tasks_lock()); |
1776 ASSERT(old_space->tasks() == 0); | 1776 ASSERT(old_space->tasks() == 0); |
1777 } | 1777 } |
1778 #endif | 1778 #endif |
1779 | 1779 |
1780 // TODO(5411455): For now just make sure there are no current isolates | 1780 // TODO(5411455): For now just make sure there are no current isolates |
1781 // as we are shutting down the isolate. | 1781 // as we are shutting down the isolate. |
1782 Thread::ExitIsolate(); | 1782 Thread::ExitIsolate(); |
| 1783 |
| 1784 Dart_IsolateCleanupCallback cleanup = Isolate::CleanupCallback(); |
| 1785 if (cleanup != NULL) { |
| 1786 cleanup(init_callback_data()); |
| 1787 } |
1783 } | 1788 } |
1784 | 1789 |
1785 | 1790 |
1786 Dart_IsolateCreateCallback Isolate::create_callback_ = NULL; | 1791 Dart_IsolateCreateCallback Isolate::create_callback_ = NULL; |
1787 Dart_IsolateShutdownCallback Isolate::shutdown_callback_ = NULL; | 1792 Dart_IsolateShutdownCallback Isolate::shutdown_callback_ = NULL; |
| 1793 Dart_IsolateCleanupCallback Isolate::cleanup_callback_ = NULL; |
1788 | 1794 |
1789 Monitor* Isolate::isolates_list_monitor_ = NULL; | 1795 Monitor* Isolate::isolates_list_monitor_ = NULL; |
1790 Isolate* Isolate::isolates_list_head_ = NULL; | 1796 Isolate* Isolate::isolates_list_head_ = NULL; |
1791 bool Isolate::creation_enabled_ = false; | 1797 bool Isolate::creation_enabled_ = false; |
1792 | 1798 |
1793 void Isolate::IterateObjectPointers(ObjectPointerVisitor* visitor, | 1799 void Isolate::IterateObjectPointers(ObjectPointerVisitor* visitor, |
1794 bool validate_frames) { | 1800 bool validate_frames) { |
1795 HeapIterationScope heap_iteration_scope; | 1801 HeapIterationScope heap_iteration_scope; |
1796 VisitObjectPointers(visitor, validate_frames); | 1802 VisitObjectPointers(visitor, validate_frames); |
1797 } | 1803 } |
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2944 void IsolateSpawnState::DecrementSpawnCount() { | 2950 void IsolateSpawnState::DecrementSpawnCount() { |
2945 ASSERT(spawn_count_monitor_ != NULL); | 2951 ASSERT(spawn_count_monitor_ != NULL); |
2946 ASSERT(spawn_count_ != NULL); | 2952 ASSERT(spawn_count_ != NULL); |
2947 MonitorLocker ml(spawn_count_monitor_); | 2953 MonitorLocker ml(spawn_count_monitor_); |
2948 ASSERT(*spawn_count_ > 0); | 2954 ASSERT(*spawn_count_ > 0); |
2949 *spawn_count_ = *spawn_count_ - 1; | 2955 *spawn_count_ = *spawn_count_ - 1; |
2950 ml.Notify(); | 2956 ml.Notify(); |
2951 } | 2957 } |
2952 | 2958 |
2953 } // namespace dart | 2959 } // namespace dart |
OLD | NEW |