| 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 final Reference<Continuation> trueContinuation; | 447 final Reference<Continuation> trueContinuation; |
| 448 final Reference<Continuation> falseContinuation; | 448 final Reference<Continuation> falseContinuation; |
| 449 | 449 |
| 450 Branch(this.condition, Continuation trueCont, Continuation falseCont) | 450 Branch(this.condition, Continuation trueCont, Continuation falseCont) |
| 451 : trueContinuation = new Reference<Continuation>(trueCont), | 451 : trueContinuation = new Reference<Continuation>(trueCont), |
| 452 falseContinuation = new Reference<Continuation>(falseCont); | 452 falseContinuation = new Reference<Continuation>(falseCont); |
| 453 | 453 |
| 454 accept(Visitor visitor) => visitor.visitBranch(this); | 454 accept(Visitor visitor) => visitor.visitBranch(this); |
| 455 } | 455 } |
| 456 | 456 |
| 457 class Identical extends Primitive { | 457 /// Marker interface for nodes that are only handled in the JavaScript backend. |
| 458 /// |
| 459 /// These nodes are generated by the unsugar step and need special translation |
| 460 /// to the Tree IR, which is implemented in JsTreeBuilder. |
| 461 abstract class JsSpecificNode {} |
| 462 |
| 463 class Identical extends Primitive implements JsSpecificNode { |
| 458 final Reference<Primitive> left; | 464 final Reference<Primitive> left; |
| 459 final Reference<Primitive> right; | 465 final Reference<Primitive> right; |
| 460 Identical(Primitive left, Primitive right) | 466 Identical(Primitive left, Primitive right) |
| 461 : left = new Reference<Primitive>(left), | 467 : left = new Reference<Primitive>(left), |
| 462 right = new Reference<Primitive>(right); | 468 right = new Reference<Primitive>(right); |
| 463 accept(Visitor visitor) => visitor.visitIdentical(this); | 469 accept(Visitor visitor) => visitor.visitIdentical(this); |
| 464 } | 470 } |
| 465 | 471 |
| 466 class Interceptor extends Primitive { | 472 class Interceptor extends Primitive implements JsSpecificNode { |
| 467 final Reference<Primitive> input; | 473 final Reference<Primitive> input; |
| 468 final Set<ClassElement> interceptedClasses; | 474 final Set<ClassElement> interceptedClasses; |
| 469 Interceptor(Primitive input, this.interceptedClasses) | 475 Interceptor(Primitive input, this.interceptedClasses) |
| 470 : this.input = new Reference<Primitive>(input); | 476 : this.input = new Reference<Primitive>(input); |
| 471 accept(Visitor visitor) => visitor.visitInterceptor(this); | 477 accept(Visitor visitor) => visitor.visitInterceptor(this); |
| 472 } | 478 } |
| 473 | 479 |
| 474 class Constant extends Primitive { | 480 class Constant extends Primitive { |
| 475 final ConstantExpression expression; | 481 final ConstantExpression expression; |
| 476 | 482 |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 | 1090 |
| 1085 void visitIdentical(Identical node) { | 1091 void visitIdentical(Identical node) { |
| 1086 visitReference(node.left); | 1092 visitReference(node.left); |
| 1087 visitReference(node.right); | 1093 visitReference(node.right); |
| 1088 } | 1094 } |
| 1089 | 1095 |
| 1090 void visitInterceptor(Interceptor node) { | 1096 void visitInterceptor(Interceptor node) { |
| 1091 visitReference(node.input); | 1097 visitReference(node.input); |
| 1092 } | 1098 } |
| 1093 } | 1099 } |
| OLD | NEW |