| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library tree_ir_nodes; | 5 library tree_ir_nodes; |
| 6 | 6 |
| 7 import '../constants/expressions.dart'; | 7 import '../constants/expressions.dart'; |
| 8 import '../constants/values.dart' as values; | 8 import '../constants/values.dart' as values; |
| 9 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; | 9 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 * A call to a static function or getter/setter to a static field. | 174 * A call to a static function or getter/setter to a static field. |
| 175 * | 175 * |
| 176 * In contrast to the CPS-based IR, the arguments can be arbitrary expressions. | 176 * In contrast to the CPS-based IR, the arguments can be arbitrary expressions. |
| 177 */ | 177 */ |
| 178 class InvokeStatic extends Expression implements Invoke { | 178 class InvokeStatic extends Expression implements Invoke { |
| 179 final Entity target; | 179 final Entity target; |
| 180 final List<Expression> arguments; | 180 final List<Expression> arguments; |
| 181 final Selector selector; | 181 final Selector selector; |
| 182 final SourceInformation sourceInformation; | 182 final SourceInformation sourceInformation; |
| 183 | 183 |
| 184 /// True if the [target] is known not to diverge or read or write any | |
| 185 /// mutable state. | |
| 186 /// | |
| 187 /// This is set for calls to `getInterceptor` and `identical` to indicate | |
| 188 /// that they can be safely be moved across an impure expression | |
| 189 /// (assuming the [arguments] are not affected by the impure expression). | |
| 190 bool isEffectivelyConstant = false; | |
| 191 | |
| 192 InvokeStatic(this.target, this.selector, this.arguments, | 184 InvokeStatic(this.target, this.selector, this.arguments, |
| 193 {this.sourceInformation}); | 185 [this.sourceInformation]); |
| 194 | 186 |
| 195 accept(ExpressionVisitor visitor) => visitor.visitInvokeStatic(this); | 187 accept(ExpressionVisitor visitor) => visitor.visitInvokeStatic(this); |
| 196 accept1(ExpressionVisitor1 visitor, arg) { | 188 accept1(ExpressionVisitor1 visitor, arg) { |
| 197 return visitor.visitInvokeStatic(this, arg); | 189 return visitor.visitInvokeStatic(this, arg); |
| 198 } | 190 } |
| 199 } | 191 } |
| 200 | 192 |
| 201 /** | 193 /** |
| 202 * A call to a method, operator, getter, setter or index getter/setter. | 194 * A call to a method, operator, getter, setter or index getter/setter. |
| 203 * | 195 * |
| (...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 | 1362 |
| 1371 /// Number of uses of the current fallthrough target. | 1363 /// Number of uses of the current fallthrough target. |
| 1372 int get useCount => _stack.last.useCount; | 1364 int get useCount => _stack.last.useCount; |
| 1373 | 1365 |
| 1374 /// Indicate that a statement will fall through to the current fallthrough | 1366 /// Indicate that a statement will fall through to the current fallthrough |
| 1375 /// target. | 1367 /// target. |
| 1376 void use() { | 1368 void use() { |
| 1377 ++_stack.last.useCount; | 1369 ++_stack.last.useCount; |
| 1378 } | 1370 } |
| 1379 } | 1371 } |
| OLD | NEW |