| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 LOGE("CreateIsolateAndSetup: %s\n", error); | 184 LOGE("CreateIsolateAndSetup: %s\n", error); |
| 185 free(error); | 185 free(error); |
| 186 return -1; | 186 return -1; |
| 187 } | 187 } |
| 188 LOGI("Created isolate"); | 188 LOGI("Created isolate"); |
| 189 isolate_ = Dart_CurrentIsolate(); | 189 isolate_ = Dart_CurrentIsolate(); |
| 190 Dart_EnterScope(); | 190 Dart_EnterScope(); |
| 191 | 191 |
| 192 Dart_Handle url = CheckError(Dart_NewStringFromCString(main_script_)); | 192 Dart_Handle url = CheckError(Dart_NewStringFromCString(main_script_)); |
| 193 Dart_Handle source = LoadSourceFromFile(main_script_); | 193 Dart_Handle source = LoadSourceFromFile(main_script_); |
| 194 CheckError(Dart_LoadScript(url, source)); | 194 CheckError(Dart_LoadScript(url, source, 0, 0)); |
| 195 | 195 |
| 196 Dart_ExitScope(); | 196 Dart_ExitScope(); |
| 197 Dart_ExitIsolate(); | 197 Dart_ExitIsolate(); |
| 198 return 0; | 198 return 0; |
| 199 } | 199 } |
| 200 | 200 |
| 201 int VMGlue::CallSetup(bool force) { | 201 int VMGlue::CallSetup(bool force) { |
| 202 // TODO(gram): See if we actually need this flag guard here, or if | 202 // TODO(gram): See if we actually need this flag guard here, or if |
| 203 // we can eliminate it along with the need for the force parameter. | 203 // we can eliminate it along with the need for the force parameter. |
| 204 if (!initialized_script_ || force) { | 204 if (!initialized_script_ || force) { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 335 |
| 336 void VMGlue::FinishMainIsolate() { | 336 void VMGlue::FinishMainIsolate() { |
| 337 LOGI("Finish main isolate"); | 337 LOGI("Finish main isolate"); |
| 338 Dart_EnterIsolate(isolate_); | 338 Dart_EnterIsolate(isolate_); |
| 339 // Shutdown the isolate. | 339 // Shutdown the isolate. |
| 340 Dart_ShutdownIsolate(); | 340 Dart_ShutdownIsolate(); |
| 341 isolate_ = NULL; | 341 isolate_ = NULL; |
| 342 initialized_script_ = false; | 342 initialized_script_ = false; |
| 343 } | 343 } |
| 344 | 344 |
| OLD | NEW |