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

Side by Side Diff: runtime/bin/main.cc

Issue 1739593002: Revert "Move precompilation-related flags to flags list." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/lib/regexp.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdlib.h> 5 #include <stdlib.h>
6 #include <string.h> 6 #include <string.h>
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "include/dart_api.h" 9 #include "include/dart_api.h"
10 #include "include/dart_tools_api.h" 10 #include "include/dart_tools_api.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 " dart_no_snapshot.\n"); 333 " dart_no_snapshot.\n");
334 return false; 334 return false;
335 } 335 }
336 ASSERT(arg != NULL); 336 ASSERT(arg != NULL);
337 if ((arg[0] == '=') || (arg[0] == ':')) { 337 if ((arg[0] == '=') || (arg[0] == ':')) {
338 precompiled_snapshot_directory = &arg[1]; 338 precompiled_snapshot_directory = &arg[1];
339 } else { 339 } else {
340 precompiled_snapshot_directory = arg; 340 precompiled_snapshot_directory = arg;
341 } 341 }
342 gen_precompiled_snapshot = true; 342 gen_precompiled_snapshot = true;
343 #if !defined(DART_PRECOMPILED_RUNTIME)
344 // The precompiled runtime has FLAG_precompilation set as const.
345 vm_options->AddArgument("--precompilation"); 343 vm_options->AddArgument("--precompilation");
346 #endif
347 return true; 344 return true;
348 } 345 }
349 346
350 347
351 static bool ProcessRunPrecompiledSnapshotOption( 348 static bool ProcessRunPrecompiledSnapshotOption(
352 const char* arg, 349 const char* arg,
353 CommandLineOptions* vm_options) { 350 CommandLineOptions* vm_options) {
354 ASSERT(arg != NULL); 351 ASSERT(arg != NULL);
355 precompiled_snapshot_directory = arg; 352 precompiled_snapshot_directory = arg;
356 if ((precompiled_snapshot_directory[0] == '=') || 353 if ((precompiled_snapshot_directory[0] == '=') ||
357 (precompiled_snapshot_directory[0] == ':')) { 354 (precompiled_snapshot_directory[0] == ':')) {
358 precompiled_snapshot_directory = &precompiled_snapshot_directory[1]; 355 precompiled_snapshot_directory = &precompiled_snapshot_directory[1];
359 } 356 }
360 run_precompiled_snapshot = true; 357 run_precompiled_snapshot = true;
361 #if !defined(DART_PRECOMPILED_RUNTIME)
362 // The precompiled runtime has FLAG_precompilation set as const.
363 vm_options->AddArgument("--precompilation"); 358 vm_options->AddArgument("--precompilation");
364 #endif
365 return true; 359 return true;
366 } 360 }
367 361
368 362
369 static bool ProcessSnapshotOptionHelper(const char* filename, 363 static bool ProcessSnapshotOptionHelper(const char* filename,
370 bool* snapshot_option) { 364 bool* snapshot_option) {
371 ASSERT((filename != NULL) && (strlen(filename) != 0)); 365 ASSERT((filename != NULL) && (strlen(filename) != 0));
372 snapshot_filename = filename; 366 snapshot_filename = filename;
373 *snapshot_option = true; 367 *snapshot_option = true;
374 if (generate_script_snapshot && generate_full_snapshot_after_run) { 368 if (generate_script_snapshot && generate_full_snapshot_after_run) {
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after
1555 1549
1556 Thread::InitOnce(); 1550 Thread::InitOnce();
1557 1551
1558 if (!DartUtils::SetOriginalWorkingDirectory()) { 1552 if (!DartUtils::SetOriginalWorkingDirectory()) {
1559 OSError err; 1553 OSError err;
1560 fprintf(stderr, "Error determining current directory: %s\n", err.message()); 1554 fprintf(stderr, "Error determining current directory: %s\n", err.message());
1561 fflush(stderr); 1555 fflush(stderr);
1562 Platform::Exit(kErrorExitCode); 1556 Platform::Exit(kErrorExitCode);
1563 } 1557 }
1564 1558
1565 #if !defined(PRODUCT)
1566 // Constant true in PRODUCT mode.
1567 if (generate_script_snapshot || 1559 if (generate_script_snapshot ||
1568 generate_full_snapshot_after_run || 1560 generate_full_snapshot_after_run ||
1569 run_full_snapshot) { 1561 run_full_snapshot) {
1570 vm_options.AddArgument("--load_deferred_eagerly"); 1562 vm_options.AddArgument("--load_deferred_eagerly");
1571 } 1563 }
1572 #endif
1573 1564
1574 #if defined(DART_PRECOMPILER) && !defined(DART_NO_SNAPSHOT) 1565 #if defined(DART_PRECOMPILER) && !defined(DART_NO_SNAPSHOT)
1575 // Always set --precompilation with dart_noopt. 1566 // Always set --precompilation with dart_noopt.
1576 ASSERT(!gen_precompiled_snapshot && !run_precompiled_snapshot); 1567 ASSERT(!gen_precompiled_snapshot && !run_precompiled_snapshot);
1577 vm_options.AddArgument("--precompilation"); 1568 vm_options.AddArgument("--precompilation");
1578 #endif 1569 #endif
1579 1570
1580 Dart_SetVMFlags(vm_options.count(), vm_options.arguments()); 1571 Dart_SetVMFlags(vm_options.count(), vm_options.arguments());
1581 1572
1582 // Start event handler. 1573 // Start event handler.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 Platform::Exit(Process::GlobalExitCode()); 1666 Platform::Exit(Process::GlobalExitCode());
1676 } 1667 }
1677 1668
1678 } // namespace bin 1669 } // namespace bin
1679 } // namespace dart 1670 } // namespace dart
1680 1671
1681 int main(int argc, char** argv) { 1672 int main(int argc, char** argv) {
1682 dart::bin::main(argc, argv); 1673 dart::bin::main(argc, argv);
1683 UNREACHABLE(); 1674 UNREACHABLE();
1684 } 1675 }
OLDNEW
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/lib/regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698