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

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

Issue 1430783002: Fix Isolate scopes in service isolate shutdown (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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/service_isolate.h" 5 #include "vm/service_isolate.h"
6 6
7 #include "vm/compiler.h" 7 #include "vm/compiler.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 Thread* T = Thread::Current(); 352 Thread* T = Thread::Current();
353 ASSERT(I == T->isolate()); 353 ASSERT(I == T->isolate());
354 StackZone zone(T); 354 StackZone zone(T);
355 HandleScope handle_scope(T); 355 HandleScope handle_scope(T);
356 Error& error = Error::Handle(Z); 356 Error& error = Error::Handle(Z);
357 error = I->object_store()->sticky_error(); 357 error = I->object_store()->sticky_error();
358 if (!error.IsNull() && !error.IsUnwindError()) { 358 if (!error.IsNull() && !error.IsUnwindError()) {
359 OS::PrintErr("vm-service: Error: %s\n", error.ToErrorCString()); 359 OS::PrintErr("vm-service: Error: %s\n", error.ToErrorCString());
360 } 360 }
361 Dart::RunShutdownCallback(); 361 Dart::RunShutdownCallback();
362 362 }
363 {
363 // Shut the isolate down. 364 // Shut the isolate down.
365 SwitchIsolateScope switch_scope(I);
364 Dart::ShutdownIsolate(); 366 Dart::ShutdownIsolate();
365 } 367 }
siva 2015/10/30 15:22:47 Can we switch this to: { ASSERT(Isolate::Curre
zra 2015/10/30 16:48:40 Discussed offline. It is also not possible to do S
366 if (FLAG_trace_service) { 368 if (FLAG_trace_service) {
367 OS::Print("vm-service: Shutdown.\n"); 369 OS::Print("vm-service: Shutdown.\n");
368 } 370 }
369 ServiceIsolate::FinishedExiting(); 371 ServiceIsolate::FinishedExiting();
370 } 372 }
371 373
372 void RunMain(Isolate* I) { 374 void RunMain(Isolate* I) {
373 Thread* T = Thread::Current(); 375 Thread* T = Thread::Current();
374 ASSERT(I == T->isolate()); 376 ASSERT(I == T->isolate());
375 StackZone zone(T); 377 StackZone zone(T);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 ASSERT(!result.IsNull()); 487 ASSERT(!result.IsNull());
486 Dart_Port port = ILLEGAL_PORT; 488 Dart_Port port = ILLEGAL_PORT;
487 if (result.IsReceivePort()) { 489 if (result.IsReceivePort()) {
488 port = ReceivePort::Cast(result).Id(); 490 port = ReceivePort::Cast(result).Id();
489 } 491 }
490 ASSERT(port != ILLEGAL_PORT); 492 ASSERT(port != ILLEGAL_PORT);
491 ServiceIsolate::SetServicePort(port); 493 ServiceIsolate::SetServicePort(port);
492 } 494 }
493 495
494 } // namespace dart 496 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698