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

Unified Diff: runtime/bin/main.cc

Issue 2327693002: Add --parse-all option in order to benchmark and measure the scanner/parser performance. (Closed)
Patch Set: Address review comments. Created 4 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/include/dart_native_api.h » ('j') | runtime/vm/compiler.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 9d7ce7786268d65a1bf274888a3ba0ff49aab9ad..8a80c7e7808ee33724ba49b06375fc9d3a8e4a60 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -78,6 +78,7 @@ static const char* commandline_packages_file = NULL;
// Global flag that is used to indicate that we want to compile all the
// dart functions and not run anything.
static bool compile_all = false;
+static bool parse_all = false;
// Global flag that is used to indicate that we want to use blobs/mmap instead
@@ -324,6 +325,17 @@ static bool ProcessCompileAllOption(const char* arg,
}
+static bool ProcessParseAllOption(const char* arg,
+ CommandLineOptions* vm_options) {
+ ASSERT(arg != NULL);
+ if (*arg != '\0') {
+ return false;
+ }
+ parse_all = true;
+ return true;
+}
+
+
static bool ProcessUseBlobsOption(const char* arg,
CommandLineOptions* vm_options) {
ASSERT(arg != NULL);
@@ -547,6 +559,7 @@ static struct {
// VM specific options to the standalone dart program.
{ "--compile_all", ProcessCompileAllOption },
+ { "--parse_all", ProcessParseAllOption },
{ "--enable-vm-service", ProcessEnableVmServiceOption },
{ "--disable-service-origin-check", ProcessDisableServiceOriginCheckOption },
{ "--observe", ProcessObserveOption },
@@ -1515,6 +1528,15 @@ bool RunMainIsolate(const char* script_name,
CHECK_RESULT(result);
}
+ if (parse_all) {
+ result = Dart_ParseAll();
+ CHECK_RESULT(result);
+ Dart_ExitScope();
+ // Shutdown the isolate.
+ Dart_ShutdownIsolate();
+ return false;
+ }
+
if (is_noopt || (gen_snapshot_kind == kAppAOT)) {
Dart_QualifiedFunctionName standalone_entry_points[] = {
{ "dart:_builtin", "::", "_getMainClosure" },
« no previous file with comments | « no previous file | runtime/include/dart_native_api.h » ('j') | runtime/vm/compiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698