| 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 import 'dart:collection'; | 5 import 'dart:collection'; |
| 6 | 6 |
| 7 import 'package:js_runtime/shared/embedded_names.dart'; | 7 import 'package:js_runtime/shared/embedded_names.dart'; |
| 8 | 8 |
| 9 import '../closure.dart'; | 9 import '../closure.dart'; |
| 10 import '../common.dart'; | 10 import '../common.dart'; |
| (...skipping 3051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3062 var inputs = <HInstruction>[pop()]; | 3062 var inputs = <HInstruction>[pop()]; |
| 3063 push(buildInvokeSuper(Selectors.noSuchMethod_, element, inputs)); | 3063 push(buildInvokeSuper(Selectors.noSuchMethod_, element, inputs)); |
| 3064 } | 3064 } |
| 3065 | 3065 |
| 3066 /// Generate a call to a super method or constructor. | 3066 /// Generate a call to a super method or constructor. |
| 3067 void generateSuperInvoke(ast.Send node, MethodElement method, | 3067 void generateSuperInvoke(ast.Send node, MethodElement method, |
| 3068 SourceInformation sourceInformation) { | 3068 SourceInformation sourceInformation) { |
| 3069 // TODO(5347): Try to avoid the need for calling [implementation] before | 3069 // TODO(5347): Try to avoid the need for calling [implementation] before |
| 3070 // calling [makeStaticArgumentList]. | 3070 // calling [makeStaticArgumentList]. |
| 3071 Selector selector = elements.getSelector(node); | 3071 Selector selector = elements.getSelector(node); |
| 3072 assert(invariant(node, selector.applies(method.implementation), | 3072 MethodElement implementation = method.implementation; |
| 3073 message: "$selector does not apply to ${method.implementation}")); | 3073 assert(invariant(node, selector.applies(implementation), |
| 3074 message: "$selector does not apply to ${implementation}")); |
| 3074 List<HInstruction> inputs = | 3075 List<HInstruction> inputs = |
| 3075 makeStaticArgumentList(selector.callStructure, node.arguments, method); | 3076 makeStaticArgumentList(selector.callStructure, node.arguments, method); |
| 3076 push(buildInvokeSuper(selector, method, inputs, sourceInformation)); | 3077 push(buildInvokeSuper(selector, method, inputs, sourceInformation)); |
| 3077 } | 3078 } |
| 3078 | 3079 |
| 3079 /// Access the value from the super [element]. | 3080 /// Access the value from the super [element]. |
| 3080 void handleSuperGet(ast.Send node, Element element) { | 3081 void handleSuperGet(ast.Send node, Element element) { |
| 3081 Selector selector = elements.getSelector(node); | 3082 Selector selector = elements.getSelector(node); |
| 3082 SourceInformation sourceInformation = | 3083 SourceInformation sourceInformation = |
| 3083 sourceInformationBuilder.buildGet(node); | 3084 sourceInformationBuilder.buildGet(node); |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4195 receiver, | 4196 receiver, |
| 4196 rhs, | 4197 rhs, |
| 4197 elements.getOperatorSelectorInComplexSendSet(node), | 4198 elements.getOperatorSelectorInComplexSendSet(node), |
| 4198 elementInferenceResults.typeOfOperator(node), | 4199 elementInferenceResults.typeOfOperator(node), |
| 4199 node, | 4200 node, |
| 4200 sourceInformation: | 4201 sourceInformation: |
| 4201 sourceInformationBuilder.buildGeneric(node.assignmentOperator)); | 4202 sourceInformationBuilder.buildGeneric(node.assignmentOperator)); |
| 4202 } | 4203 } |
| 4203 | 4204 |
| 4204 void handleSuperSendSet(ast.SendSet node) { | 4205 void handleSuperSendSet(ast.SendSet node) { |
| 4205 Element element = elements[node]; | 4206 MemberElement element = elements[node]; |
| 4206 List<HInstruction> setterInputs = <HInstruction>[]; | 4207 List<HInstruction> setterInputs = <HInstruction>[]; |
| 4207 void generateSuperSendSet() { | 4208 void generateSuperSendSet() { |
| 4208 Selector setterSelector = elements.getSelector(node); | 4209 Selector setterSelector = elements.getSelector(node); |
| 4209 if (Elements.isUnresolved(element) || !setterSelector.applies(element)) { | 4210 if (Elements.isUnresolved(element) || !setterSelector.applies(element)) { |
| 4210 generateSuperNoSuchMethodSend(node, setterSelector, setterInputs); | 4211 generateSuperNoSuchMethodSend(node, setterSelector, setterInputs); |
| 4211 pop(); | 4212 pop(); |
| 4212 } else { | 4213 } else { |
| 4213 add(buildInvokeSuper(setterSelector, element, setterInputs)); | 4214 add(buildInvokeSuper(setterSelector, element, setterInputs)); |
| 4214 } | 4215 } |
| 4215 } | 4216 } |
| (...skipping 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6763 this.oldReturnLocal, | 6764 this.oldReturnLocal, |
| 6764 this.oldReturnType, | 6765 this.oldReturnType, |
| 6765 this.oldResolvedAst, | 6766 this.oldResolvedAst, |
| 6766 this.oldStack, | 6767 this.oldStack, |
| 6767 this.oldLocalsHandler, | 6768 this.oldLocalsHandler, |
| 6768 this.inTryStatement, | 6769 this.inTryStatement, |
| 6769 this.allFunctionsCalledOnce, | 6770 this.allFunctionsCalledOnce, |
| 6770 this.oldElementInferenceResults) | 6771 this.oldElementInferenceResults) |
| 6771 : super(function); | 6772 : super(function); |
| 6772 } | 6773 } |
| OLD | NEW |