Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 2047123002: Move code that sends an isolate shutdown message to the service isolate to the block after we trans… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/dart.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/dart.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698