| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 // IrNodes are kept in a separate library to have precise control over their | 5 // IrNodes are kept in a separate library to have precise control over their |
| 6 // dependencies on other parts of the system. | 6 // dependencies on other parts of the system. |
| 7 library dart2js.ir_nodes; | 7 library dart2js.ir_nodes; |
| 8 | 8 |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../constants/values.dart' as values show ConstantValue; | 10 import '../constants/values.dart' as values show ConstantValue; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } | 258 } |
| 259 | 259 |
| 260 /// Invoke a method, operator, getter, setter, or index getter/setter. | 260 /// Invoke a method, operator, getter, setter, or index getter/setter. |
| 261 /// Converting a method to a function object is treated as a getter invocation. | 261 /// Converting a method to a function object is treated as a getter invocation. |
| 262 class InvokeMethod extends Expression implements Invoke { | 262 class InvokeMethod extends Expression implements Invoke { |
| 263 Reference<Primitive> receiver; | 263 Reference<Primitive> receiver; |
| 264 Selector selector; | 264 Selector selector; |
| 265 CallingConvention callingConvention; | 265 CallingConvention callingConvention; |
| 266 final Reference<Continuation> continuation; | 266 final Reference<Continuation> continuation; |
| 267 final List<Reference<Primitive>> arguments; | 267 final List<Reference<Primitive>> arguments; |
| 268 final SourceInformation sourceInformation; |
| 268 | 269 |
| 269 InvokeMethod(Primitive receiver, | 270 InvokeMethod(Primitive receiver, |
| 270 Selector selector, | 271 Selector selector, |
| 271 Continuation continuation, | 272 Continuation continuation, |
| 272 List<Primitive> arguments) | 273 List<Primitive> arguments, |
| 274 {SourceInformation sourceInformation}) |
| 273 : this.internal(new Reference<Primitive>(receiver), | 275 : this.internal(new Reference<Primitive>(receiver), |
| 274 selector, | 276 selector, |
| 275 new Reference<Continuation>(continuation), | 277 new Reference<Continuation>(continuation), |
| 276 _referenceList(arguments)); | 278 _referenceList(arguments), |
| 279 sourceInformation); |
| 277 | 280 |
| 278 InvokeMethod.internal(this.receiver, | 281 InvokeMethod.internal(this.receiver, |
| 279 this.selector, | 282 this.selector, |
| 280 this.continuation, | 283 this.continuation, |
| 281 this.arguments, | 284 this.arguments, |
| 285 this.sourceInformation, |
| 282 [this.callingConvention = CallingConvention.DART]) { | 286 [this.callingConvention = CallingConvention.DART]) { |
| 283 assert(isValid); | 287 assert(isValid); |
| 284 } | 288 } |
| 285 | 289 |
| 286 /// Returns whether the arguments match the selector under the given calling | 290 /// Returns whether the arguments match the selector under the given calling |
| 287 /// convention. | 291 /// convention. |
| 288 /// | 292 /// |
| 289 /// This check is designed to be used in an assert, as it also checks that the | 293 /// This check is designed to be used in an assert, as it also checks that the |
| 290 /// selector, arguments, and calling convention have meaningful values. | 294 /// selector, arguments, and calling convention have meaningful values. |
| 291 bool get isValid { | 295 bool get isValid { |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 processReference(node.target); | 1260 processReference(node.target); |
| 1257 } | 1261 } |
| 1258 | 1262 |
| 1259 processTypeExpression(TypeExpression node) {} | 1263 processTypeExpression(TypeExpression node) {} |
| 1260 @override | 1264 @override |
| 1261 visitTypeExpression(TypeExpression node) { | 1265 visitTypeExpression(TypeExpression node) { |
| 1262 processTypeExpression(node); | 1266 processTypeExpression(node); |
| 1263 node.arguments.forEach(processReference); | 1267 node.arguments.forEach(processReference); |
| 1264 } | 1268 } |
| 1265 } | 1269 } |
| OLD | NEW |