| 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 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 ic_miss_code_(Code::null()), | 747 ic_miss_code_(Code::null()), |
| 748 object_store_(NULL), | 748 object_store_(NULL), |
| 749 class_table_(), | 749 class_table_(), |
| 750 single_step_(false), | 750 single_step_(false), |
| 751 errors_fatal_(true), | 751 errors_fatal_(true), |
| 752 is_runnable_(false), | 752 is_runnable_(false), |
| 753 is_service_isolate_(false), | 753 is_service_isolate_(false), |
| 754 compilation_allowed_(true), | 754 compilation_allowed_(true), |
| 755 all_classes_finalized_(false), | 755 all_classes_finalized_(false), |
| 756 remapping_cids_(false), | 756 remapping_cids_(false), |
| 757 start_time_micros_(OS::GetCurrentMonotonicMicros()), |
| 757 #if !defined(PRODUCT) | 758 #if !defined(PRODUCT) |
| 758 resume_request_(false), | 759 resume_request_(false), |
| 759 has_attempted_reload_(false), | 760 has_attempted_reload_(false), |
| 760 should_pause_post_service_request_(false), | 761 should_pause_post_service_request_(false), |
| 761 debugger_name_(NULL), | 762 debugger_name_(NULL), |
| 762 start_time_micros_(OS::GetCurrentMonotonicMicros()), | |
| 763 debugger_(NULL), | 763 debugger_(NULL), |
| 764 last_resume_timestamp_(OS::GetCurrentTimeMillis()), | 764 last_resume_timestamp_(OS::GetCurrentTimeMillis()), |
| 765 last_allocationprofile_accumulator_reset_timestamp_(0), | 765 last_allocationprofile_accumulator_reset_timestamp_(0), |
| 766 last_allocationprofile_gc_timestamp_(0), | 766 last_allocationprofile_gc_timestamp_(0), |
| 767 vm_tag_counters_(), | 767 vm_tag_counters_(), |
| 768 pending_service_extension_calls_(GrowableObjectArray::null()), | 768 pending_service_extension_calls_(GrowableObjectArray::null()), |
| 769 registered_service_extension_handlers_(GrowableObjectArray::null()), | 769 registered_service_extension_handlers_(GrowableObjectArray::null()), |
| 770 metrics_list_head_(NULL), | 770 metrics_list_head_(NULL), |
| 771 pause_loop_monitor_(NULL), | 771 pause_loop_monitor_(NULL), |
| 772 #define ISOLATE_METRIC_CONSTRUCTORS(type, variable, name, unit) \ | 772 #define ISOLATE_METRIC_CONSTRUCTORS(type, variable, name, unit) \ |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 if (mthread != NULL) { | 980 if (mthread != NULL) { |
| 981 mthread->ScheduleInterrupts(Thread::kMessageInterrupt); | 981 mthread->ScheduleInterrupts(Thread::kMessageInterrupt); |
| 982 } | 982 } |
| 983 } | 983 } |
| 984 | 984 |
| 985 #if !defined(PRODUCT) | 985 #if !defined(PRODUCT) |
| 986 void Isolate::set_debugger_name(const char* name) { | 986 void Isolate::set_debugger_name(const char* name) { |
| 987 free(debugger_name_); | 987 free(debugger_name_); |
| 988 debugger_name_ = strdup(name); | 988 debugger_name_ = strdup(name); |
| 989 } | 989 } |
| 990 #endif // !defined(PRODUCT) |
| 990 | 991 |
| 991 int64_t Isolate::UptimeMicros() const { | 992 int64_t Isolate::UptimeMicros() const { |
| 992 return OS::GetCurrentMonotonicMicros() - start_time_micros_; | 993 return OS::GetCurrentMonotonicMicros() - start_time_micros_; |
| 993 } | 994 } |
| 994 #endif // !defined(PRODUCT) | |
| 995 | 995 |
| 996 bool Isolate::IsPaused() const { | 996 bool Isolate::IsPaused() const { |
| 997 #if defined(PRODUCT) | 997 #if defined(PRODUCT) |
| 998 return false; | 998 return false; |
| 999 #else | 999 #else |
| 1000 return (debugger_ != NULL) && (debugger_->PauseEvent() != NULL); | 1000 return (debugger_ != NULL) && (debugger_->PauseEvent() != NULL); |
| 1001 #endif // !defined(PRODUCT) | 1001 #endif // !defined(PRODUCT) |
| 1002 } | 1002 } |
| 1003 | 1003 |
| 1004 RawError* Isolate::PausePostRequest() { | 1004 RawError* Isolate::PausePostRequest() { |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2853 void IsolateSpawnState::DecrementSpawnCount() { | 2853 void IsolateSpawnState::DecrementSpawnCount() { |
| 2854 ASSERT(spawn_count_monitor_ != NULL); | 2854 ASSERT(spawn_count_monitor_ != NULL); |
| 2855 ASSERT(spawn_count_ != NULL); | 2855 ASSERT(spawn_count_ != NULL); |
| 2856 MonitorLocker ml(spawn_count_monitor_); | 2856 MonitorLocker ml(spawn_count_monitor_); |
| 2857 ASSERT(*spawn_count_ > 0); | 2857 ASSERT(*spawn_count_ > 0); |
| 2858 *spawn_count_ = *spawn_count_ - 1; | 2858 *spawn_count_ = *spawn_count_ - 1; |
| 2859 ml.Notify(); | 2859 ml.Notify(); |
| 2860 } | 2860 } |
| 2861 | 2861 |
| 2862 } // namespace dart | 2862 } // namespace dart |
| OLD | NEW |