| 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 library dart2js.ir_nodes; | 4 library dart2js.ir_nodes; |
| 5 | 5 |
| 6 import '../constants/expressions.dart'; | 6 import '../constants/expressions.dart'; |
| 7 import '../constants/values.dart' as values show ConstantValue; | 7 import '../constants/values.dart' as values show ConstantValue; |
| 8 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; | 8 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import '../io/source_information.dart' show SourceInformation; | 10 import '../io/source_information.dart' show SourceInformation; |
| 11 import '../types/types.dart' show TypeMask; |
| 11 import '../universe/universe.dart' show Selector, SelectorKind; | 12 import '../universe/universe.dart' show Selector, SelectorKind; |
| 12 | 13 |
| 13 abstract class Node { | 14 abstract class Node { |
| 14 /// A pointer to the parent node. Is null until set by optimization passes. | 15 /// A pointer to the parent node. Is null until set by optimization passes. |
| 15 Node parent; | 16 Node parent; |
| 16 | 17 |
| 17 accept(Visitor visitor); | 18 accept(Visitor visitor); |
| 18 } | 19 } |
| 19 | 20 |
| 20 /// Expressions can be evaluated, and may diverge, throw, and/or have | 21 /// Expressions can be evaluated, and may diverge, throw, and/or have |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 /// | 261 /// |
| 261 /// The [selector] records the names of named arguments. The value of named | 262 /// The [selector] records the names of named arguments. The value of named |
| 262 /// arguments occur at the end of the [arguments] list, in normalized order. | 263 /// arguments occur at the end of the [arguments] list, in normalized order. |
| 263 /// | 264 /// |
| 264 /// Discussion: | 265 /// Discussion: |
| 265 /// If the [selector] is a [TypedSelector], the type information contained | 266 /// If the [selector] is a [TypedSelector], the type information contained |
| 266 /// there is used by optimization passes. This is likely to change. | 267 /// there is used by optimization passes. This is likely to change. |
| 267 class InvokeMethod extends Expression implements Invoke { | 268 class InvokeMethod extends Expression implements Invoke { |
| 268 Reference<Primitive> receiver; | 269 Reference<Primitive> receiver; |
| 269 Selector selector; | 270 Selector selector; |
| 271 TypeMask mask; |
| 270 final List<Reference<Primitive>> arguments; | 272 final List<Reference<Primitive>> arguments; |
| 271 final Reference<Continuation> continuation; | 273 final Reference<Continuation> continuation; |
| 272 final SourceInformation sourceInformation; | 274 final SourceInformation sourceInformation; |
| 273 | 275 |
| 274 /// If true, it is known that the receiver cannot be `null`. | 276 /// If true, it is known that the receiver cannot be `null`. |
| 275 /// | 277 /// |
| 276 /// This field is `null` until initialized by optimization phases. | 278 /// This field is `null` until initialized by optimization phases. |
| 277 bool receiverIsNotNull; | 279 bool receiverIsNotNull; |
| 278 | 280 |
| 279 InvokeMethod(Primitive receiver, | 281 InvokeMethod(Primitive receiver, |
| 280 this.selector, | 282 this.selector, |
| 283 this.mask, |
| 281 List<Primitive> arguments, | 284 List<Primitive> arguments, |
| 282 Continuation continuation, | 285 Continuation continuation, |
| 283 {this.sourceInformation}) | 286 {this.sourceInformation}) |
| 284 : this.receiver = new Reference<Primitive>(receiver), | 287 : this.receiver = new Reference<Primitive>(receiver), |
| 285 this.arguments = _referenceList(arguments), | 288 this.arguments = _referenceList(arguments), |
| 286 this.continuation = new Reference<Continuation>(continuation); | 289 this.continuation = new Reference<Continuation>(continuation); |
| 287 | 290 |
| 288 accept(Visitor visitor) => visitor.visitInvokeMethod(this); | 291 accept(Visitor visitor) => visitor.visitInvokeMethod(this); |
| 289 } | 292 } |
| 290 | 293 |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 const RemovalVisitor(); | 1248 const RemovalVisitor(); |
| 1246 | 1249 |
| 1247 processReference(Reference reference) { | 1250 processReference(Reference reference) { |
| 1248 reference.unlink(); | 1251 reference.unlink(); |
| 1249 } | 1252 } |
| 1250 | 1253 |
| 1251 static void remove(Node node) { | 1254 static void remove(Node node) { |
| 1252 (const RemovalVisitor()).visit(node); | 1255 (const RemovalVisitor()).visit(node); |
| 1253 } | 1256 } |
| 1254 } | 1257 } |
| OLD | NEW |