| 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 | 762 |
| 763 #if defined(DEBUG) | 763 #if defined(DEBUG) |
| 764 #define REUSABLE_HANDLE_SCOPE_INIT(object) \ | 764 #define REUSABLE_HANDLE_SCOPE_INIT(object) \ |
| 765 reusable_##object##_handle_scope_active_(false), | 765 reusable_##object##_handle_scope_active_(false), |
| 766 #else | 766 #else |
| 767 #define REUSABLE_HANDLE_SCOPE_INIT(object) | 767 #define REUSABLE_HANDLE_SCOPE_INIT(object) |
| 768 #endif // defined(DEBUG) | 768 #endif // defined(DEBUG) |
| 769 | 769 |
| 770 #define REUSABLE_HANDLE_INITIALIZERS(object) object##_handle_(NULL), | 770 #define REUSABLE_HANDLE_INITIALIZERS(object) object##_handle_(NULL), |
| 771 | 771 |
| 772 | |
| 773 static void FreeCatchEntryState(CatchEntryState* state) { | |
| 774 delete state->data; | |
| 775 } | |
| 776 | |
| 777 | |
| 778 // TODO(srdjan): Some Isolate monitors can be shared. Replace their usage with | 772 // TODO(srdjan): Some Isolate monitors can be shared. Replace their usage with |
| 779 // that shared monitor. | 773 // that shared monitor. |
| 780 Isolate::Isolate(const Dart_IsolateFlags& api_flags) | 774 Isolate::Isolate(const Dart_IsolateFlags& api_flags) |
| 781 : store_buffer_(new StoreBuffer()), | 775 : store_buffer_(new StoreBuffer()), |
| 782 heap_(NULL), | 776 heap_(NULL), |
| 783 user_tag_(0), | 777 user_tag_(0), |
| 784 current_tag_(UserTag::null()), | 778 current_tag_(UserTag::null()), |
| 785 default_tag_(UserTag::null()), | 779 default_tag_(UserTag::null()), |
| 786 object_store_(NULL), | 780 object_store_(NULL), |
| 787 class_table_(), | 781 class_table_(), |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 #define ISOLATE_METRIC_CONSTRUCTORS(type, variable, name, unit) \ | 839 #define ISOLATE_METRIC_CONSTRUCTORS(type, variable, name, unit) \ |
| 846 metric_##variable##_(), | 840 metric_##variable##_(), |
| 847 ISOLATE_METRIC_LIST(ISOLATE_METRIC_CONSTRUCTORS) | 841 ISOLATE_METRIC_LIST(ISOLATE_METRIC_CONSTRUCTORS) |
| 848 #undef ISOLATE_METRIC_CONSTRUCTORS | 842 #undef ISOLATE_METRIC_CONSTRUCTORS |
| 849 has_attempted_reload_(false), | 843 has_attempted_reload_(false), |
| 850 no_reload_scope_depth_(0), | 844 no_reload_scope_depth_(0), |
| 851 reload_every_n_stack_overflow_checks_(FLAG_reload_every), | 845 reload_every_n_stack_overflow_checks_(FLAG_reload_every), |
| 852 reload_context_(NULL), | 846 reload_context_(NULL), |
| 853 last_reload_timestamp_(OS::GetCurrentTimeMillis()), | 847 last_reload_timestamp_(OS::GetCurrentTimeMillis()), |
| 854 should_pause_post_service_request_(false), | 848 should_pause_post_service_request_(false), |
| 855 handler_info_cache_(), | 849 handler_info_cache_() { |
| 856 catch_entry_state_cache_(FreeCatchEntryState) { | |
| 857 NOT_IN_PRODUCT(FlagsCopyFrom(api_flags)); | 850 NOT_IN_PRODUCT(FlagsCopyFrom(api_flags)); |
| 858 // TODO(asiva): A Thread is not available here, need to figure out | 851 // TODO(asiva): A Thread is not available here, need to figure out |
| 859 // how the vm_tag (kEmbedderTagId) can be set, these tags need to | 852 // how the vm_tag (kEmbedderTagId) can be set, these tags need to |
| 860 // move to the OSThread structure. | 853 // move to the OSThread structure. |
| 861 set_user_tag(UserTags::kDefaultUserTag); | 854 set_user_tag(UserTags::kDefaultUserTag); |
| 862 } | 855 } |
| 863 | 856 |
| 864 #undef REUSABLE_HANDLE_SCOPE_INIT | 857 #undef REUSABLE_HANDLE_SCOPE_INIT |
| 865 #undef REUSABLE_HANDLE_INITIALIZERS | 858 #undef REUSABLE_HANDLE_INITIALIZERS |
| 866 | 859 |
| (...skipping 2089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2956 void IsolateSpawnState::DecrementSpawnCount() { | 2949 void IsolateSpawnState::DecrementSpawnCount() { |
| 2957 ASSERT(spawn_count_monitor_ != NULL); | 2950 ASSERT(spawn_count_monitor_ != NULL); |
| 2958 ASSERT(spawn_count_ != NULL); | 2951 ASSERT(spawn_count_ != NULL); |
| 2959 MonitorLocker ml(spawn_count_monitor_); | 2952 MonitorLocker ml(spawn_count_monitor_); |
| 2960 ASSERT(*spawn_count_ > 0); | 2953 ASSERT(*spawn_count_ > 0); |
| 2961 *spawn_count_ = *spawn_count_ - 1; | 2954 *spawn_count_ = *spawn_count_ - 1; |
| 2962 ml.Notify(); | 2955 ml.Notify(); |
| 2963 } | 2956 } |
| 2964 | 2957 |
| 2965 } // namespace dart | 2958 } // namespace dart |
| OLD | NEW |