Skip to content

Commit 6a2e567

Browse files
fishythefishCommit Queue
authored andcommitted
[dart2js, ddc] Remove PRINT_LEGACY_STARS.
Bug: #60327 Change-Id: I32a9f078e4c2ae5fc3b79b4f549a4357a08818d9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416043 Reviewed-by: Stephen Adams <[email protected]> Reviewed-by: Nicholas Shahan <[email protected]> Reviewed-by: Nate Biggs <[email protected]>
1 parent 13b5b8a commit 6a2e567

File tree

7 files changed

+5
-29
lines changed

7 files changed

+5
-29
lines changed

pkg/compiler/lib/src/commandline_options.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ class Flags {
9999
static const String noOmitLateNames = '--no-omit-late-names';
100100

101101
static const String preserveUris = '--preserve-uris';
102-
static const String printLegacyStars = '--debug-print-legacy-stars';
103102
static const String showPackageWarnings = '--show-package-warnings';
104103
static const String suppressHints = '--suppress-hints';
105104
static const String suppressWarnings = '--suppress-warnings';

pkg/compiler/lib/src/dart2js.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ Future<api.CompilationResult> compile(
450450
_OneOption(Flags.omitLateNames, passThrough),
451451
_OneOption(Flags.noOmitLateNames, passThrough),
452452
_OneOption(Flags.preserveUris, ignoreOption),
453-
_OneOption(Flags.printLegacyStars, passThrough),
454453
_OneOption('--force-strip=.*', setStrip),
455454
_OneOption(Flags.disableDiagnosticColors, (_) {
456455
enableColors = false;

pkg/compiler/lib/src/kernel/transformations/global/js_get_flag_lowering.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class JsGetFlagLowering {
5959
_options.features.useContentSecurityPolicy.isEnabled,
6060
'VARIANCE' => _options.enableVariance,
6161
'LEGACY' => _options.useLegacySubtyping,
62-
'PRINT_LEGACY_STARS' => _options.printLegacyStars,
6362
_ => null,
6463
};
6564

pkg/compiler/lib/src/options.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,6 @@ class CompilerOptions implements DiagnosticOptions {
552552
/// Location of the kernel platform `.dill` files.
553553
Uri? platformBinaries;
554554

555-
/// Whether to print legacy types as T* rather than T.
556-
bool printLegacyStars = false;
557-
558555
/// URI where the compiler should generate the output source map file.
559556
Uri? sourceMapUri;
560557

@@ -934,7 +931,6 @@ class CompilerOptions implements DiagnosticOptions {
934931
..generateSourceMap = !_hasOption(options, Flags.noSourceMaps)
935932
.._outputUri = _extractUriOption(options, '--out=')
936933
..platformBinaries = platformBinaries
937-
..printLegacyStars = _hasOption(options, Flags.printLegacyStars)
938934
..sourceMapUri = _extractUriOption(options, '--source-map=')
939935
..omitImplicitChecks = _hasOption(options, Flags.omitImplicitChecks)
940936
..omitAsCasts = _hasOption(options, Flags.omitAsCasts)

pkg/dev_compiler/lib/src/kernel/compiler.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6152,9 +6152,8 @@ class ProgramCompiler extends ComputeOnceConstantVisitor<js_ast.Expression>
61526152
var value = flag.value;
61536153
return switch (value) {
61546154
'DEV_COMPILER' => js.boolean(true),
6155-
// TODO(nshahan): Delete 'PRINT_LEGACY_STARS' and 'LEGACY' after
6156-
// uses are deleted from dart:_rti.
6157-
'PRINT_LEGACY_STARS' => js.boolean(false),
6155+
// TODO(nshahan): Delete 'LEGACY' after uses are deleted from
6156+
// dart:_rti.
61586157
'LEGACY' => js.boolean(false),
61596158
'MINIFIED' => js.boolean(false),
61606159
'VARIANCE' =>

pkg/dev_compiler/lib/src/kernel/compiler_new.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6600,9 +6600,8 @@ class LibraryCompiler extends ComputeOnceConstantVisitor<js_ast.Expression>
66006600
var value = flag.value;
66016601
return switch (value) {
66026602
'DEV_COMPILER' => js.boolean(true),
6603-
// TODO(nshahan): Delete 'PRINT_LEGACY_STARS' and 'LEGACY' after
6604-
// uses are deleted from dart:_rti.
6605-
'PRINT_LEGACY_STARS' => js.boolean(false),
6603+
// TODO(nshahan): Delete 'LEGACY' after uses are deleted from
6604+
// dart:_rti.
66066605
'LEGACY' => js.boolean(false),
66076606
'MINIFIED' => js.boolean(false),
66086607
'VARIANCE' =>

sdk/lib/_internal/js_shared/lib/rti.dart

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,6 @@ class Rti {
410410
// TODO(nshahan): Make private and change the argument type to rti once this
411411
// method is no longer called from outside the library.
412412
Rti getLegacyErasedRti(Object? rti) {
413-
// When preserving the legacy stars in the runtime type no legacy erasure
414-
// happens so the cached version cannot be used.
415-
assert(!JS_GET_FLAG('PRINT_LEGACY_STARS'));
416413
var originalType = _Utils.asRti(rti);
417414
return Rti._getCachedRuntimeType(originalType)?._rti ??
418415
_createAndCacheRuntimeType(originalType)._rti;
@@ -1181,9 +1178,6 @@ _Type _createAndCacheRuntimeType(Rti rti) {
11811178
}
11821179

11831180
_Type _createRuntimeType(Rti rti) {
1184-
if (JS_GET_FLAG('PRINT_LEGACY_STARS')) {
1185-
return _Type(rti);
1186-
}
11871181
String recipe = Rti._getCanonicalRecipe(rti);
11881182
String starErasedRecipe = Rti.getLegacyErasedRecipe(rti);
11891183
if (starErasedRecipe == recipe) {
@@ -1996,16 +1990,7 @@ String _rtiToString(Rti rti, List<String>? genericContext) {
19961990
if (kind == Rti.kindStar) {
19971991
Rti starArgument = Rti._getStarArgument(rti);
19981992
String s = _rtiToString(starArgument, genericContext);
1999-
if (JS_GET_FLAG('PRINT_LEGACY_STARS')) {
2000-
int argumentKind = Rti._getKind(starArgument);
2001-
if (argumentKind == Rti.kindFunction ||
2002-
argumentKind == Rti.kindGenericFunction) {
2003-
s = '(' + s + ')';
2004-
}
2005-
return s + '*';
2006-
} else {
2007-
return s;
2008-
}
1993+
return s;
20091994
}
20101995

20111996
if (kind == Rti.kindQuestion) {

0 commit comments

Comments
 (0)