Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(722)

Unified Diff: runtime/bin/main.cc

Issue 1311403009: More precompiled snapshotting. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: sync Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | runtime/vm/dart.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | runtime/vm/dart.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698