| 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_builder; | 5 library tree_ir_builder; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../constants/values.dart'; | 8 import '../constants/values.dart'; |
| 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; | 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 Expression visitInterceptor(cps_ir.Interceptor node) { | 497 Expression visitInterceptor(cps_ir.Interceptor node) { |
| 498 return new Interceptor(getVariableUse(node.input), | 498 return new Interceptor(getVariableUse(node.input), |
| 499 node.interceptedClasses, | 499 node.interceptedClasses, |
| 500 node.sourceInformation); | 500 node.sourceInformation); |
| 501 } | 501 } |
| 502 | 502 |
| 503 Expression visitCreateInstance(cps_ir.CreateInstance node) { | 503 Expression visitCreateInstance(cps_ir.CreateInstance node) { |
| 504 return new CreateInstance( | 504 return new CreateInstance( |
| 505 node.classElement, | 505 node.classElement, |
| 506 translateArguments(node.arguments), | 506 translateArguments(node.arguments), |
| 507 translateArguments(node.typeInformation), | 507 getVariableUseOrNull(node.typeInformation), |
| 508 node.sourceInformation); | 508 node.sourceInformation); |
| 509 } | 509 } |
| 510 | 510 |
| 511 Expression visitGetField(cps_ir.GetField node) { | 511 Expression visitGetField(cps_ir.GetField node) { |
| 512 return new GetField(getVariableUse(node.object), node.field, | 512 return new GetField(getVariableUse(node.object), node.field, |
| 513 objectIsNotNull: !node.object.definition.type.isNullable); | 513 objectIsNotNull: !node.object.definition.type.isNullable); |
| 514 } | 514 } |
| 515 | 515 |
| 516 Expression visitCreateBox(cps_ir.CreateBox node) { | 516 Expression visitCreateBox(cps_ir.CreateBox node) { |
| 517 return new CreateBox(); | 517 return new CreateBox(); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 550 |
| 551 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { | 551 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { |
| 552 return new ReadTypeVariable( | 552 return new ReadTypeVariable( |
| 553 node.variable, | 553 node.variable, |
| 554 getVariableUse(node.target), | 554 getVariableUse(node.target), |
| 555 node.sourceInformation); | 555 node.sourceInformation); |
| 556 } | 556 } |
| 557 | 557 |
| 558 Expression visitTypeExpression(cps_ir.TypeExpression node) { | 558 Expression visitTypeExpression(cps_ir.TypeExpression node) { |
| 559 return new TypeExpression( | 559 return new TypeExpression( |
| 560 node.kind, |
| 560 node.dartType, | 561 node.dartType, |
| 561 node.arguments.map(getVariableUse).toList()); | 562 node.arguments.map(getVariableUse).toList()); |
| 562 } | 563 } |
| 563 | 564 |
| 564 Expression visitTypeTest(cps_ir.TypeTest node) { | 565 Expression visitTypeTest(cps_ir.TypeTest node) { |
| 565 Expression value = getVariableUse(node.value); | 566 Expression value = getVariableUse(node.value); |
| 566 List<Expression> typeArgs = translateArguments(node.typeArguments); | 567 List<Expression> typeArgs = translateArguments(node.typeArguments); |
| 567 return new TypeOperator(value, node.dartType, typeArgs, isTypeTest: true); | 568 return new TypeOperator(value, node.dartType, typeArgs, isTypeTest: true); |
| 568 } | 569 } |
| 569 | 570 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 | 738 |
| 738 visitFunctionDefinition(cps_ir.FunctionDefinition node) { | 739 visitFunctionDefinition(cps_ir.FunctionDefinition node) { |
| 739 unexpectedNode(node); | 740 unexpectedNode(node); |
| 740 } | 741 } |
| 741 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); | 742 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); |
| 742 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); | 743 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); |
| 743 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); | 744 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); |
| 744 visitRethrow(cps_ir.Rethrow node) => unexpectedNode(node); | 745 visitRethrow(cps_ir.Rethrow node) => unexpectedNode(node); |
| 745 visitBoundsCheck(cps_ir.BoundsCheck node) => unexpectedNode(node); | 746 visitBoundsCheck(cps_ir.BoundsCheck node) => unexpectedNode(node); |
| 746 } | 747 } |
| OLD | NEW |