Skip to content

Commit bae5bde

Browse files
rakudramacommit-bot@chromium.org
authored andcommitted
[dart2js] Add '--golem-x' command-line flag
This flag will be used to determine the experimental parameters for the Golem 'dart2js-x-*' configurations. Change-Id: I4698b9520ce86be997ded00092372d72248bbe8a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108201 Reviewed-by: Nicholas Shahan <nshahan@google.com> Commit-Queue: Stephen Adams <sra@google.com>
1 parent ac30ab1 commit bae5bde

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

pkg/compiler/lib/src/commandline_options.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ class Flags {
100100
/// Flag for a combination of flags for 'production' mode.
101101
static const String benchmarkingProduction = '--benchmarking-production';
102102

103+
/// Flag for a combination of flags for golem experiment mode.
104+
static const String golemExperiment = '--golem-x';
105+
103106
static const String conditionalDirectives = '--conditional-directives';
104107

105108
// The syntax-only level of support for generic methods is included in the

pkg/compiler/lib/src/dart2js.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ Future<api.CompilationResult> compile(List<String> argv,
456456
new OptionHandler(Flags.omitAsCasts, passThrough),
457457
new OptionHandler(Flags.laxRuntimeTypeToString, passThrough),
458458
new OptionHandler(Flags.benchmarkingProduction, passThrough),
459+
new OptionHandler(Flags.golemExperiment, passThrough),
459460

460461
// TODO(floitsch): remove conditional directives flag.
461462
// We don't provide the info-message yet, since we haven't publicly

pkg/compiler/lib/src/options.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ class CompilerOptions implements DiagnosticOptions {
120120
/// Sets a combination of flags for benchmarking 'production' mode.
121121
bool benchmarkingProduction = false;
122122

123+
/// Sets a combination of flags for golem experiment benchmarking mode.
124+
bool golemExperiment = false;
125+
123126
/// ID associated with this sdk build.
124127
String buildId = _UNDETERMINED_BUILD_ID;
125128

@@ -359,6 +362,7 @@ class CompilerOptions implements DiagnosticOptions {
359362
..allowMockCompilation = _hasOption(options, Flags.allowMockCompilation)
360363
..benchmarkingProduction =
361364
_hasOption(options, Flags.benchmarkingProduction)
365+
..golemExperiment = _hasOption(options, Flags.golemExperiment)
362366
..buildId =
363367
_extractStringOption(options, '--build-id=', _UNDETERMINED_BUILD_ID)
364368
..compileForServer = _hasOption(options, Flags.serverMode)
@@ -462,6 +466,11 @@ class CompilerOptions implements DiagnosticOptions {
462466
omitImplicitChecks = true;
463467
}
464468

469+
if (golemExperiment) {
470+
// TODO(sra): Set flags implied by '--golem-x'. Initially this will be
471+
// --experiment-new-rti, and later NNBD.
472+
}
473+
465474
if (optimizationLevel != null) {
466475
if (optimizationLevel == 0) {
467476
disableInlining = true;

0 commit comments

Comments
 (0)