| 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 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1161 MutexLocker ml(mutex_); | 1161 MutexLocker ml(mutex_); |
| 1162 // Check if we are in a valid state to make the isolate runnable. | 1162 // Check if we are in a valid state to make the isolate runnable. |
| 1163 if (is_runnable() == true) { | 1163 if (is_runnable() == true) { |
| 1164 return false; // Already runnable. | 1164 return false; // Already runnable. |
| 1165 } | 1165 } |
| 1166 // Set the isolate as runnable and if we are being spawned schedule | 1166 // Set the isolate as runnable and if we are being spawned schedule |
| 1167 // isolate on thread pool for execution. | 1167 // isolate on thread pool for execution. |
| 1168 ASSERT(object_store()->root_library() != Library::null()); | 1168 ASSERT(object_store()->root_library() != Library::null()); |
| 1169 set_is_runnable(true); | 1169 set_is_runnable(true); |
| 1170 #ifndef PRODUCT | 1170 #ifndef PRODUCT |
| 1171 if (FLAG_support_debugger && !ServiceIsolate::IsServiceIsolate(this)) { | 1171 if (FLAG_support_debugger) { |
| 1172 if (FLAG_pause_isolates_on_unhandled_exceptions) { | 1172 debugger()->WhenRunnable(); |
| 1173 if (FLAG_pause_isolates_on_unhandled_exceptions && |
| 1174 !ServiceIsolate::IsServiceIsolate(this)) { |
| 1173 debugger()->SetExceptionPauseInfo(kPauseOnUnhandledExceptions); | 1175 debugger()->SetExceptionPauseInfo(kPauseOnUnhandledExceptions); |
| 1174 } | 1176 } |
| 1175 } | 1177 } |
| 1176 #endif // !PRODUCT | 1178 #endif // !PRODUCT |
| 1177 IsolateSpawnState* state = spawn_state(); | 1179 IsolateSpawnState* state = spawn_state(); |
| 1178 if (state != NULL) { | 1180 if (state != NULL) { |
| 1179 ASSERT(this == state->isolate()); | 1181 ASSERT(this == state->isolate()); |
| 1180 Run(); | 1182 Run(); |
| 1181 } | 1183 } |
| 1182 #ifndef PRODUCT | 1184 #ifndef PRODUCT |
| (...skipping 1791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2974 void IsolateSpawnState::DecrementSpawnCount() { | 2976 void IsolateSpawnState::DecrementSpawnCount() { |
| 2975 ASSERT(spawn_count_monitor_ != NULL); | 2977 ASSERT(spawn_count_monitor_ != NULL); |
| 2976 ASSERT(spawn_count_ != NULL); | 2978 ASSERT(spawn_count_ != NULL); |
| 2977 MonitorLocker ml(spawn_count_monitor_); | 2979 MonitorLocker ml(spawn_count_monitor_); |
| 2978 ASSERT(*spawn_count_ > 0); | 2980 ASSERT(*spawn_count_ > 0); |
| 2979 *spawn_count_ = *spawn_count_ - 1; | 2981 *spawn_count_ = *spawn_count_ - 1; |
| 2980 ml.Notify(); | 2982 ml.Notify(); |
| 2981 } | 2983 } |
| 2982 | 2984 |
| 2983 } // namespace dart | 2985 } // namespace dart |
| OLD | NEW |