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

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

Issue 1427583009: 1. Get rid of SwitchIsolateScope as it is not clear when this should be used and there is also a bu… (Closed) Base URL: git@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 | « runtime/vm/dart.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | 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 "vm/dart.h" 5 #include "vm/dart.h"
6 6
7 #include "vm/code_observers.h" 7 #include "vm/code_observers.h"
8 #include "vm/cpu.h" 8 #include "vm/cpu.h"
9 #include "vm/dart_api_state.h" 9 #include "vm/dart_api_state.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 Isolate* isolate = Isolate::Current(); 391 Isolate* isolate = Isolate::Current();
392 void* callback_data = isolate->init_callback_data(); 392 void* callback_data = isolate->init_callback_data();
393 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); 393 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback();
394 ServiceIsolate::SendIsolateShutdownMessage(); 394 ServiceIsolate::SendIsolateShutdownMessage();
395 if (callback != NULL) { 395 if (callback != NULL) {
396 (callback)(callback_data); 396 (callback)(callback_data);
397 } 397 }
398 } 398 }
399 399
400 400
401 void Dart::ShutdownIsolate(Isolate* isolate) {
402 ASSERT(Isolate::Current() == NULL);
403 // We need to enter the isolate in order to shut it down.
404 Thread::EnterIsolate(isolate);
405 ShutdownIsolate();
406 // Since the isolate is shutdown and deleted, there is no need to
407 // exit the isolate here.
408 ASSERT(Isolate::Current() == NULL);
409 }
410
411
401 void Dart::ShutdownIsolate() { 412 void Dart::ShutdownIsolate() {
402 Isolate* isolate = Isolate::Current(); 413 Isolate* isolate = Isolate::Current();
403 isolate->Shutdown(); 414 isolate->Shutdown();
404 delete isolate; 415 delete isolate;
405 } 416 }
406 417
407 418
408 uword Dart::AllocateReadOnlyHandle() { 419 uword Dart::AllocateReadOnlyHandle() {
409 ASSERT(Isolate::Current() == Dart::vm_isolate()); 420 ASSERT(Isolate::Current() == Dart::vm_isolate());
410 ASSERT(predefined_handles_ != NULL); 421 ASSERT(predefined_handles_ != NULL);
(...skipping 13 matching lines...) Expand all
424 return predefined_handles_->handles_.IsValidScopedHandle(address); 435 return predefined_handles_->handles_.IsValidScopedHandle(address);
425 } 436 }
426 437
427 438
428 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { 439 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) {
429 ASSERT(predefined_handles_ != NULL); 440 ASSERT(predefined_handles_ != NULL);
430 return predefined_handles_->api_handles_.IsValidHandle(handle); 441 return predefined_handles_->api_handles_.IsValidHandle(handle);
431 } 442 }
432 443
433 } // namespace dart 444 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698