| 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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 MutexLocker ml(mutex_); | 1131 MutexLocker ml(mutex_); |
| 1132 // Check if we are in a valid state to make the isolate runnable. | 1132 // Check if we are in a valid state to make the isolate runnable. |
| 1133 if (is_runnable() == true) { | 1133 if (is_runnable() == true) { |
| 1134 return false; // Already runnable. | 1134 return false; // Already runnable. |
| 1135 } | 1135 } |
| 1136 // Set the isolate as runnable and if we are being spawned schedule | 1136 // Set the isolate as runnable and if we are being spawned schedule |
| 1137 // isolate on thread pool for execution. | 1137 // isolate on thread pool for execution. |
| 1138 ASSERT(object_store()->root_library() != Library::null()); | 1138 ASSERT(object_store()->root_library() != Library::null()); |
| 1139 set_is_runnable(true); | 1139 set_is_runnable(true); |
| 1140 #ifndef PRODUCT | 1140 #ifndef PRODUCT |
| 1141 if (FLAG_support_debugger && !ServiceIsolate::IsServiceIsolate(this)) { | 1141 if (FLAG_support_debugger) { |
| 1142 if (FLAG_pause_isolates_on_unhandled_exceptions) { | 1142 if (!ServiceIsolate::IsServiceIsolate(this)) { |
| 1143 debugger()->SetExceptionPauseInfo(kPauseOnUnhandledExceptions); | 1143 debugger()->OnIsolateRunnable(); |
| 1144 if (FLAG_pause_isolates_on_unhandled_exceptions) { |
| 1145 debugger()->SetExceptionPauseInfo(kPauseOnUnhandledExceptions); |
| 1146 } |
| 1144 } | 1147 } |
| 1145 } | 1148 } |
| 1146 #endif // !PRODUCT | 1149 #endif // !PRODUCT |
| 1147 IsolateSpawnState* state = spawn_state(); | 1150 IsolateSpawnState* state = spawn_state(); |
| 1148 if (state != NULL) { | 1151 if (state != NULL) { |
| 1149 ASSERT(this == state->isolate()); | 1152 ASSERT(this == state->isolate()); |
| 1150 Run(); | 1153 Run(); |
| 1151 } | 1154 } |
| 1152 #ifndef PRODUCT | 1155 #ifndef PRODUCT |
| 1153 if (FLAG_support_timeline) { | 1156 if (FLAG_support_timeline) { |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2944 void IsolateSpawnState::DecrementSpawnCount() { | 2947 void IsolateSpawnState::DecrementSpawnCount() { |
| 2945 ASSERT(spawn_count_monitor_ != NULL); | 2948 ASSERT(spawn_count_monitor_ != NULL); |
| 2946 ASSERT(spawn_count_ != NULL); | 2949 ASSERT(spawn_count_ != NULL); |
| 2947 MonitorLocker ml(spawn_count_monitor_); | 2950 MonitorLocker ml(spawn_count_monitor_); |
| 2948 ASSERT(*spawn_count_ > 0); | 2951 ASSERT(*spawn_count_ > 0); |
| 2949 *spawn_count_ = *spawn_count_ - 1; | 2952 *spawn_count_ = *spawn_count_ - 1; |
| 2950 ml.Notify(); | 2953 ml.Notify(); |
| 2951 } | 2954 } |
| 2952 | 2955 |
| 2953 } // namespace dart | 2956 } // namespace dart |
| OLD | NEW |