| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 <math.h> | 5 #include <math.h> |
| 6 #include <stdarg.h> | 6 #include <stdarg.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 // Initialize the Dart VM, providing the callbacks to use for | 137 // Initialize the Dart VM, providing the callbacks to use for |
| 138 // creating and shutting down isolates. | 138 // creating and shutting down isolates. |
| 139 LOGI("Initializing Dart"); | 139 LOGI("Initializing Dart"); |
| 140 if (!Dart_Initialize(CreateIsolateAndSetup, | 140 if (!Dart_Initialize(CreateIsolateAndSetup, |
| 141 NULL, | 141 NULL, |
| 142 NULL, | 142 NULL, |
| 143 NULL, | 143 NULL, |
| 144 NULL, | 144 NULL, |
| 145 NULL, | 145 NULL, |
| 146 NULL, |
| 146 NULL)) { | 147 NULL)) { |
| 147 LOGE("VM initialization failed\n"); | 148 LOGE("VM initialization failed\n"); |
| 148 return -1; | 149 return -1; |
| 149 } | 150 } |
| 150 initialized_vm_ = true; | 151 initialized_vm_ = true; |
| 151 | 152 |
| 152 return 0; | 153 return 0; |
| 153 } | 154 } |
| 154 | 155 |
| 155 Dart_Handle VMGlue::LoadSourceFromFile(const char* url) { | 156 Dart_Handle VMGlue::LoadSourceFromFile(const char* url) { |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 | 358 |
| 358 void VMGlue::FinishMainIsolate() { | 359 void VMGlue::FinishMainIsolate() { |
| 359 LOGI("Finish main isolate"); | 360 LOGI("Finish main isolate"); |
| 360 Dart_EnterIsolate(isolate_); | 361 Dart_EnterIsolate(isolate_); |
| 361 // Shutdown the isolate. | 362 // Shutdown the isolate. |
| 362 Dart_ShutdownIsolate(); | 363 Dart_ShutdownIsolate(); |
| 363 isolate_ = NULL; | 364 isolate_ = NULL; |
| 364 initialized_script_ = false; | 365 initialized_script_ = false; |
| 365 } | 366 } |
| 366 | 367 |
| OLD | NEW |