Chromium Code Reviews| 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 "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/json.h" | 9 #include "platform/json.h" |
| 10 #include "lib/mirrors.h" | 10 #include "lib/mirrors.h" |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 642 // Print the error if there is one. This may execute dart code to | 642 // Print the error if there is one. This may execute dart code to |
| 643 // print the exception object, so we need to use a StartIsolateScope. | 643 // print the exception object, so we need to use a StartIsolateScope. |
| 644 StartIsolateScope start_scope(isolate); | 644 StartIsolateScope start_scope(isolate); |
| 645 StackZone zone(isolate); | 645 StackZone zone(isolate); |
| 646 HandleScope handle_scope(isolate); | 646 HandleScope handle_scope(isolate); |
| 647 Error& error = Error::Handle(); | 647 Error& error = Error::Handle(); |
| 648 error = isolate->object_store()->sticky_error(); | 648 error = isolate->object_store()->sticky_error(); |
| 649 if (!error.IsNull()) { | 649 if (!error.IsNull()) { |
| 650 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString()); | 650 OS::PrintErr("in ShutdownIsolate: %s\n", error.ToErrorCString()); |
| 651 } | 651 } |
| 652 } | |
| 653 { | |
| 654 // Shut the isolate down. | 652 // Shut the isolate down. |
|
siva
2013/07/08 21:54:39
I think this may end up accessing the deleted isol
| |
| 655 SwitchIsolateScope switch_scope(isolate); | |
| 656 Dart::ShutdownIsolate(); | 653 Dart::ShutdownIsolate(); |
| 657 } | 654 } |
| 658 } | 655 } |
| 659 | 656 |
| 660 | 657 |
| 661 void Isolate::Run() { | 658 void Isolate::Run() { |
| 662 message_handler()->Run(Dart::thread_pool(), | 659 message_handler()->Run(Dart::thread_pool(), |
| 663 RunIsolate, | 660 RunIsolate, |
| 664 ShutdownIsolate, | 661 ShutdownIsolate, |
| 665 reinterpret_cast<uword>(this)); | 662 reinterpret_cast<uword>(this)); |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1194 return func.raw(); | 1191 return func.raw(); |
| 1195 } | 1192 } |
| 1196 | 1193 |
| 1197 | 1194 |
| 1198 void IsolateSpawnState::Cleanup() { | 1195 void IsolateSpawnState::Cleanup() { |
| 1199 SwitchIsolateScope switch_scope(isolate()); | 1196 SwitchIsolateScope switch_scope(isolate()); |
| 1200 Dart::ShutdownIsolate(); | 1197 Dart::ShutdownIsolate(); |
| 1201 } | 1198 } |
| 1202 | 1199 |
| 1203 } // namespace dart | 1200 } // namespace dart |
| OLD | NEW |