Skip to content

Commit 4f66bb0

Browse files
Christian Altamiranocommit-bot@chromium.org
Christian Altamirano
authored andcommitted
[dart2js] Added a powerset flag for new experiment
This experiment will use a powerset abstract value domain in the inferrer Change-Id: I216ff9c24d1e7292688426ae7bcb52b15aa2714e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153720 Reviewed-by: Stephen Adams <[email protected]> Commit-Queue: Christian Altamirano <[email protected]>
1 parent 5580f89 commit 4f66bb0

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

pkg/compiler/lib/src/commandline_options.dart

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ class Flags {
2828
static const String experimentalAllocationsPath =
2929
'--experimental-allocations-path';
3030

31+
static const String experimentalPowersets = '--experimental-powersets';
32+
3133
// Temporary experiment for code generation of locals for frequently used
3234
// 'this' and constants.
3335
static const String experimentLocalNames = '--experiment-code-1';

pkg/compiler/lib/src/compiler.dart

+5-3
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ abstract class Compiler {
135135
options.deriveOptions();
136136
options.validate();
137137

138-
abstractValueStrategy = options.useTrivialAbstractValueDomain
139-
? const TrivialAbstractValueStrategy()
140-
: const TypeMaskStrategy();
138+
abstractValueStrategy = options.experimentalPowersets
139+
? throw UnimplementedError('Powerset abstract value domain')
140+
: options.useTrivialAbstractValueDomain
141+
? const TrivialAbstractValueStrategy()
142+
: const TypeMaskStrategy();
141143
CompilerTask kernelFrontEndTask;
142144
selfTask = new GenericTask('self', measurer);
143145
_outputProvider = new _CompilerOutput(this, outputProvider);

pkg/compiler/lib/src/dart2js.dart

+1
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ Future<api.CompilationResult> compile(List<String> argv,
445445
new OptionHandler(Flags.disableProgramSplit, passThrough),
446446
new OptionHandler(Flags.disableTypeInference, passThrough),
447447
new OptionHandler(Flags.useTrivialAbstractValueDomain, passThrough),
448+
new OptionHandler(Flags.experimentalPowersets, passThrough),
448449
new OptionHandler(Flags.disableRtiOptimization, passThrough),
449450
new OptionHandler(Flags.terse, passThrough),
450451
new OptionHandler('--deferred-map=.+', passThrough),

pkg/compiler/lib/src/options.dart

+4
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ class CompilerOptions implements DiagnosticOptions {
193193
/// Whether to use the trivial abstract value domain.
194194
bool useTrivialAbstractValueDomain = false;
195195

196+
/// Whether to use the powerset abstract value domain (experimental).
197+
bool experimentalPowersets = false;
198+
196199
/// Whether to disable optimization for need runtime type information.
197200
bool disableRtiOptimization = false;
198201

@@ -428,6 +431,7 @@ class CompilerOptions implements DiagnosticOptions {
428431
..disableTypeInference = _hasOption(options, Flags.disableTypeInference)
429432
..useTrivialAbstractValueDomain =
430433
_hasOption(options, Flags.useTrivialAbstractValueDomain)
434+
..experimentalPowersets = _hasOption(options, Flags.experimentalPowersets)
431435
..disableRtiOptimization =
432436
_hasOption(options, Flags.disableRtiOptimization)
433437
..dumpInfo = _hasOption(options, Flags.dumpInfo)

0 commit comments

Comments
 (0)