Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 2944843002: All strong mode cleaning of dart2js. (Closed)
Patch Set: More issues discovered during testing. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/source_file_provider.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index f51770f60413bffd869cf99c341ad3d60671c73c..059073f130008f27f8d5c1e4b5e6e9986c558455 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -123,7 +123,7 @@ class SsaAstBuilder extends SsaAstBuilderBase {
DiagnosticReporter get reporter => backend.reporter;
- HGraph build(ElementCodegenWorkItem work, ClosedWorld closedWorld) {
+ HGraph build(covariant ElementCodegenWorkItem work, ClosedWorld closedWorld) {
return task.measure(() {
if (handleConstantField(work, closedWorld)) {
// No code is generated for `work.element`.
@@ -3322,7 +3322,7 @@ class SsaAstGraphBuilder extends ast.Visitor
bool needsSubstitutionForTypeVariableAccess(ClassElement cls) {
if (closedWorld.isUsedAsMixin(cls)) return true;
- return closedWorld.anyStrictSubclassOf(cls, (ClassElement subclass) {
+ return closedWorld.anyStrictSubclassOf(cls, (ClassEntity subclass) {
return !rtiSubstitutions.isTrivialSubstitution(subclass, cls);
});
}
@@ -3448,7 +3448,7 @@ class SsaAstGraphBuilder extends ast.Visitor
}
}
ResolutionInterfaceType type = elements.getType(node);
- ResolutionInterfaceType expectedType =
+ ResolutionDartType expectedType =
constructorDeclaration.computeEffectiveTargetType(type);
expectedType = localsHandler.substInContext(expectedType);
@@ -3606,11 +3606,15 @@ class SsaAstGraphBuilder extends ast.Visitor
bool definitelyFails = false;
void addTypeVariableBoundCheck(
- ResolutionInterfaceType instance,
- ResolutionDartType typeArgument,
- ResolutionTypeVariableType typeVariable,
- ResolutionDartType bound) {
+ InterfaceType _instance,
+ DartType _typeArgument,
+ TypeVariableType _typeVariable,
+ DartType _bound) {
if (definitelyFails) return;
+ ResolutionInterfaceType instance = _instance;
+ ResolutionDartType typeArgument = _typeArgument;
+ ResolutionTypeVariableType typeVariable = _typeVariable;
+ ResolutionDartType bound = _bound;
int subtypeRelation = types.computeSubtypeRelation(typeArgument, bound);
if (subtypeRelation == DartTypes.IS_SUBTYPE) return;
@@ -4387,7 +4391,7 @@ class SsaAstGraphBuilder extends ast.Visitor
@override
void visitSuperMethodSet(
- ast.Send node, MethodElement method, ast.Node rhs, _) {
+ ast.SendSet node, MethodElement method, ast.Node rhs, _) {
handleSuperSendSet(node);
}
@@ -4398,8 +4402,8 @@ class SsaAstGraphBuilder extends ast.Visitor
}
@override
- void visitUnresolvedSuperIndexSet(
- ast.Send node, Element element, ast.Node index, ast.Node rhs, _) {
+ void visitUnresolvedSuperIndexSet(ast.SendSet node, ErroneousElement element,
+ ast.Node index, ast.Node rhs, _) {
handleSuperSendSet(node);
}
@@ -4426,20 +4430,20 @@ class SsaAstGraphBuilder extends ast.Visitor
}
@override
- void visitUnresolvedSuperGetterIndexPrefix(ast.Send node, Element element,
+ void visitUnresolvedSuperGetterIndexPrefix(ast.SendSet node, Element element,
MethodElement setter, ast.Node index, IncDecOperator operator, _) {
handleSuperSendSet(node);
}
@override
- void visitUnresolvedSuperGetterIndexPostfix(ast.Send node, Element element,
+ void visitUnresolvedSuperGetterIndexPostfix(ast.SendSet node, Element element,
MethodElement setter, ast.Node index, IncDecOperator operator, _) {
handleSuperSendSet(node);
}
@override
void visitUnresolvedSuperSetterIndexPrefix(
- ast.Send node,
+ ast.SendSet node,
MethodElement indexFunction,
Element element,
ast.Node index,
@@ -4450,7 +4454,7 @@ class SsaAstGraphBuilder extends ast.Visitor
@override
void visitUnresolvedSuperSetterIndexPostfix(
- ast.Send node,
+ ast.SendSet node,
MethodElement indexFunction,
Element element,
ast.Node index,
@@ -4485,7 +4489,7 @@ class SsaAstGraphBuilder extends ast.Visitor
@override
void visitUnresolvedSuperGetterCompoundIndexSet(
- ast.Send node,
+ ast.SendSet node,
Element element,
MethodElement setter,
ast.Node index,
@@ -4497,7 +4501,7 @@ class SsaAstGraphBuilder extends ast.Visitor
@override
void visitUnresolvedSuperSetterCompoundIndexSet(
- ast.Send node,
+ ast.SendSet node,
MethodElement getter,
Element element,
ast.Node index,
@@ -4508,7 +4512,7 @@ class SsaAstGraphBuilder extends ast.Visitor
}
@override
- void visitUnresolvedSuperCompoundIndexSet(ast.Send node, Element element,
+ void visitUnresolvedSuperCompoundIndexSet(ast.SendSet node, Element element,
ast.Node index, AssignmentOperator operator, ast.Node rhs, _) {
handleSuperSendSet(node);
}
@@ -4533,13 +4537,13 @@ class SsaAstGraphBuilder extends ast.Visitor
@override
void visitUnresolvedSuperPrefix(
- ast.Send node, Element element, IncDecOperator operator, _) {
+ ast.SendSet node, Element element, IncDecOperator operator, _) {
handleSuperSendSet(node);
}
@override
void visitUnresolvedSuperPostfix(
- ast.Send node, Element element, IncDecOperator operator, _) {
+ ast.SendSet node, Element element, IncDecOperator operator, _) {
handleSuperSendSet(node);
}
@@ -4574,19 +4578,19 @@ class SsaAstGraphBuilder extends ast.Visitor
}
@override
- void visitSuperMethodCompound(ast.Send node, FunctionElement method,
+ void visitSuperMethodCompound(ast.Send node, MethodElement method,
AssignmentOperator operator, ast.Node rhs, _) {
handleSuperSendSet(node);
}
@override
- void visitUnresolvedSuperGetterCompound(ast.Send node, Element element,
- MethodElement setter, AssignmentOperator operator, ast.Node rhs, _) {
+ void visitUnresolvedSuperGetterCompound(ast.SendSet node, Element element,
+ SetterElement setter, AssignmentOperator operator, ast.Node rhs, _) {
handleSuperSendSet(node);
}
@override
- void visitUnresolvedSuperSetterCompound(ast.Send node, MethodElement getter,
+ void visitUnresolvedSuperSetterCompound(ast.Send node, GetterElement getter,
Element element, AssignmentOperator operator, ast.Node rhs, _) {
handleSuperSendSet(node);
}
@@ -5180,12 +5184,14 @@ class SsaAstGraphBuilder extends ast.Visitor
ClassElement targetClass = targetConstructor.enclosingClass;
if (rtiNeed.classNeedsRti(targetClass)) {
ClassElement cls = redirectingConstructor.enclosingClass;
- ResolutionInterfaceType targetType =
+ ResolutionDartType targetType =
redirectingConstructor.computeEffectiveTargetType(cls.thisType);
targetType = localsHandler.substInContext(targetType);
- targetType.typeArguments.forEach((ResolutionDartType argument) {
- inputs.add(typeBuilder.analyzeTypeArgument(argument, sourceElement));
- });
+ if (targetType is ResolutionInterfaceType) {
+ targetType.typeArguments.forEach((ResolutionDartType argument) {
+ inputs.add(typeBuilder.analyzeTypeArgument(argument, sourceElement));
+ });
+ }
}
pushInvokeStatic(node, targetConstructor.declaration, inputs);
HInstruction value = pop();
@@ -5750,14 +5756,14 @@ class SsaAstGraphBuilder extends ast.Visitor
listConstructor = constructorElement.effectiveTarget;
ResolutionInterfaceType type = elements.getType(node);
- ResolutionInterfaceType expectedType =
+ ResolutionDartType expectedType =
constructorElement.computeEffectiveTargetType(type);
expectedType = localsHandler.substInContext(expectedType);
ClassElement cls = listConstructor.enclosingClass;
MethodElement createFunction = listConstructor;
- if (rtiNeed.classNeedsRti(cls)) {
+ if (expectedType is ResolutionInterfaceType && rtiNeed.classNeedsRti(cls)) {
List<HInstruction> typeInputs = <HInstruction>[];
expectedType.typeArguments.forEach((ResolutionDartType argument) {
typeInputs
« no previous file with comments | « pkg/compiler/lib/src/source_file_provider.dart ('k') | pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698