| 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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 | 1123 |
| 1124 MutexLocker ml(mutex_); | 1124 MutexLocker ml(mutex_); |
| 1125 // Check if we are in a valid state to make the isolate runnable. | 1125 // Check if we are in a valid state to make the isolate runnable. |
| 1126 if (is_runnable() == true) { | 1126 if (is_runnable() == true) { |
| 1127 return false; // Already runnable. | 1127 return false; // Already runnable. |
| 1128 } | 1128 } |
| 1129 // Set the isolate as runnable and if we are being spawned schedule | 1129 // Set the isolate as runnable and if we are being spawned schedule |
| 1130 // isolate on thread pool for execution. | 1130 // isolate on thread pool for execution. |
| 1131 ASSERT(object_store()->root_library() != Library::null()); | 1131 ASSERT(object_store()->root_library() != Library::null()); |
| 1132 set_is_runnable(true); | 1132 set_is_runnable(true); |
| 1133 #ifndef PRODUCT |
| 1133 if (FLAG_support_debugger && !ServiceIsolate::IsServiceIsolate(this)) { | 1134 if (FLAG_support_debugger && !ServiceIsolate::IsServiceIsolate(this)) { |
| 1134 if (FLAG_pause_isolates_on_unhandled_exceptions) { | 1135 if (FLAG_pause_isolates_on_unhandled_exceptions) { |
| 1135 debugger()->SetExceptionPauseInfo(kPauseOnUnhandledExceptions); | 1136 debugger()->SetExceptionPauseInfo(kPauseOnUnhandledExceptions); |
| 1136 } | 1137 } |
| 1137 } | 1138 } |
| 1139 #endif // !PRODUCT |
| 1138 IsolateSpawnState* state = spawn_state(); | 1140 IsolateSpawnState* state = spawn_state(); |
| 1139 if (state != NULL) { | 1141 if (state != NULL) { |
| 1140 ASSERT(this == state->isolate()); | 1142 ASSERT(this == state->isolate()); |
| 1141 Run(); | 1143 Run(); |
| 1142 } | 1144 } |
| 1143 #ifndef PRODUCT | 1145 #ifndef PRODUCT |
| 1144 if (FLAG_support_timeline) { | 1146 if (FLAG_support_timeline) { |
| 1145 TimelineStream* stream = Timeline::GetIsolateStream(); | 1147 TimelineStream* stream = Timeline::GetIsolateStream(); |
| 1146 ASSERT(stream != NULL); | 1148 ASSERT(stream != NULL); |
| 1147 TimelineEvent* event = stream->StartEvent(); | 1149 TimelineEvent* event = stream->StartEvent(); |
| (...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2861 void IsolateSpawnState::DecrementSpawnCount() { | 2863 void IsolateSpawnState::DecrementSpawnCount() { |
| 2862 ASSERT(spawn_count_monitor_ != NULL); | 2864 ASSERT(spawn_count_monitor_ != NULL); |
| 2863 ASSERT(spawn_count_ != NULL); | 2865 ASSERT(spawn_count_ != NULL); |
| 2864 MonitorLocker ml(spawn_count_monitor_); | 2866 MonitorLocker ml(spawn_count_monitor_); |
| 2865 ASSERT(*spawn_count_ > 0); | 2867 ASSERT(*spawn_count_ > 0); |
| 2866 *spawn_count_ = *spawn_count_ - 1; | 2868 *spawn_count_ = *spawn_count_ - 1; |
| 2867 ml.Notify(); | 2869 ml.Notify(); |
| 2868 } | 2870 } |
| 2869 | 2871 |
| 2870 } // namespace dart | 2872 } // namespace dart |
| OLD | NEW |