| Index: runtime/bin/main.cc
|
| diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
|
| index ee7b80d8efaee4622b4aa7b54bc4f5d73f5c93b6..0a69f4370d90e56382a8af48406f0dae44de404a 100644
|
| --- a/runtime/bin/main.cc
|
| +++ b/runtime/bin/main.cc
|
| @@ -681,10 +681,7 @@ static Dart_Isolate CreateIsolateAndSetupHelper(const char* script_uri,
|
| *error = strdup(VmService::GetErrorMessage());
|
| return NULL;
|
| }
|
| - if (has_gen_precompiled_snapshot) {
|
| - result = Dart_Precompile();
|
| - CHECK_RESULT(result);
|
| - } else if (has_compile_all) {
|
| + if (has_compile_all) {
|
| result = Dart_CompileAll();
|
| CHECK_RESULT(result);
|
| }
|
| @@ -1231,53 +1228,55 @@ void main(int argc, char** argv) {
|
| WriteSnapshotFile(kPrecompiledInstructionsName,
|
| instructions_buffer,
|
| instructions_size);
|
| - } else if (has_compile_all) {
|
| - result = Dart_CompileAll();
|
| - DartExitOnError(result);
|
| - }
|
| -
|
| - if (Dart_IsNull(root_lib)) {
|
| - ErrorExit(kErrorExitCode,
|
| - "Unable to find root library for '%s'\n",
|
| - script_name);
|
| - }
|
| + } else {
|
| + if (has_compile_all) {
|
| + result = Dart_CompileAll();
|
| + DartExitOnError(result);
|
| + }
|
|
|
| - // The helper function _getMainClosure creates a closure for the main
|
| - // entry point which is either explicitly or implictly exported from the
|
| - // root library.
|
| - Dart_Handle main_closure = Dart_Invoke(
|
| - builtin_lib, Dart_NewStringFromCString("_getMainClosure"), 0, NULL);
|
| - DartExitOnError(main_closure);
|
| -
|
| - // Set debug breakpoint if specified on the command line before calling
|
| - // the main function.
|
| - if (breakpoint_at != NULL) {
|
| - result = SetBreakpoint(breakpoint_at, root_lib);
|
| - if (Dart_IsError(result)) {
|
| + if (Dart_IsNull(root_lib)) {
|
| ErrorExit(kErrorExitCode,
|
| - "Error setting breakpoint at '%s': %s\n",
|
| - breakpoint_at,
|
| - Dart_GetError(result));
|
| + "Unable to find root library for '%s'\n",
|
| + script_name);
|
| }
|
| - }
|
|
|
| - // Call _startIsolate in the isolate library to enable dispatching the
|
| - // initial startup message.
|
| - const intptr_t kNumIsolateArgs = 2;
|
| - Dart_Handle isolate_args[kNumIsolateArgs];
|
| - isolate_args[0] = main_closure; // entryPoint
|
| - isolate_args[1] = CreateRuntimeOptions(&dart_options); // args
|
| -
|
| - Dart_Handle isolate_lib = Dart_LookupLibrary(
|
| - Dart_NewStringFromCString("dart:isolate"));
|
| - result = Dart_Invoke(isolate_lib,
|
| - Dart_NewStringFromCString("_startMainIsolate"),
|
| - kNumIsolateArgs, isolate_args);
|
| - DartExitOnError(result);
|
| + // The helper function _getMainClosure creates a closure for the main
|
| + // entry point which is either explicitly or implictly exported from the
|
| + // root library.
|
| + Dart_Handle main_closure = Dart_Invoke(builtin_lib,
|
| + Dart_NewStringFromCString("_getMainClosure"), 0, NULL);
|
| + DartExitOnError(main_closure);
|
| +
|
| + // Set debug breakpoint if specified on the command line before calling
|
| + // the main function.
|
| + if (breakpoint_at != NULL) {
|
| + result = SetBreakpoint(breakpoint_at, root_lib);
|
| + if (Dart_IsError(result)) {
|
| + ErrorExit(kErrorExitCode,
|
| + "Error setting breakpoint at '%s': %s\n",
|
| + breakpoint_at,
|
| + Dart_GetError(result));
|
| + }
|
| + }
|
|
|
| - // Keep handling messages until the last active receive port is closed.
|
| - result = Dart_RunLoop();
|
| - DartExitOnError(result);
|
| + // Call _startIsolate in the isolate library to enable dispatching the
|
| + // initial startup message.
|
| + const intptr_t kNumIsolateArgs = 2;
|
| + Dart_Handle isolate_args[kNumIsolateArgs];
|
| + isolate_args[0] = main_closure; // entryPoint
|
| + isolate_args[1] = CreateRuntimeOptions(&dart_options); // args
|
| +
|
| + Dart_Handle isolate_lib =
|
| + Dart_LookupLibrary(Dart_NewStringFromCString("dart:isolate"));
|
| + result = Dart_Invoke(isolate_lib,
|
| + Dart_NewStringFromCString("_startMainIsolate"),
|
| + kNumIsolateArgs, isolate_args);
|
| + DartExitOnError(result);
|
| +
|
| + // Keep handling messages until the last active receive port is closed.
|
| + result = Dart_RunLoop();
|
| + DartExitOnError(result);
|
| + }
|
| }
|
|
|
| Dart_ExitScope();
|
|
|