| 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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 #undef REUSABLE_HANDLE_SCOPE_INIT | 856 #undef REUSABLE_HANDLE_SCOPE_INIT |
| 857 #undef REUSABLE_HANDLE_INITIALIZERS | 857 #undef REUSABLE_HANDLE_INITIALIZERS |
| 858 | 858 |
| 859 Isolate::~Isolate() { | 859 Isolate::~Isolate() { |
| 860 free(name_); | 860 free(name_); |
| 861 free(debugger_name_); | 861 free(debugger_name_); |
| 862 delete store_buffer_; | 862 delete store_buffer_; |
| 863 delete heap_; | 863 delete heap_; |
| 864 delete object_store_; | 864 delete object_store_; |
| 865 delete api_state_; | 865 delete api_state_; |
| 866 #ifndef PRODUCT |
| 866 if (FLAG_support_debugger) { | 867 if (FLAG_support_debugger) { |
| 867 delete debugger_; | 868 delete debugger_; |
| 868 } | 869 } |
| 870 #endif // !PRODUCT |
| 869 #if defined(USING_SIMULATOR) | 871 #if defined(USING_SIMULATOR) |
| 870 delete simulator_; | 872 delete simulator_; |
| 871 #endif | 873 #endif |
| 872 delete mutex_; | 874 delete mutex_; |
| 873 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate. | 875 mutex_ = NULL; // Fail fast if interrupts are scheduled on a dead isolate. |
| 874 delete symbols_mutex_; | 876 delete symbols_mutex_; |
| 875 symbols_mutex_ = NULL; | 877 symbols_mutex_ = NULL; |
| 876 delete type_canonicalization_mutex_; | 878 delete type_canonicalization_mutex_; |
| 877 type_canonicalization_mutex_ = NULL; | 879 type_canonicalization_mutex_ = NULL; |
| 878 delete constant_canonicalization_mutex_; | 880 delete constant_canonicalization_mutex_; |
| 879 constant_canonicalization_mutex_ = NULL; | 881 constant_canonicalization_mutex_ = NULL; |
| 880 delete megamorphic_lookup_mutex_; | 882 delete megamorphic_lookup_mutex_; |
| 881 megamorphic_lookup_mutex_ = NULL; | 883 megamorphic_lookup_mutex_ = NULL; |
| 882 delete message_handler_; | 884 delete message_handler_; |
| 883 message_handler_ = NULL; // Fail fast if we send messages to a dead isolate. | 885 message_handler_ = NULL; // Fail fast if we send messages to a dead isolate. |
| 884 ASSERT(deopt_context_ == NULL); // No deopt in progress when isolate deleted. | 886 ASSERT(deopt_context_ == NULL); // No deopt in progress when isolate deleted. |
| 885 delete spawn_state_; | 887 delete spawn_state_; |
| 888 #ifndef PRODUCT |
| 886 if (FLAG_support_service) { | 889 if (FLAG_support_service) { |
| 887 delete object_id_ring_; | 890 delete object_id_ring_; |
| 888 } | 891 } |
| 892 #endif // !PRODUCT |
| 889 object_id_ring_ = NULL; | 893 object_id_ring_ = NULL; |
| 890 delete pause_loop_monitor_; | 894 delete pause_loop_monitor_; |
| 891 pause_loop_monitor_ = NULL; | 895 pause_loop_monitor_ = NULL; |
| 892 delete field_list_mutex_; | 896 delete field_list_mutex_; |
| 893 field_list_mutex_ = NULL; | 897 field_list_mutex_ = NULL; |
| 894 ASSERT(spawn_count_ == 0); | 898 ASSERT(spawn_count_ == 0); |
| 895 delete spawn_count_monitor_; | 899 delete spawn_count_monitor_; |
| 896 delete safepoint_handler_; | 900 delete safepoint_handler_; |
| 897 delete thread_registry_; | 901 delete thread_registry_; |
| 898 } | 902 } |
| (...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2863 void IsolateSpawnState::DecrementSpawnCount() { | 2867 void IsolateSpawnState::DecrementSpawnCount() { |
| 2864 ASSERT(spawn_count_monitor_ != NULL); | 2868 ASSERT(spawn_count_monitor_ != NULL); |
| 2865 ASSERT(spawn_count_ != NULL); | 2869 ASSERT(spawn_count_ != NULL); |
| 2866 MonitorLocker ml(spawn_count_monitor_); | 2870 MonitorLocker ml(spawn_count_monitor_); |
| 2867 ASSERT(*spawn_count_ > 0); | 2871 ASSERT(*spawn_count_ > 0); |
| 2868 *spawn_count_ = *spawn_count_ - 1; | 2872 *spawn_count_ = *spawn_count_ - 1; |
| 2869 ml.Notify(); | 2873 ml.Notify(); |
| 2870 } | 2874 } |
| 2871 | 2875 |
| 2872 } // namespace dart | 2876 } // namespace dart |
| OLD | NEW |