| 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 "bin/vmservice_impl.h" | 5 #include "bin/vmservice_impl.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 108 } |
| 109 Dart_EnterIsolate(isolate); | 109 Dart_EnterIsolate(isolate); |
| 110 Dart_EnterScope(); | 110 Dart_EnterScope(); |
| 111 // Install our own library tag handler. | 111 // Install our own library tag handler. |
| 112 Dart_SetLibraryTagHandler(LibraryTagHandler); | 112 Dart_SetLibraryTagHandler(LibraryTagHandler); |
| 113 Dart_Handle result; | 113 Dart_Handle result; |
| 114 Dart_Handle library = LoadScript(kVMServiceIOLibraryScriptResourceName); | 114 Dart_Handle library = LoadScript(kVMServiceIOLibraryScriptResourceName); |
| 115 // Expect a library. | 115 // Expect a library. |
| 116 ASSERT(library != Dart_Null()); | 116 ASSERT(library != Dart_Null()); |
| 117 SHUTDOWN_ON_ERROR(library); | 117 SHUTDOWN_ON_ERROR(library); |
| 118 result = Dart_FinalizeLoading(false); |
| 119 ASSERT(!Dart_IsError(result)); |
| 118 Dart_ExitScope(); | 120 Dart_ExitScope(); |
| 119 Dart_ExitIsolate(); | 121 Dart_ExitIsolate(); |
| 120 bool retval = Dart_IsolateMakeRunnable(isolate); | 122 bool retval = Dart_IsolateMakeRunnable(isolate); |
| 121 if (!retval) { | 123 if (!retval) { |
| 122 Dart_EnterIsolate(isolate); | 124 Dart_EnterIsolate(isolate); |
| 123 Dart_ShutdownIsolate(); | 125 Dart_ShutdownIsolate(); |
| 124 error_msg_ = "Invalid isolate state - Unable to make it runnable."; | 126 error_msg_ = "Invalid isolate state - Unable to make it runnable."; |
| 125 return false; | 127 return false; |
| 126 } | 128 } |
| 127 | 129 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 printf("Service exited with an error:\n%s\n", Dart_GetError(result)); | 301 printf("Service exited with an error:\n%s\n", Dart_GetError(result)); |
| 300 } | 302 } |
| 301 Dart_ExitScope(); | 303 Dart_ExitScope(); |
| 302 Dart_ExitIsolate(); | 304 Dart_ExitIsolate(); |
| 303 } | 305 } |
| 304 | 306 |
| 305 | 307 |
| 306 | 308 |
| 307 } // namespace bin | 309 } // namespace bin |
| 308 } // namespace dart | 310 } // namespace dart |
| OLD | NEW |