[dart2js] Remove references to new-rti/old-rti.

The "new" rti library has been standard for years now and no one should
be passing `--experiment-new-rti` or `--use-old-rti`. We can now clean
up any references to different versions of rtis.

Change-Id: I4421b8943fe5034ed4d259477e8112b25ba0c763
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416326
Reviewed-by: Nate Biggs <natebiggs@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
This commit is contained in:
Mayank Patke
2025-03-19 11:54:57 -07:00
committed by Commit Queue
parent 30f2914e74
commit 3a3dfcbb7d
42 changed files with 1609 additions and 761 deletions
+4
View File
@@ -77,6 +77,10 @@ not match the non-nullable type and this will now throw.
In the future this will likely be a compile-time error and will be entirely
disallowed.
#### Dart to Javascript Compiler (dart2js)
Removed the `--experiment-new-rti` and `--use-old-rti` flags.
## 3.7.0
**Released on:** 2025-02-12
@@ -15,17 +15,17 @@ CollectionSieves-SoundSplayTreeSet-removeLoop(RunTime): 4344.902386117137 us.
**Dart2JS**
```
$ sdk/bin/dart2js_developer benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart --enable-experiment=variance --experiment-new-rti --out=soundsplay_d2js.js
$ sdk/bin/dart2js_developer benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart --enable-experiment=variance --out=soundsplay_d2js.js
$ third_party/d8/linux/d8 soundsplay_d2js.js
```
**Dart2JS (Omit implicit checks)**
```
$ sdk/bin/dart2js_developer benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart --enable-experiment=variance --experiment-new-rti --omit-implicit-checks --out=soundsplay_d2js_omit.js --lax-runtime-type-to-string
$ sdk/bin/dart2js_developer benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart --enable-experiment=variance --omit-implicit-checks --out=soundsplay_d2js_omit.js --lax-runtime-type-to-string
$ third_party/d8/linux/d8 soundsplay_d2js_omit.js
```
**DDK**
```
$ pkg/dev_compiler/tool/ddb -d -r chrome --enable-experiment=variance -k benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart
```
```
@@ -15,17 +15,17 @@ CollectionSieves-SoundSplayTreeSet-removeLoop(RunTime): 4344.902386117137 us.
**Dart2JS**
```
$ sdk/bin/dart2js_developer benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart --enable-experiment=variance --experiment-new-rti --out=soundsplay_d2js.js
$ sdk/bin/dart2js_developer benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart --enable-experiment=variance --out=soundsplay_d2js.js
$ third_party/d8/linux/d8 soundsplay_d2js.js
```
**Dart2JS (Omit implicit checks)**
```
$ sdk/bin/dart2js_developer benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart --enable-experiment=variance --experiment-new-rti --omit-implicit-checks --out=soundsplay_d2js_omit.js --lax-runtime-type-to-string
$ sdk/bin/dart2js_developer benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart --enable-experiment=variance --omit-implicit-checks --out=soundsplay_d2js_omit.js --lax-runtime-type-to-string
$ third_party/d8/linux/d8 soundsplay_d2js_omit.js
```
**DDK**
```
$ pkg/dev_compiler/tool/ddb -d -r chrome --enable-experiment=variance -k benchmarks/SoundSplayTreeSieve/dart/SoundSplayTreeSieve.dart
```
```
@@ -58,8 +58,6 @@ class Flags {
static const String experimentCallInstrumentation =
'--experiment-call-instrumentation';
static const String experimentNewRti = '--experiment-new-rti';
static const String enableLanguageExperiments = '--enable-experiment';
static const String fastStartup = '--fast-startup';
@@ -107,7 +105,6 @@ class Flags {
'--experimental-trust-js-interop-type-annotations';
static const String useMultiSourceInfo = '--use-multi-source-info';
static const String useNewSourceInfo = '--use-new-source-info';
static const String useOldRti = '--use-old-rti';
static const String useSimpleLoadIds = '--simple-load-ids';
static const String verbose = '--verbose';
static const String verbosity = '--verbosity';
+1 -1
View File
@@ -1109,7 +1109,7 @@ abstract class CommonElements {
FunctionEntity get specializedAsStringNullable =>
_findRtiFunction('_asStringQ');
FunctionEntity get instantiatedGenericFunctionTypeNewRti =>
FunctionEntity get instantiatedGenericFunctionType =>
_findRtiFunction('instantiatedGenericFunctionType');
FunctionEntity get closureFunctionType =>
-2
View File
@@ -531,7 +531,6 @@ Future<api.CompilationResult> compile(
_OneOption(Flags.generateCodeWithCompileTimeErrors, ignoreOption),
_OneOption(Flags.useMultiSourceInfo, passThrough),
_OneOption(Flags.useNewSourceInfo, passThrough),
_OneOption(Flags.useOldRti, passThrough),
_OneOption(Flags.useSimpleLoadIds, passThrough),
_OneOption(Flags.testMode, passThrough),
_OneOption('${Flags.dumpSsa}=.+', passThrough),
@@ -552,7 +551,6 @@ Future<api.CompilationResult> compile(
_OneOption(Flags.experimentToBoolean, passThrough),
_OneOption(Flags.experimentUnreachableMethodsThrow, passThrough),
_OneOption(Flags.experimentCallInstrumentation, passThrough),
_OneOption(Flags.experimentNewRti, ignoreOption),
_OneOption('${Flags.mergeFragmentsThreshold}=.+', passThrough),
// Wire up feature flags.
@@ -237,7 +237,7 @@ class EntityDataInfoBuilder {
break;
case TypeUseKind.rtiValue:
case TypeUseKind.typeArgument:
case TypeUseKind.namedTypeVariableNewRti:
case TypeUseKind.namedTypeVariable:
case TypeUseKind.constructorReference:
failedAt(parent!, "Unexpected type use: $typeUse.");
}
@@ -98,7 +98,7 @@ class BackendImpacts {
late final BackendImpact getRuntimeTypeArgument = BackendImpact(
globalUses: [],
otherImpacts: [newRtiImpact],
otherImpacts: [rtiImpact],
);
late final BackendImpact computeSignature = BackendImpact(
@@ -153,7 +153,7 @@ class BackendImpacts {
late final BackendImpact asCheck = BackendImpact(
staticUses: [],
otherImpacts: [newRtiImpact],
otherImpacts: [rtiImpact],
);
late final BackendImpact stringValues = BackendImpact(
@@ -322,7 +322,7 @@ class BackendImpacts {
);
late final BackendImpact typeCheck = BackendImpact(
otherImpacts: [boolValues, newRtiImpact],
otherImpacts: [boolValues, rtiImpact],
);
late final BackendImpact genericTypeCheck = BackendImpact(
@@ -330,26 +330,26 @@ class BackendImpacts {
// TODO(johnniwinther): Investigate why this is needed.
_commonElements.setArrayType,
],
otherImpacts: [listValues, getRuntimeTypeArgument, newRtiImpact],
otherImpacts: [listValues, getRuntimeTypeArgument, rtiImpact],
);
late final BackendImpact genericIsCheck = BackendImpact(
otherImpacts: [intValues, newRtiImpact],
otherImpacts: [intValues, rtiImpact],
);
late final BackendImpact typeVariableTypeCheck = BackendImpact(
staticUses: [],
otherImpacts: [newRtiImpact],
otherImpacts: [rtiImpact],
);
late final BackendImpact functionTypeCheck = BackendImpact(
staticUses: [/*helpers.functionTypeTestMetaHelper*/],
otherImpacts: [newRtiImpact],
otherImpacts: [rtiImpact],
);
late final BackendImpact futureOrTypeCheck = BackendImpact(
staticUses: [],
otherImpacts: [newRtiImpact],
otherImpacts: [rtiImpact],
);
late final BackendImpact nativeTypeCheck = BackendImpact(
@@ -359,7 +359,7 @@ class BackendImpacts {
// [:defineProperty:] is compiled.
_commonElements.defineProperty,
],
otherImpacts: [newRtiImpact],
otherImpacts: [rtiImpact],
);
late final BackendImpact closure = BackendImpact(
@@ -532,7 +532,7 @@ class BackendImpacts {
_genericInstantiation[typeArgumentCount] ??= BackendImpact(
staticUses: [
_commonElements.getInstantiateFunction(typeArgumentCount),
_commonElements.instantiatedGenericFunctionTypeNewRti,
_commonElements.instantiatedGenericFunctionType,
_commonElements.closureFunctionType,
],
instantiatedClasses: [
@@ -541,7 +541,7 @@ class BackendImpacts {
);
// TODO(sra): Split into refined impacts.
late final BackendImpact newRtiImpact = BackendImpact(
late final BackendImpact rtiImpact = BackendImpact(
staticUses: [
if (_options.interopNullAssertions) _commonElements.interopNullAssertion,
_commonElements.findType,
@@ -45,7 +45,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
final CodegenWorldBuilder _worldBuilder;
bool _isNoSuchMethodUsed = false;
bool _isNewRtiUsed = false;
bool _isRtiUsed = false;
CodegenEnqueuerListener(
this._options,
@@ -149,30 +149,30 @@ class CodegenEnqueuerListener extends EnqueuerListener {
}
// TODO(fishythefish): Avoid registering unnecessary impacts.
if (!_isNewRtiUsed) {
WorldImpactBuilderImpl newRtiImpact = WorldImpactBuilderImpl();
newRtiImpact.registerStaticUse(
if (!_isRtiUsed) {
WorldImpactBuilderImpl rtiImpact = WorldImpactBuilderImpl();
rtiImpact.registerStaticUse(
StaticUse.staticInvoke(
_commonElements.rtiAddRulesMethod,
CallStructure.twoArgs,
),
);
newRtiImpact.registerStaticUse(
rtiImpact.registerStaticUse(
StaticUse.staticInvoke(
_commonElements.rtiAddErasedTypesMethod,
CallStructure.twoArgs,
),
);
if (_options.enableVariance) {
newRtiImpact.registerStaticUse(
rtiImpact.registerStaticUse(
StaticUse.staticInvoke(
_commonElements.rtiAddTypeParameterVariancesMethod,
CallStructure.twoArgs,
),
);
}
enqueuer.applyImpact(newRtiImpact);
_isNewRtiUsed = true;
enqueuer.applyImpact(rtiImpact);
_isRtiUsed = true;
}
if (_nativeData.isAllowInteropUsed) {
@@ -257,7 +257,7 @@ class CodegenEnqueuerListener extends EnqueuerListener {
impactBuilder.registerStaticUse(
StaticUse.staticInvoke(
_commonElements.instantiatedGenericFunctionTypeNewRti,
_commonElements.instantiatedGenericFunctionType,
CallStructure.twoArgs,
),
);
@@ -273,7 +273,7 @@ class ConstantEmitter extends ModularConstantEmitter {
.toList(growable: false);
js_ast.ArrayInitializer array = js_ast.ArrayInitializer(elements);
js_ast.Expression value = _makeConstantList(array);
return maybeAddListTypeArgumentsNewRti(constant, constant.type, value);
return maybeAddListTypeArguments(constant, constant.type, value);
}
@override
@@ -296,7 +296,7 @@ class ConstantEmitter extends ModularConstantEmitter {
_constantReferenceGenerator(constant.indexObject!),
js.number(constant.length),
if (_rtiNeed.classNeedsTypeArguments(classElement))
_reifiedTypeNewRti(sourceType),
_reifiedType(sourceType),
];
js_ast.Expression constructor = _emitter.constructorAccess(classElement);
return js_ast.New(constructor, arguments);
@@ -313,7 +313,7 @@ class ConstantEmitter extends ModularConstantEmitter {
_constantReferenceGenerator(value),
]),
if (_rtiNeed.classNeedsTypeArguments(classElement))
_reifiedTypeNewRti(sourceType),
_reifiedType(sourceType),
];
js_ast.Expression constructor = _emitter.constructorAccess(classElement);
return js_ast.New(constructor, arguments);
@@ -412,7 +412,7 @@ class ConstantEmitter extends ModularConstantEmitter {
}
if (_rtiNeed.classNeedsTypeArguments(classElement)) {
arguments.add(_reifiedTypeNewRti(constant.type));
arguments.add(_reifiedType(constant.type));
}
js_ast.Expression constructor = _emitter.constructorAccess(classElement);
@@ -491,7 +491,7 @@ class ConstantEmitter extends ModularConstantEmitter {
}
});
if (_rtiNeed.classNeedsTypeArguments(constant.type.element)) {
fields.add(_reifiedTypeNewRti(constant.type));
fields.add(_reifiedType(constant.type));
}
return js_ast.New(constructor, fields);
}
@@ -527,7 +527,7 @@ class ConstantEmitter extends ModularConstantEmitter {
_constantReferenceGenerator(constant.function),
];
fields.add(
_reifiedTypeNewRti(
_reifiedType(
_commonElements.dartTypes.interfaceType(cls, constant.typeArguments),
),
);
@@ -539,7 +539,7 @@ class ConstantEmitter extends ModularConstantEmitter {
return rawJavaScript.replaceAll(commentRE, '');
}
js_ast.Expression maybeAddListTypeArgumentsNewRti(
js_ast.Expression maybeAddListTypeArguments(
ConstantValue constant,
InterfaceType type,
js_ast.Expression value,
@@ -548,13 +548,13 @@ class ConstantEmitter extends ModularConstantEmitter {
if (_rtiNeed.classNeedsTypeArguments(type.element)) {
return js_ast.Call(getHelperProperty(_commonElements.setArrayType), [
value,
_reifiedTypeNewRti(type),
_reifiedType(type),
]);
}
return value;
}
js_ast.Expression _reifiedTypeNewRti(DartType type) {
js_ast.Expression _reifiedType(DartType type) {
assert(!type.containsTypeVariables);
return TypeReference(TypeExpressionRecipe(type))..forConstant = true;
}
@@ -240,8 +240,8 @@ class CodegenEnqueuer extends Enqueuer {
break;
case TypeUseKind.constInstantiation:
failedAt(currentElementSpannable, "Unexpected type use: $typeUse.");
case TypeUseKind.namedTypeVariableNewRti:
_registerNamedTypeVariableNewRti(type as TypeVariableType);
case TypeUseKind.namedTypeVariable:
_registerNamedTypeVariable(type as TypeVariableType);
break;
}
}
@@ -260,8 +260,8 @@ class CodegenEnqueuer extends Enqueuer {
worldBuilder.registerIsCheck(type);
}
void _registerNamedTypeVariableNewRti(TypeVariableType type) {
worldBuilder.registerNamedTypeVariableNewRti(type);
void _registerNamedTypeVariable(TypeVariableType type) {
worldBuilder.registerNamedTypeVariable(type);
}
void _registerClosurizedMember(FunctionEntity element) {
@@ -259,7 +259,7 @@ class _RecipeGenerator implements DartTypeVisitor<void, void> {
return;
}
js_ast.Name name = _emitter.typeVariableAccessNewRti(type.element);
js_ast.Name name = _emitter.typeVariableAccess(type.element);
_emitName(name);
typeVariables.add(type);
return;
@@ -295,7 +295,7 @@ class _RecipeGenerator implements DartTypeVisitor<void, void> {
@override
void visitInterfaceType(InterfaceType type, _) {
js_ast.Name name = _emitter.typeAccessNewRti(type.element);
js_ast.Name name = _emitter.typeAccess(type.element);
if (type.typeArguments.isEmpty) {
// Push the name, which is later converted by an implicit toType
// operation.
@@ -543,11 +543,11 @@ class RulesetEncoder {
MapEntry<ClassEntity, ClassEntity> redirection,
) => js.concatenateStrings([
_doubleQuote,
_emitter.typeAccessNewRti(redirection.key),
_emitter.typeAccess(redirection.key),
_doubleQuote,
_colon,
_doubleQuote,
_emitter.typeAccessNewRti(redirection.value),
_emitter.typeAccess(redirection.value),
_doubleQuote,
]);
@@ -555,7 +555,7 @@ class RulesetEncoder {
MapEntry<InterfaceType, _RulesetEntry> entry,
) => js.concatenateStrings([
_doubleQuote,
_emitter.typeAccessNewRti(entry.key.element),
_emitter.typeAccess(entry.key.element),
_doubleQuote,
_colon,
_leftBrace,
@@ -576,7 +576,7 @@ class RulesetEncoder {
InterfaceType supertype,
) => js.concatenateStrings([
_doubleQuote,
_emitter.typeAccessNewRti(supertype.element),
_emitter.typeAccess(supertype.element),
_doubleQuote,
_colon,
_leftBracket,
@@ -596,7 +596,7 @@ class RulesetEncoder {
DartType supertypeArgument,
) => js.concatenateStrings([
_doubleQuote,
_emitter.typeVariableAccessNewRti(typeVariable.element),
_emitter.typeVariableAccess(typeVariable.element),
_doubleQuote,
_colon,
_encodeSupertypeArgument(targetType, supertypeArgument),
@@ -627,7 +627,7 @@ class RulesetEncoder {
MapEntry<ClassEntity, int> entry,
) => js.concatenateStrings([
_doubleQuote,
_emitter.typeAccessNewRti(entry.key),
_emitter.typeAccess(entry.key),
_doubleQuote,
_colon,
js.number(entry.value),
@@ -648,7 +648,7 @@ class RulesetEncoder {
MapEntry<ClassEntity, List<Variance>> classEntry,
) => js.concatenateStrings([
_doubleQuote,
_emitter.typeAccessNewRti(classEntry.key),
_emitter.typeAccess(classEntry.key),
_doubleQuote,
_colon,
_leftBracket,
@@ -710,4 +710,4 @@ int? indexTypeVariable(
bool mustCheckAllSubtypes(JClosedWorld world, ClassEntity cls) =>
world.isUsedAsMixin(cls) ||
world.extractTypeArgumentsInterfacesNewRti.contains(cls);
world.extractTypeArgumentsInterfaces.contains(cls);
@@ -178,10 +178,10 @@ abstract class ModularEmitter {
js_ast.Expression constructorAccess(ClassEntity e);
/// Returns the JS name representing the type [e].
js_ast.Name typeAccessNewRti(ClassEntity e);
js_ast.Name typeAccess(ClassEntity e);
/// Returns the JS name representing the type variable [e].
js_ast.Name typeVariableAccessNewRti(TypeVariableEntity e);
js_ast.Name typeVariableAccess(TypeVariableEntity e);
/// Returns the JS code for accessing the embedded [global].
js_ast.Expression generateEmbeddedGlobalAccess(String global);
@@ -114,7 +114,7 @@ class InstantiationStubGenerator {
///
/// ```
/// $signature:: function() {
/// return H.instantiatedGenericFunctionTypeNewRti(
/// return H.instantiatedGenericFunctionType(
/// H.closureFunctionType(this._genericClosure),
/// this.$ti);
/// }
@@ -124,7 +124,7 @@ class InstantiationStubGenerator {
_namer.fixedNames.operatorSignature,
);
js_ast.Fun function = _generateSignatureNewRti(functionField);
js_ast.Fun function = _generateSignature(functionField);
// TODO(sra): Generate source information for stub that has no member.
// TODO(sra): .withSourceInformation(sourceInformation);
@@ -137,10 +137,10 @@ class InstantiationStubGenerator {
);
}
js_ast.Fun _generateSignatureNewRti(FieldEntity functionField) =>
js_ast.Fun _generateSignature(FieldEntity functionField) =>
js('function() { return #(#(this.#), this.#); }', [
_emitter.staticFunctionAccess(
_commonElements.instantiatedGenericFunctionTypeNewRti,
_commonElements.instantiatedGenericFunctionType,
),
_emitter.staticFunctionAccess(_commonElements.closureFunctionType),
_namer.instanceFieldPropertyName(functionField),
@@ -145,7 +145,7 @@ class MetadataCollector implements js_ast.TokenFinalizer {
return _addTypeInOutputUnit(type, outputUnit);
}
js_ast.Expression _computeTypeRepresentationNewRti(DartType type) {
js_ast.Expression _computeTypeRepresentation(DartType type) {
return _rtiRecipeEncoder.encodeGroundRecipe(
_emitter,
TypeExpressionRecipe(type),
@@ -156,7 +156,7 @@ class MetadataCollector implements js_ast.TokenFinalizer {
final typeMap = _typesMap[outputUnit] ??= {};
final metadataEntryList =
(typeMap[type] ??= [
BoundMetadataEntry(_computeTypeRepresentationNewRti(type)),
BoundMetadataEntry(_computeTypeRepresentation(type)),
]);
return metadataEntryList.single;
}
@@ -101,7 +101,7 @@ class ProgramBuilder {
/// True if the program should store function types in the metadata.
bool _storeFunctionTypesInMetadata = false;
final Set<TypeVariableType> _lateNamedTypeVariablesNewRti = {};
final Set<TypeVariableType> _lateNamedTypeVariables = {};
ClassHierarchy get _classHierarchy => _closedWorld.classHierarchy;
DartTypes get _dartTypes => _closedWorld.dartTypes;
@@ -262,7 +262,7 @@ class ProgramBuilder {
_markEagerClasses();
associateNamedTypeVariablesNewRti();
associateNamedTypeVariables();
bool needsNativeSupport =
_nativeCodegenEnqueuer.hasInstantiatedNativeClasses ||
@@ -914,9 +914,9 @@ class ProgramBuilder {
() => ClassTypeData(cls, _rtiChecks.requiredChecks[cls]),
);
void associateNamedTypeVariablesNewRti() {
for (TypeVariableType typeVariable in _codegenWorld.namedTypeVariablesNewRti
.union(_lateNamedTypeVariablesNewRti)) {
void associateNamedTypeVariables() {
for (TypeVariableType typeVariable in _codegenWorld.namedTypeVariables
.union(_lateNamedTypeVariables)) {
final declaration = typeVariable.element.typeDeclaration as ClassEntity;
Iterable<ClassEntity> subtypes =
new_rti.mustCheckAllSubtypes(_closedWorld, declaration)
@@ -1086,12 +1086,6 @@ class ProgramBuilder {
ClassEntity? enclosingClass,
FunctionType type,
OutputUnit outputUnit,
) => _generateFunctionTypeNewRti(enclosingClass, type, outputUnit);
js.Expression _generateFunctionTypeNewRti(
ClassEntity? enclosingClass,
FunctionType type,
OutputUnit outputUnit,
) {
InterfaceType? enclosingType;
if (enclosingClass != null && type.containsTypeVariables) {
@@ -1118,7 +1112,7 @@ class ProgramBuilder {
FullTypeEnvironmentStructure(classType: enclosingType),
TypeExpressionRecipe(type),
);
_lateNamedTypeVariablesNewRti.addAll(encoding.typeVariables);
_lateNamedTypeVariables.addAll(encoding.typeVariables);
return encoding.recipe;
} else {
return _task.metadataCollector.reifyType(type, outputUnit);
@@ -79,12 +79,12 @@ abstract class ModularEmitterBase implements ModularEmitter {
}
@override
js.Name typeAccessNewRti(ClassEntity element) {
js.Name typeAccess(ClassEntity element) {
return _namer.className(element);
}
@override
js.Name typeVariableAccessNewRti(TypeVariableEntity element) {
js.Name typeVariableAccess(TypeVariableEntity element) {
return _namer.globalNameForInterfaceTypeVariable(element);
}
+6 -6
View File
@@ -101,7 +101,7 @@ class JClosedWorld implements World {
/// Returns the set of interfaces passed as type arguments to the internal
/// `extractTypeArguments` function.
final Set<ClassEntity> extractTypeArgumentsInterfacesNewRti;
final Set<ClassEntity> extractTypeArgumentsInterfaces;
final ClassHierarchy classHierarchy;
@@ -133,7 +133,7 @@ class JClosedWorld implements World {
this.liveAbstractInstanceMembers,
this.assignedInstanceMembers,
this.processedMembers,
this.extractTypeArgumentsInterfacesNewRti,
this.extractTypeArgumentsInterfaces,
this.mixinUses,
this.typesImplementedBySubclasses,
this.classHierarchy,
@@ -192,7 +192,7 @@ class JClosedWorld implements World {
Set<ClassEntity> implementedClasses = source.readClasses().toSet();
Set<ClassEntity> liveNativeClasses = source.readClasses().toSet();
Set<ClassEntity> extractTypeArgumentsInterfacesNewRti =
Set<ClassEntity> extractTypeArgumentsInterfaces =
source.readClasses().toSet();
Set<MemberEntity> liveInstanceMembers = source.readMembers().toSet();
Set<MemberEntity> liveAbstractInstanceMembers =
@@ -242,7 +242,7 @@ class JClosedWorld implements World {
liveAbstractInstanceMembers,
assignedInstanceMembers,
processedMembers,
extractTypeArgumentsInterfacesNewRti,
extractTypeArgumentsInterfaces,
mixinUses,
typesImplementedBySubclasses,
classHierarchy,
@@ -268,7 +268,7 @@ class JClosedWorld implements World {
noSuchMethodData.writeToDataSink(sink);
sink.writeClasses(implementedClasses);
sink.writeClasses(liveNativeClasses);
sink.writeClasses(extractTypeArgumentsInterfacesNewRti);
sink.writeClasses(extractTypeArgumentsInterfaces);
sink.writeMembers(liveInstanceMembers);
sink.writeMembers(liveAbstractInstanceMembers);
sink.writeMembers(assignedInstanceMembers);
@@ -704,7 +704,7 @@ class JClosedWorld implements World {
/// Registers [interface] as a type argument to `extractTypeArguments`.
void registerExtractTypeArguments(ClassEntity interface) {
extractTypeArgumentsInterfacesNewRti.add(interface);
extractTypeArgumentsInterfaces.add(interface);
}
late final Set<ClassEntity> _defaultSuperclasses = {
@@ -150,7 +150,7 @@ class JClosedWorldBuilder {
closedWorld.liveMemberUsage.keys,
);
Set<ClassEntity> extractTypeArgumentsInterfacesNewRti = {};
Set<ClassEntity> extractTypeArgumentsInterfaces = {};
RuntimeTypesNeed rtiNeed;
@@ -281,7 +281,7 @@ class JClosedWorldBuilder {
liveAbstractInstanceMembers,
assignedInstanceMembers,
processedMembers,
extractTypeArgumentsInterfacesNewRti,
extractTypeArgumentsInterfaces,
mixinUses,
typesImplementedBySubclasses,
ClassHierarchyImpl(
@@ -61,7 +61,7 @@ class KClosedWorld implements BuiltWorld {
final Set<DartType> isChecks;
@override
final Set<TypeVariableType> namedTypeVariablesNewRti;
final Set<TypeVariableType> namedTypeVariables;
final Map<Entity, Set<DartType>> staticTypeArgumentDependencies;
@@ -114,7 +114,7 @@ class KClosedWorld implements BuiltWorld {
required this.classHierarchy,
required this.annotationsData,
required this.isChecks,
required this.namedTypeVariablesNewRti,
required this.namedTypeVariables,
required this.staticTypeArgumentDependencies,
required this.dynamicTypeArgumentDependencies,
required this.typeVariableTypeLiterals,
@@ -256,8 +256,8 @@ class ResolutionEnqueuer extends Enqueuer {
case TypeUseKind.typeArgument:
case TypeUseKind.constructorReference:
failedAt(currentElementSpannable, "Unexpected type use: $typeUse.");
case TypeUseKind.namedTypeVariableNewRti:
_registerNamedTypeVariableNewRti(type as TypeVariableType);
case TypeUseKind.namedTypeVariable:
_registerNamedTypeVariable(type as TypeVariableType);
break;
}
}
@@ -270,8 +270,8 @@ class ResolutionEnqueuer extends Enqueuer {
worldBuilder.registerIsCheck(type);
}
void _registerNamedTypeVariableNewRti(TypeVariableType type) {
worldBuilder.registerNamedTypeVariableNewRti(type);
void _registerNamedTypeVariable(TypeVariableType type) {
worldBuilder.registerNamedTypeVariable(type);
}
void _registerClosurizedMember(FunctionEntity element) {
+2 -2
View File
@@ -568,7 +568,7 @@ class KernelSsaGraphBuilder extends ir.VisitorDefault<void>
"$targetElement inside a non-closure: $target",
);
}
_buildMethodSignatureNewRti(originalClosureNode);
_buildMethodSignature(originalClosureNode);
break;
case MemberKind.parameterStub:
_buildParameterStub(
@@ -1380,7 +1380,7 @@ class KernelSsaGraphBuilder extends ir.VisitorDefault<void>
}
/// Constructs a special signature function for a closure.
void _buildMethodSignatureNewRti(ir.FunctionNode originalClosureNode) {
void _buildMethodSignature(ir.FunctionNode originalClosureNode) {
// The signature function has no corresponding ir.Node, so we just use the
// targetElement to set up the type environment.
_openFunction(targetElement, checks: TargetChecks.none);
+1 -1
View File
@@ -3880,7 +3880,7 @@ class SsaCodeGenerator implements HVisitor<void>, HBlockInformationVisitor {
js.Expression recipe = encoding.recipe;
for (TypeVariableType typeVariable in encoding.typeVariables) {
_registry.registerTypeUse(TypeUse.namedTypeVariableNewRti(typeVariable));
_registry.registerTypeUse(TypeUse.namedTypeVariable(typeVariable));
}
final method = _commonElements.rtiEvalMethod;
+3 -3
View File
@@ -250,7 +250,7 @@ class SsaFunctionCompiler implements FunctionCompiler {
/// added as a function parameter to the rewritten code.
// TODO(sra): We could also return an empty list if the generator takes no
// type (e.g. due to rtiNeed optimization).
List<js.Expression>? _fetchItemTypeNewRti(
List<js.Expression>? _fetchItemType(
CommonElements commonElements,
CodegenRegistry registry,
DartType? type,
@@ -277,7 +277,7 @@ class SsaFunctionCompiler implements FunctionCompiler {
FunctionEntity startFunction = commonElements.asyncHelperStartSync;
FunctionEntity completerFactory = commonElements.asyncAwaitCompleterFactory;
final itemTypeExpression = _fetchItemTypeNewRti(
final itemTypeExpression = _fetchItemType(
commonElements,
registry,
elementType,
@@ -353,7 +353,7 @@ class SsaFunctionCompiler implements FunctionCompiler {
DartType? asyncTypeParameter,
js.Name name,
) {
final itemTypeExpression = _fetchItemTypeNewRti(
final itemTypeExpression = _fetchItemType(
commonElements,
registry,
asyncTypeParameter,
@@ -161,7 +161,7 @@ class CodegenWorldBuilder extends WorldBuilder {
final Set<DartType> _constTypeLiterals = {};
final Set<DartType> _liveTypeArguments = {};
final Set<TypeVariableType> _namedTypeVariablesNewRti = {};
final Set<TypeVariableType> _namedTypeVariables = {};
final Set<ClassEntity> _constructorReferences = {};
final Map<FunctionEntity, List<JParameterStub>> _parameterStubs = {};
@@ -362,8 +362,8 @@ class CodegenWorldBuilder extends WorldBuilder {
_isChecks.add(type);
}
void registerNamedTypeVariableNewRti(TypeVariableType type) {
_namedTypeVariablesNewRti.add(type);
void registerNamedTypeVariable(TypeVariableType type) {
_namedTypeVariables.add(type);
}
void registerStaticUse(StaticUse staticUse, MemberUsedCallback memberUsed) {
@@ -884,7 +884,7 @@ class CodegenWorldBuilder extends WorldBuilder {
typeVariableTypeLiterals: typeVariableTypeLiterals,
instantiatedClasses: instantiatedClasses,
isChecks: _isChecks,
namedTypeVariablesNewRti: _namedTypeVariablesNewRti,
namedTypeVariables: _namedTypeVariables,
instantiatedTypes: _instantiatedTypes,
liveTypeArguments: _liveTypeArguments,
compiledConstants: _compiledConstants,
@@ -924,7 +924,7 @@ class CodegenWorldImpl implements CodegenWorld {
final Iterable<DartType> isChecks;
@override
final Set<TypeVariableType> namedTypeVariablesNewRti;
final Set<TypeVariableType> namedTypeVariables;
@override
final Iterable<InterfaceType> instantiatedTypes;
@@ -959,7 +959,7 @@ class CodegenWorldImpl implements CodegenWorld {
required this.typeVariableTypeLiterals,
required this.instantiatedClasses,
required this.isChecks,
required this.namedTypeVariablesNewRti,
required this.namedTypeVariables,
required this.instantiatedTypes,
required this.liveTypeArguments,
required Map<FunctionEntity, List<JParameterStub>> parameterStubs,
@@ -241,7 +241,7 @@ class ResolutionWorldBuilder extends WorldBuilder implements World {
final Set<FieldEntity> _fieldSetters = {};
final Set<DartType> _isChecks = {};
final Set<TypeVariableType> _namedTypeVariablesNewRti = {};
final Set<TypeVariableType> _namedTypeVariables = {};
final Set<RecordType> _instantiatedRecordTypes = {};
@@ -563,8 +563,8 @@ class ResolutionWorldBuilder extends WorldBuilder implements World {
_isChecks.add(type);
}
void registerNamedTypeVariableNewRti(TypeVariableType type) {
_namedTypeVariablesNewRti.add(type);
void registerNamedTypeVariable(TypeVariableType type) {
_namedTypeVariables.add(type);
}
/// Register the constant [use] with this world builder. Returns `true` if
@@ -1115,7 +1115,7 @@ class ResolutionWorldBuilder extends WorldBuilder implements World {
localFunctions: _localFunctions,
instantiatedTypes: instantiatedTypes,
instantiatedRecordTypes: _instantiatedRecordTypes,
namedTypeVariablesNewRti: _namedTypeVariablesNewRti,
namedTypeVariables: _namedTypeVariables,
);
if (retainDataForTesting) {
_closedWorldCache = closedWorld;
+4 -4
View File
@@ -964,7 +964,7 @@ enum TypeUseKind {
parameterCheck,
rtiValue,
typeArgument,
namedTypeVariableNewRti,
namedTypeVariable,
typeVariableBoundCheck,
}
@@ -1041,7 +1041,7 @@ class TypeUse {
case TypeUseKind.typeArgument:
sb.write('typeArg:');
break;
case TypeUseKind.namedTypeVariableNewRti:
case TypeUseKind.namedTypeVariable:
sb.write('named:');
break;
case TypeUseKind.typeVariableBoundCheck:
@@ -1141,8 +1141,8 @@ class TypeUse {
}
/// [type] used as a named type variable in a recipe.
factory TypeUse.namedTypeVariableNewRti(TypeVariableType type) =>
TypeUse.internal(type, TypeUseKind.namedTypeVariableNewRti);
factory TypeUse.namedTypeVariable(TypeVariableType type) =>
TypeUse.internal(type, TypeUseKind.namedTypeVariable);
/// [type] used as a bound on a type variable.
factory TypeUse.typeVariableBoundCheck(DartType type) =>
+1 -1
View File
@@ -22,7 +22,7 @@ abstract class BuiltWorld {
Iterable<DartType> get isChecks;
/// All type variables named in recipes.
Set<TypeVariableType> get namedTypeVariablesNewRti;
Set<TypeVariableType> get namedTypeVariables;
/// All directly instantiated types, that is, the types of
/// [directlyInstantiatedClasses].
@@ -18,7 +18,7 @@ abstract final class Instantiation extends Closure {
if (JS('bool', 'false')) {
// [instantiatedGenericFunctionType] is called from injected $signature
// methods with runtime type representations.
newRti.instantiatedGenericFunctionType(JS('', '0'), JS('', '0'));
rti.instantiatedGenericFunctionType(JS('', '0'), JS('', '0'));
}
}
@@ -107,133 +107,318 @@ final class Instantiation12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12];
}
final class Instantiation13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13> extends Instantiation {
final class Instantiation13<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13
>
extends Instantiation {
Instantiation13(Closure f) : super(f);
List get _types => [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13];
}
final class Instantiation14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14> extends Instantiation {
final class Instantiation14<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14
>
extends Instantiation {
Instantiation14(Closure f) : super(f);
List get _types =>
[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14];
List get _types => [
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
];
}
final class Instantiation15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15> extends Instantiation {
final class Instantiation15<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15
>
extends Instantiation {
Instantiation15(Closure f) : super(f);
List get _types =>
[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15];
List get _types => [
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
];
}
final class Instantiation16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16> extends Instantiation {
final class Instantiation16<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16
>
extends Instantiation {
Instantiation16(Closure f) : super(f);
List get _types =>
[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16];
List get _types => [
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
];
}
final class Instantiation17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16, T17> extends Instantiation {
final class Instantiation17<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17
>
extends Instantiation {
Instantiation17(Closure f) : super(f);
List get _types => [
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17
];
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
];
}
final class Instantiation18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16, T17, T18> extends Instantiation {
final class Instantiation18<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18
>
extends Instantiation {
Instantiation18(Closure f) : super(f);
List get _types => [
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18
];
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
];
}
final class Instantiation19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16, T17, T18, T19> extends Instantiation {
final class Instantiation19<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19
>
extends Instantiation {
Instantiation19(Closure f) : super(f);
List get _types => [
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19
];
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19,
];
}
final class Instantiation20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16, T17, T18, T19, T20> extends Instantiation {
final class Instantiation20<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19,
T20
>
extends Instantiation {
Instantiation20(Closure f) : super(f);
List get _types => [
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19,
T20
];
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19,
T20,
];
}
Instantiation instantiate1<T1>(Closure f) {
@@ -273,66 +458,331 @@ Instantiation instantiate9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(Closure f) {
}
Instantiation instantiate10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(
Closure f) {
Closure f,
) {
return Instantiation10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(f);
}
Instantiation instantiate11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(
Closure f) {
Closure f,
) {
return Instantiation11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(f);
}
Instantiation instantiate12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(
Closure f) {
Closure f,
) {
return Instantiation12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(f);
}
Instantiation
instantiate13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(
Closure f) {
return Instantiation13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13>(f);
Instantiation instantiate13<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13
>(Closure f) {
return Instantiation13<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13
>(f);
}
Instantiation
instantiate14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(
Closure f) {
return Instantiation14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
T14>(f);
Instantiation instantiate14<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14
>(Closure f) {
return Instantiation14<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14
>(f);
}
Instantiation instantiate15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15>(Closure f) {
return Instantiation15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
T14, T15>(f);
Instantiation instantiate15<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15
>(Closure f) {
return Instantiation15<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15
>(f);
}
Instantiation instantiate16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16>(Closure f) {
return Instantiation16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
T14, T15, T16>(f);
Instantiation instantiate16<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16
>(Closure f) {
return Instantiation16<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16
>(f);
}
Instantiation instantiate17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16, T17>(Closure f) {
return Instantiation17<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
T14, T15, T16, T17>(f);
Instantiation instantiate17<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17
>(Closure f) {
return Instantiation17<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17
>(f);
}
Instantiation instantiate18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16, T17, T18>(Closure f) {
return Instantiation18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
T14, T15, T16, T17, T18>(f);
Instantiation instantiate18<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18
>(Closure f) {
return Instantiation18<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18
>(f);
}
Instantiation instantiate19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16, T17, T18, T19>(Closure f) {
return Instantiation19<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
T14, T15, T16, T17, T18, T19>(f);
Instantiation instantiate19<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19
>(Closure f) {
return Instantiation19<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19
>(f);
}
Instantiation instantiate20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
T13, T14, T15, T16, T17, T18, T19, T20>(Closure f) {
return Instantiation20<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
T14, T15, T16, T17, T18, T19, T20>(f);
Instantiation instantiate20<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19,
T20
>(Closure f) {
return Instantiation20<
T1,
T2,
T3,
T4,
T5,
T6,
T7,
T8,
T9,
T10,
T11,
T12,
T13,
T14,
T15,
T16,
T17,
T18,
T19,
T20
>(f);
}
File diff suppressed because it is too large Load Diff
+23 -11
View File
@@ -8,8 +8,12 @@ part of _js_helper;
abstract final class _Record implements Record {
const _Record();
int get _shapeTag => JS('JSUInt31', '#[#]', this,
JS_GET_NAME(JsGetName.RECORD_SHAPE_TAG_PROPERTY));
int get _shapeTag => JS(
'JSUInt31',
'#[#]',
this,
JS_GET_NAME(JsGetName.RECORD_SHAPE_TAG_PROPERTY),
);
bool _sameShape(_Record other) => _shapeTag == other._shapeTag;
@@ -19,13 +23,17 @@ abstract final class _Record implements Record {
Type get runtimeType {
// TODO(51040): Consider caching.
return newRti.getRuntimeTypeOfRecord(this);
return rti.getRuntimeTypeOfRecord(this);
}
newRti.Rti _getRti() {
String recipe =
JS('', '#[#]', this, JS_GET_NAME(JsGetName.RECORD_SHAPE_TYPE_PROPERTY));
return newRti.evaluateRtiForRecord(recipe, _getFieldValues());
rti.Rti _getRti() {
String recipe = JS(
'',
'#[#]',
this,
JS_GET_NAME(JsGetName.RECORD_SHAPE_TYPE_PROPERTY),
);
return rti.evaluateRtiForRecord(recipe, _getFieldValues());
}
@override
@@ -67,8 +75,12 @@ abstract final class _Record implements Record {
}
List<Object> _computeFieldKeys() {
String recipe =
JS('', '#[#]', this, JS_GET_NAME(JsGetName.RECORD_SHAPE_TYPE_PROPERTY));
String recipe = JS(
'',
'#[#]',
this,
JS_GET_NAME(JsGetName.RECORD_SHAPE_TYPE_PROPERTY),
);
// TODO(50081): The Rti recipe format is agnostic to what the record shape
// key is. We happen to use a comma-separated list of the names for the
@@ -103,7 +115,7 @@ abstract final class _Record implements Record {
/// Entrypoint for rti library. Calls rti.evaluateRtiForRecord with components
/// of the record.
@pragma('dart2js:as:trust')
newRti.Rti getRtiForRecord(Object? record) {
rti.Rti getRtiForRecord(Object? record) {
return (record as _Record)._getRti();
}
@@ -249,7 +261,7 @@ void _recordImpactModel() {
r3 == anything();
rN == anything();
newRti.pairwiseIsTest(anything() as JSArray, anything() as JSArray);
rti.pairwiseIsTest(anything() as JSArray, anything() as JSArray);
}
// TODO(50081): Can this be `external`?
@@ -2,7 +2,7 @@
// 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.
// dart2jsOptions=--experiment-new-rti --no-minify
// dart2jsOptions=--no-minify
import "package:expect/expect.dart";
@@ -2,7 +2,7 @@
// 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.
// dart2jsOptions=--experiment-new-rti --no-minify
// dart2jsOptions=--no-minify
import 'dart:_rti' as rti;
import "package:expect/expect.dart";
@@ -2,7 +2,7 @@
// 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.
// dart2jsOptions=--experiment-new-rti --no-minify
// dart2jsOptions=--no-minify
import "package:expect/expect.dart";
@@ -2,7 +2,7 @@
// 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.
// dart2jsOptions=--experiment-new-rti --no-minify
// dart2jsOptions=--no-minify
import "package:expect/expect.dart";
import "dart:_foreign_helper" show JS;
@@ -2,8 +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.
// dart2jsOptions=--experiment-new-rti
import "package:expect/expect.dart";
int fnInt2Int(int x) => x;
@@ -2,8 +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.
// dart2jsOptions=--experiment-new-rti
// Test that some closures are 'is Function'.
import "package:expect/expect.dart";
@@ -2,8 +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.
// dart2jsOptions=--experiment-new-rti
import 'dart:_rti' as rti;
import "package:expect/expect.dart";
+1 -1
View File
@@ -2,7 +2,7 @@
// 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.
// dart2jsOptions=--experiment-new-rti --no-minify
// dart2jsOptions=--no-minify
import 'dart:_rti' as rti;
import "package:expect/expect.dart";
@@ -2,8 +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.
// dart2jsOptions=--experiment-new-rti
import "package:expect/expect.dart";
@pragma('dart2js:noInline')
@@ -2,7 +2,7 @@
// 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.
// dart2jsOptions=--omit-implicit-checks --lax-runtime-type-to-string --experiment-new-rti
// dart2jsOptions=--omit-implicit-checks --lax-runtime-type-to-string
import 'package:expect/expect.dart';
+1 -1
View File
@@ -2,7 +2,7 @@
// 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.
// dart2jsOptions=--strong --omit-implicit-checks --lax-runtime-type-to-string --experiment-new-rti
// dart2jsOptions=--strong --omit-implicit-checks --lax-runtime-type-to-string
import 'package:expect/expect.dart';