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 2174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2185 OS::Print( | 2185 OS::Print( |
2186 "[+%" Pd64 "ms] Isolate %s invoking _runExtension for %s\n", | 2186 "[+%" Pd64 "ms] Isolate %s invoking _runExtension for %s\n", |
2187 Dart::timestamp(), name(), method_name.ToCString()); | 2187 Dart::timestamp(), name(), method_name.ToCString()); |
2188 } | 2188 } |
2189 result = DartEntry::InvokeFunction(run_extension, arguments); | 2189 result = DartEntry::InvokeFunction(run_extension, arguments); |
2190 if (FLAG_trace_service) { | 2190 if (FLAG_trace_service) { |
2191 OS::Print( | 2191 OS::Print( |
2192 "[+%" Pd64 "ms] Isolate %s : _runExtension complete for %s\n", | 2192 "[+%" Pd64 "ms] Isolate %s : _runExtension complete for %s\n", |
2193 Dart::timestamp(), name(), method_name.ToCString()); | 2193 Dart::timestamp(), name(), method_name.ToCString()); |
2194 } | 2194 } |
| 2195 // Propagate the error. |
2195 if (result.IsError()) { | 2196 if (result.IsError()) { |
2196 if (result.IsUnwindError()) { | 2197 // Remaining service extension calls are dropped. |
2197 // Propagate the unwind error. Remaining service extension calls | 2198 if (!result.IsUnwindError()) { |
2198 // are dropped. | |
2199 return result.raw(); | |
2200 } else { | |
2201 // Send error back over the protocol. | 2199 // Send error back over the protocol. |
2202 Service::PostError(method_name, | 2200 Service::PostError(method_name, |
2203 parameter_keys, | 2201 parameter_keys, |
2204 parameter_values, | 2202 parameter_values, |
2205 reply_port, | 2203 reply_port, |
2206 id, | 2204 id, |
2207 Error::Cast(result)); | 2205 Error::Cast(result)); |
2208 } | 2206 } |
| 2207 return result.raw(); |
2209 } | 2208 } |
| 2209 // Drain the microtask queue. |
2210 result = DartLibraryCalls::DrainMicrotaskQueue(); | 2210 result = DartLibraryCalls::DrainMicrotaskQueue(); |
| 2211 // Propagate the error. |
2211 if (result.IsError()) { | 2212 if (result.IsError()) { |
| 2213 // Remaining service extension calls are dropped. |
2212 return result.raw(); | 2214 return result.raw(); |
2213 } | 2215 } |
2214 } | 2216 } |
2215 return Object::null(); | 2217 return Object::null(); |
2216 } | 2218 } |
2217 | 2219 |
2218 | 2220 |
2219 RawGrowableObjectArray* Isolate::GetAndClearPendingServiceExtensionCalls() { | 2221 RawGrowableObjectArray* Isolate::GetAndClearPendingServiceExtensionCalls() { |
2220 RawGrowableObjectArray* r = pending_service_extension_calls_; | 2222 RawGrowableObjectArray* r = pending_service_extension_calls_; |
2221 pending_service_extension_calls_ = GrowableObjectArray::null(); | 2223 pending_service_extension_calls_ = GrowableObjectArray::null(); |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2898 void IsolateSpawnState::DecrementSpawnCount() { | 2900 void IsolateSpawnState::DecrementSpawnCount() { |
2899 ASSERT(spawn_count_monitor_ != NULL); | 2901 ASSERT(spawn_count_monitor_ != NULL); |
2900 ASSERT(spawn_count_ != NULL); | 2902 ASSERT(spawn_count_ != NULL); |
2901 MonitorLocker ml(spawn_count_monitor_); | 2903 MonitorLocker ml(spawn_count_monitor_); |
2902 ASSERT(*spawn_count_ > 0); | 2904 ASSERT(*spawn_count_ > 0); |
2903 *spawn_count_ = *spawn_count_ - 1; | 2905 *spawn_count_ = *spawn_count_ - 1; |
2904 ml.Notify(); | 2906 ml.Notify(); |
2905 } | 2907 } |
2906 | 2908 |
2907 } // namespace dart | 2909 } // namespace dart |
OLD | NEW |