| Index: sdk/lib/_internal/compiler/implementation/ssa/builder.dart
|
| ===================================================================
|
| --- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 27700)
|
| +++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
|
| @@ -3277,7 +3277,7 @@
|
| List<HInstruction> arguments) {
|
| SourceString name = selector.name;
|
|
|
| - ClassElement cls = currentElement.getEnclosingClass();
|
| + ClassElement cls = currentNonClosureClass;
|
| Element element = cls.lookupSuperMember(Compiler.NO_SUCH_METHOD);
|
| if (element.enclosingElement.declaration != compiler.objectClass) {
|
| // Register the call as dynamic if [noSuchMethod] on the super
|
| @@ -3286,8 +3286,11 @@
|
| // [JSInvocationMirror._invokeOn].
|
| compiler.enqueuer.codegen.registerSelectorUse(selector);
|
| }
|
| + String publicName = name.slowToString();
|
| + if (selector.isSetter()) publicName += '=';
|
| +
|
| Constant nameConstant = constantSystem.createString(
|
| - new DartString.literal(name.slowToString()), node);
|
| + new DartString.literal(publicName), node);
|
|
|
| String internalName = backend.namer.invocationName(selector);
|
| Constant internalNameConstant =
|
| @@ -3345,15 +3348,19 @@
|
| if (node.isPropertyAccess) {
|
| push(buildInvokeSuper(selector, element, inputs));
|
| } else if (element.isFunction() || element.isGenerativeConstructor()) {
|
| - // TODO(5347): Try to avoid the need for calling [implementation] before
|
| - // calling [addStaticSendArgumentsToList].
|
| - FunctionElement function = element.implementation;
|
| - bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
|
| - function, inputs);
|
| - if (!succeeded) {
|
| + if (selector.applies(element, compiler)) {
|
| + // TODO(5347): Try to avoid the need for calling [implementation] before
|
| + // calling [addStaticSendArgumentsToList].
|
| + FunctionElement function = element.implementation;
|
| + bool succeeded = addStaticSendArgumentsToList(selector, node.arguments,
|
| + function, inputs);
|
| + assert(succeeded);
|
| + push(buildInvokeSuper(selector, element, inputs));
|
| + } else if (element.isGenerativeConstructor()) {
|
| generateWrongArgumentCountError(node, element, node.arguments);
|
| } else {
|
| - push(buildInvokeSuper(selector, element, inputs));
|
| + addGenericSendArgumentsToList(node.arguments, inputs);
|
| + generateSuperNoSuchMethodSend(node, selector, inputs);
|
| }
|
| } else {
|
| HInstruction target = buildInvokeSuper(selector, element, inputs);
|
| @@ -3929,8 +3936,13 @@
|
| selector,
|
| inputs,
|
| isSetter: selector.isSetter() || selector.isIndexSet());
|
| - instruction.instructionType =
|
| - new HType.inferredReturnTypeForElement(element, compiler);
|
| + if (selector.isGetter()) {
|
| + instruction.instructionType =
|
| + new HType.inferredTypeForElement(element, compiler);
|
| + } else {
|
| + instruction.instructionType =
|
| + new HType.inferredReturnTypeForElement(element, compiler);
|
| + }
|
| instruction.sideEffects = compiler.world.getSideEffectsOfElement(element);
|
| return instruction;
|
| }
|
| @@ -4004,7 +4016,8 @@
|
| }
|
| }
|
| Selector setterSelector = elements.getSelector(node);
|
| - if (Elements.isUnresolved(element)) {
|
| + if (Elements.isUnresolved(element)
|
| + || !setterSelector.applies(element, compiler)) {
|
| generateSuperNoSuchMethodSend(
|
| node, setterSelector, setterInputs);
|
| pop();
|
|
|