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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
8 | 8 |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "lib/stacktrace.h" | 10 #include "lib/stacktrace.h" |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1290 | 1290 |
1291 DART_EXPORT void Dart_ShutdownIsolate() { | 1291 DART_EXPORT void Dart_ShutdownIsolate() { |
1292 Thread* T = Thread::Current(); | 1292 Thread* T = Thread::Current(); |
1293 Isolate* I = T->isolate(); | 1293 Isolate* I = T->isolate(); |
1294 CHECK_ISOLATE(I); | 1294 CHECK_ISOLATE(I); |
1295 I->WaitForOutstandingSpawns(); | 1295 I->WaitForOutstandingSpawns(); |
1296 { | 1296 { |
1297 StackZone zone(T); | 1297 StackZone zone(T); |
1298 HandleScope handle_scope(T); | 1298 HandleScope handle_scope(T); |
1299 Dart::RunShutdownCallback(); | 1299 Dart::RunShutdownCallback(); |
| 1300 // The Thread structure is disassociated from the isolate, we do the |
| 1301 // safepoint transition explicity here instead of using the TransitionXXX |
| 1302 // scope objects as the original transition happened outside this scope in |
| 1303 // Dart_EnterIsolate/Dart_CreateIsolate. |
| 1304 T->ExitSafepoint(); |
| 1305 T->set_execution_state(Thread::kThreadInVM); |
| 1306 ServiceIsolate::SendIsolateShutdownMessage(); |
1300 } | 1307 } |
1301 // The Thread structure is disassociated from the isolate, we do the | |
1302 // safepoint transition explicity here instead of using the TransitionXXX | |
1303 // scope objects as the original transition happened outside this scope in | |
1304 // Dart_EnterIsolate/Dart_CreateIsolate. | |
1305 T->ExitSafepoint(); | |
1306 T->set_execution_state(Thread::kThreadInVM); | |
1307 Dart::ShutdownIsolate(); | 1308 Dart::ShutdownIsolate(); |
1308 } | 1309 } |
1309 | 1310 |
1310 | 1311 |
1311 DART_EXPORT Dart_Isolate Dart_CurrentIsolate() { | 1312 DART_EXPORT Dart_Isolate Dart_CurrentIsolate() { |
1312 return Api::CastIsolate(Isolate::Current()); | 1313 return Api::CastIsolate(Isolate::Current()); |
1313 } | 1314 } |
1314 | 1315 |
1315 | 1316 |
1316 DART_EXPORT void* Dart_CurrentIsolateData() { | 1317 DART_EXPORT void* Dart_CurrentIsolateData() { |
(...skipping 5121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6438 | 6439 |
6439 DART_EXPORT bool Dart_IsPrecompiledRuntime() { | 6440 DART_EXPORT bool Dart_IsPrecompiledRuntime() { |
6440 #if defined(DART_PRECOMPILED_RUNTIME) | 6441 #if defined(DART_PRECOMPILED_RUNTIME) |
6441 return true; | 6442 return true; |
6442 #else | 6443 #else |
6443 return false; | 6444 return false; |
6444 #endif | 6445 #endif |
6445 } | 6446 } |
6446 | 6447 |
6447 } // namespace dart | 6448 } // namespace dart |
OLD | NEW |