| 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; |
| 11 import '../dart2jslib.dart' as dart2js show invariant; | 11 import '../dart2jslib.dart' as dart2js show invariant; |
| 12 import '../elements/elements.dart'; | 12 import '../elements/elements.dart'; |
| 13 import '../universe/universe.dart' show Selector, SelectorKind; | 13 import '../universe/universe.dart' show Selector, SelectorKind; |
| 14 import '../dart_types.dart' show DartType, GenericType; | 14 import '../dart_types.dart' show DartType, GenericType; |
| 15 import '../cps_ir/optimizers.dart'; | 15 import '../cps_ir/optimizers.dart'; |
| 16 import '../closure.dart' show ClosureClassElement; | |
| 17 | 16 |
| 18 abstract class Node { | 17 abstract class Node { |
| 19 /// A pointer to the parent node. Is null until set by optimization passes. | 18 /// A pointer to the parent node. Is null until set by optimization passes. |
| 20 Node parent; | 19 Node parent; |
| 21 | 20 |
| 22 accept(Visitor visitor); | 21 accept(Visitor visitor); |
| 23 } | 22 } |
| 24 | 23 |
| 25 abstract class Expression extends Node { | 24 abstract class Expression extends Node { |
| 26 Expression plug(Expression expr) => throw 'impossible'; | 25 Expression plug(Expression expr) => throw 'impossible'; |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 | 626 |
| 628 class Parameter extends Primitive { | 627 class Parameter extends Primitive { |
| 629 Parameter(Entity hint) { | 628 Parameter(Entity hint) { |
| 630 super.hint = hint; | 629 super.hint = hint; |
| 631 } | 630 } |
| 632 | 631 |
| 633 // In addition to a parent pointer to the containing Continuation or | 632 // In addition to a parent pointer to the containing Continuation or |
| 634 // FunctionDefinition, parameters have an index into the list of parameters | 633 // FunctionDefinition, parameters have an index into the list of parameters |
| 635 // bound by the parent. This gives constant-time access to the continuation | 634 // bound by the parent. This gives constant-time access to the continuation |
| 636 // from the parent. | 635 // from the parent. |
| 637 int parent_index; | 636 int parentIndex; |
| 638 | 637 |
| 639 accept(Visitor visitor) => visitor.visitParameter(this); | 638 accept(Visitor visitor) => visitor.visitParameter(this); |
| 640 } | 639 } |
| 641 | 640 |
| 642 /// Continuations are normally bound by 'let cont'. A continuation with one | 641 /// Continuations are normally bound by 'let cont'. A continuation with one |
| 643 /// parameter and no body is used to represent a function's return continuation. | 642 /// parameter and no body is used to represent a function's return continuation. |
| 644 /// The return continuation is bound by the Function, not by 'let cont'. | 643 /// The return continuation is bound by the Function, not by 'let cont'. |
| 645 class Continuation extends Definition<Continuation> implements InteriorNode { | 644 class Continuation extends Definition<Continuation> implements InteriorNode { |
| 646 final List<Parameter> parameters; | 645 final List<Parameter> parameters; |
| 647 Expression body = null; | 646 Expression body = null; |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 | 1335 |
| 1337 void visitIdentical(Identical node) { | 1336 void visitIdentical(Identical node) { |
| 1338 visitReference(node.left); | 1337 visitReference(node.left); |
| 1339 visitReference(node.right); | 1338 visitReference(node.right); |
| 1340 } | 1339 } |
| 1341 | 1340 |
| 1342 void visitInterceptor(Interceptor node) { | 1341 void visitInterceptor(Interceptor node) { |
| 1343 visitReference(node.input); | 1342 visitReference(node.input); |
| 1344 } | 1343 } |
| 1345 } | 1344 } |
| OLD | NEW |