[dart2js] Cleanup some TODOs in dart2js' frontend api.

These appear to be no longer necessary.

Change-Id: I8ec8a13394b6e56697de3ccee3a5326b149a137a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/233000
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
This commit is contained in:
Joshua Litt 2022-02-15 17:41:39 +00:00 committed by Commit Bot
parent 904d1af024
commit f50a4b4612
6 changed files with 5 additions and 27 deletions

View file

@ -7,8 +7,6 @@ library dart2js.compiler_base;
import 'dart:async' show Future;
import 'dart:convert' show jsonEncode;
import 'package:front_end/src/api_unstable/dart2js.dart'
show clearStringTokenCanonicalizer;
import 'package:kernel/ast.dart' as ir;
import '../compiler.dart' as api;
@ -412,7 +410,6 @@ class Compiler {
// such caches in the compiler and get access to them through a
// suitably maintained static reference to the current compiler.
void clearState() {
clearStringTokenCanonicalizer();
Selector.canonicalizedValues.clear();
// The selector objects held in static fields must remain canonical.

View file

@ -2,7 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:front_end/src/api_unstable/dart2js.dart' as ir;
import 'package:kernel/ast.dart' as ir;
import 'package:kernel/core_types.dart' as ir;
import 'package:kernel/type_environment.dart' as ir;
@ -115,7 +114,7 @@ class ScopeModelBuilder extends ir.Visitor<EvaluationComplexity>
}
} else {
assert(node is ir.Procedure || node is ir.Constructor);
if (!(node is ir.Procedure && ir.isRedirectingFactory(node))) {
if (!(node is ir.Procedure && node.isRedirectingFactory)) {
// Skip redirecting factories: they contain invalid expressions only
// used to suppport internal CFE modular compilation.
node.accept(this);

View file

@ -5,7 +5,7 @@
library dart2js.kernel.env;
import 'package:front_end/src/api_unstable/dart2js.dart'
show isRedirectingFactory, isRedirectingFactoryField;
show isRedirectingFactoryField;
import 'package:kernel/ast.dart' as ir;
import 'package:kernel/type_environment.dart' as ir;
@ -368,7 +368,7 @@ class KClassEnvImpl implements KClassEnv {
}
var name = member.name.text;
if (member.kind == ir.ProcedureKind.Factory) {
if (isRedirectingFactory(member)) {
if (member.isRedirectingFactory) {
// Don't include redirecting factories.
return;
}

View file

@ -19,7 +19,7 @@ import 'package:compiler/src/kernel/loader.dart';
import 'package:expect/expect.dart';
import 'package:front_end/src/api_prototype/constant_evaluator.dart' as ir;
import 'package:front_end/src/api_unstable/dart2js.dart'
show isRedirectingFactory, isRedirectingFactoryField, relativizeUri;
show isRedirectingFactoryField, relativizeUri;
import 'package:kernel/ast.dart' as ir;
import 'package:kernel/class_hierarchy.dart' as ir;
import 'package:kernel/core_types.dart' as ir;
@ -98,7 +98,7 @@ class StaticTypeVisitorBase extends StaticTypeVisitor {
@override
Null visitProcedure(ir.Procedure node) {
if (node.kind == ir.ProcedureKind.Factory && isRedirectingFactory(node)) {
if (node.kind == ir.ProcedureKind.Factory && node.isRedirectingFactory) {
// Don't visit redirecting factories.
return;
}

View file

@ -10,12 +10,8 @@ import 'package:_fe_analyzer_shared/src/messages/diagnostic_message.dart'
import 'package:_fe_analyzer_shared/src/messages/severity.dart' show Severity;
import 'package:_fe_analyzer_shared/src/scanner/scanner.dart' show StringToken;
import 'package:kernel/kernel.dart' show Component;
import 'package:kernel/ast.dart' as ir;
import 'package:kernel/target/targets.dart' show Target;
import '../api_prototype/compiler_options.dart'
@ -126,12 +122,6 @@ export '../fasta/operator.dart' show operatorFromString;
export 'compiler_state.dart' show InitializedCompilerState;
void clearStringTokenCanonicalizer() {
// TODO(ahe): We should be able to remove this. Fasta should take care of
// clearing the cache when.
StringToken.canonicalizer.clear();
}
InitializedCompilerState initializeCompiler(
InitializedCompilerState? oldState,
Target target,
@ -213,9 +203,3 @@ Future<Component?> compile(
options.fileSystem = const NullFileSystem();
return compilerResult?.component;
}
/// Desugar API to determine whether [member] is a redirecting factory
/// constructor.
// TODO(sigmund): Delete this API once `member.isRedirectingFactory`
// is implemented correctly for patch files (Issue #33495).
bool isRedirectingFactory(ir.Procedure member) => member.isRedirectingFactory;

View file

@ -14,7 +14,6 @@ import 'dart:io';
import 'package:async_helper/async_helper.dart';
import 'package:expect/expect.dart';
import 'package:front_end/src/api_unstable/dart2js.dart' as api;
import 'package:front_end/src/compute_platform_binaries_location.dart';
import 'package:front_end/src/fasta/kernel/utils.dart' show serializeComponent;
import 'package:front_end/src/testing/compiler_common.dart';
@ -64,7 +63,6 @@ void checkIsRedirectingFactory(ir.Component component, String uriPath,
.firstWhere((m) => m.name.text == constructorName) as ir.Procedure;
Expect.isTrue(
member.kind == ir.ProcedureKind.Factory, "$member is not a factory");
Expect.isTrue(api.isRedirectingFactory(member));
Expect.isTrue(member.isRedirectingFactory);
}