| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 class SsaFunctionCompiler implements FunctionCompiler { | 7 class SsaFunctionCompiler implements FunctionCompiler { |
| 8 final SsaCodeGeneratorTask generator; | 8 final SsaCodeGeneratorTask generator; |
| 9 final SsaBuilderTask builder; | 9 final SsaBuilderTask builder; |
| 10 final SsaOptimizerTask optimizer; | 10 final SsaOptimizerTask optimizer; |
| (...skipping 4535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4546 targetCanThrow: false) | 4546 targetCanThrow: false) |
| 4547 ..sourceInformation = sourceInformation); | 4547 ..sourceInformation = sourceInformation); |
| 4548 } | 4548 } |
| 4549 | 4549 |
| 4550 generateSuperNoSuchMethodSend(ast.Send node, | 4550 generateSuperNoSuchMethodSend(ast.Send node, |
| 4551 Selector selector, | 4551 Selector selector, |
| 4552 List<HInstruction> arguments) { | 4552 List<HInstruction> arguments) { |
| 4553 String name = selector.name; | 4553 String name = selector.name; |
| 4554 | 4554 |
| 4555 ClassElement cls = currentNonClosureClass; | 4555 ClassElement cls = currentNonClosureClass; |
| 4556 MethodElement element = cls.lookupSuperMember(Identifiers.noSuchMethod_); | 4556 Element element = cls.lookupSuperMember(Identifiers.noSuchMethod_); |
| 4557 if (!Selectors.noSuchMethod_.signatureApplies(element)) { | |
| 4558 element = coreClasses.objectClass.lookupMember(Identifiers.noSuchMethod_); | |
| 4559 } | |
| 4560 if (compiler.enabledInvokeOn && !element.enclosingClass.isObject) { | 4557 if (compiler.enabledInvokeOn && !element.enclosingClass.isObject) { |
| 4561 // Register the call as dynamic if [noSuchMethod] on the super | 4558 // Register the call as dynamic if [noSuchMethod] on the super |
| 4562 // class is _not_ the default implementation from [Object], in | 4559 // class is _not_ the default implementation from [Object], in |
| 4563 // case the [noSuchMethod] implementation calls | 4560 // case the [noSuchMethod] implementation calls |
| 4564 // [JSInvocationMirror._invokeOn]. | 4561 // [JSInvocationMirror._invokeOn]. |
| 4565 // TODO(johnniwinther): Register this more precisely. | 4562 // TODO(johnniwinther): Register this more precisely. |
| 4566 registry?.registerDynamicUse(new DynamicUse(selector, null)); | 4563 registry?.registerDynamicUse(new DynamicUse(selector, null)); |
| 4567 } | 4564 } |
| 4568 String publicName = name; | 4565 String publicName = name; |
| 4569 if (selector.isSetter) publicName += '='; | 4566 if (selector.isSetter) publicName += '='; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4689 | 4686 |
| 4690 @override | 4687 @override |
| 4691 void visitUnresolvedSuperGet( | 4688 void visitUnresolvedSuperGet( |
| 4692 ast.Send node, | 4689 ast.Send node, |
| 4693 Element element, | 4690 Element element, |
| 4694 _) { | 4691 _) { |
| 4695 handleUnresolvedSuperInvoke(node); | 4692 handleUnresolvedSuperInvoke(node); |
| 4696 } | 4693 } |
| 4697 | 4694 |
| 4698 @override | 4695 @override |
| 4699 void visitUnresolvedSuperSet( | |
| 4700 ast.Send node, | |
| 4701 Element element, | |
| 4702 ast.Node rhs, | |
| 4703 _) { | |
| 4704 handleUnresolvedSuperInvoke(node); | |
| 4705 } | |
| 4706 | |
| 4707 @override | |
| 4708 void visitSuperSetterGet( | 4696 void visitSuperSetterGet( |
| 4709 ast.Send node, | 4697 ast.Send node, |
| 4710 MethodElement setter, | 4698 MethodElement setter, |
| 4711 _) { | 4699 _) { |
| 4712 handleUnresolvedSuperInvoke(node); | 4700 handleUnresolvedSuperInvoke(node); |
| 4713 } | 4701 } |
| 4714 | 4702 |
| 4715 @override | 4703 @override |
| 4716 void visitUnresolvedSuperInvoke( | 4704 void visitUnresolvedSuperInvoke( |
| 4717 ast.Send node, | 4705 ast.Send node, |
| (...skipping 4524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9242 if (unaliased is TypedefType) throw 'unable to unalias $type'; | 9230 if (unaliased is TypedefType) throw 'unable to unalias $type'; |
| 9243 unaliased.accept(this, builder); | 9231 unaliased.accept(this, builder); |
| 9244 } | 9232 } |
| 9245 | 9233 |
| 9246 void visitDynamicType(DynamicType type, SsaBuilder builder) { | 9234 void visitDynamicType(DynamicType type, SsaBuilder builder) { |
| 9247 JavaScriptBackend backend = builder.compiler.backend; | 9235 JavaScriptBackend backend = builder.compiler.backend; |
| 9248 ClassElement cls = backend.helpers.DynamicRuntimeType; | 9236 ClassElement cls = backend.helpers.DynamicRuntimeType; |
| 9249 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); | 9237 builder.push(new HDynamicType(type, new TypeMask.exact(cls, classWorld))); |
| 9250 } | 9238 } |
| 9251 } | 9239 } |
| OLD | NEW |