Index: pkg/compiler/lib/src/ssa/optimize.dart |
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart |
index b4a059b286d4761d57ce362392f18afde944994c..3b99247320342eaed7f39066c26decbf94298c34 100644 |
--- a/pkg/compiler/lib/src/ssa/optimize.dart |
+++ b/pkg/compiler/lib/src/ssa/optimize.dart |
@@ -482,7 +482,7 @@ class SsaInstructionSimplifier extends HBaseVisitor |
// [:noSuchMethod:] we just ignore it. |
&& |
node.selector.applies(element)) { |
- MethodElement method = element; |
+ FunctionEntity method = element; |
if (_nativeData.isNativeMember(method)) { |
HInstruction folded = tryInlineNativeMethod(node, method); |
@@ -490,11 +490,9 @@ class SsaInstructionSimplifier extends HBaseVisitor |
} else { |
// TODO(ngeoffray): If the method has optional parameters, |
// we should pass the default values. |
- ResolutionFunctionType type = method.type; |
- int optionalParameterCount = |
- type.optionalParameterTypes.length + type.namedParameters.length; |
- if (optionalParameterCount == 0 || |
- type.parameterTypes.length + optionalParameterCount == |
+ ParameterStructure parameters = method.parameterStructure; |
+ if (parameters.optionalParameters == 0 || |
+ parameters.requiredParameters + parameters.optionalParameters == |
node.selector.argumentCount) { |
node.element = method; |
} |
@@ -1025,14 +1023,16 @@ class SsaInstructionSimplifier extends HBaseVisitor |
} |
HInstruction receiver = node.getDartReceiver(_closedWorld); |
- FieldElement field = |
+ FieldEntity field = |
findConcreteFieldForDynamicAccess(receiver, node.selector); |
if (field == null || !field.isAssignable) return node; |
// Use `node.inputs.last` in case the call follows the interceptor calling |
// convention, but is not a call on an interceptor. |
HInstruction value = node.inputs.last; |
if (_options.enableTypeAssertions) { |
- ResolutionDartType type = field.type; |
+ // TODO(johnniwinther): Support field entities. |
+ FieldElement element = field; |
+ DartType type = element.type; |
if (!type.treatAsRaw || |
type.isTypeVariable || |
type.unaliased.isFunctionType) { |