| 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 '../dart2jslib.dart' as dart2js; | 7 import '../dart2jslib.dart' as dart2js; |
| 8 import '../elements/elements.dart'; | 8 import '../elements/elements.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 '../util/util.dart' show CURRENT_ELEMENT_SPANNABLE; | 10 import '../util/util.dart' show CURRENT_ELEMENT_SPANNABLE; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node'); | 258 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node'); |
| 259 } | 259 } |
| 260 | 260 |
| 261 Statement visitSetField(cps_ir.SetField node) { | 261 Statement visitSetField(cps_ir.SetField node) { |
| 262 return new ExpressionStatement( | 262 return new ExpressionStatement( |
| 263 new SetField(getVariableUse(node.object), | 263 new SetField(getVariableUse(node.object), |
| 264 node.field, | 264 node.field, |
| 265 getVariableUse(node.value)), | 265 getVariableUse(node.value)), |
| 266 visit(node.body)); | 266 visit(node.body)); |
| 267 } | 267 } |
| 268 | 268 |
| 269 Expression visitInterceptor(cps_ir.Interceptor node) { | 269 Expression visitInterceptor(cps_ir.Interceptor node) { |
| 270 return new Interceptor(getVariableUse(node.input), node.interceptedClasses); | 270 return new Interceptor(getVariableUse(node.input), node.interceptedClasses); |
| 271 } | 271 } |
| 272 | 272 |
| 273 Expression visitCreateInstance(cps_ir.CreateInstance node) { | 273 Expression visitCreateInstance(cps_ir.CreateInstance node) { |
| 274 return new CreateInstance( | 274 return new CreateInstance( |
| 275 node.classElement, | 275 node.classElement, |
| 276 translateArguments(node.arguments), | 276 translateArguments(node.arguments), |
| 277 translateArguments(node.typeInformation), | 277 translateArguments(node.typeInformation), |
| 278 node.sourceInformation); | 278 node.sourceInformation); |
| 279 } | 279 } |
| 280 | 280 |
| 281 Expression visitGetField(cps_ir.GetField node) { | 281 Expression visitGetField(cps_ir.GetField node) { |
| 282 return new GetField(getVariableUse(node.object), node.field); | 282 return new GetField(getVariableUse(node.object), node.field, |
| 283 objectIsNotNull: node.objectIsNotNull); |
| 283 } | 284 } |
| 284 | 285 |
| 285 Expression visitCreateBox(cps_ir.CreateBox node) { | 286 Expression visitCreateBox(cps_ir.CreateBox node) { |
| 286 return new CreateBox(); | 287 return new CreateBox(); |
| 287 } | 288 } |
| 288 | 289 |
| 289 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { | 290 visitCreateInvocationMirror(cps_ir.CreateInvocationMirror node) { |
| 290 return new CreateInvocationMirror( | 291 return new CreateInvocationMirror( |
| 291 node.selector, | 292 node.selector, |
| 292 translateArguments(node.arguments)); | 293 translateArguments(node.arguments)); |
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 getVariableUse(node.index)); | 632 getVariableUse(node.index)); |
| 632 } | 633 } |
| 633 | 634 |
| 634 Expression visitSetIndex(cps_ir.SetIndex node) { | 635 Expression visitSetIndex(cps_ir.SetIndex node) { |
| 635 return new SetIndex(getVariableUse(node.object), | 636 return new SetIndex(getVariableUse(node.object), |
| 636 getVariableUse(node.index), | 637 getVariableUse(node.index), |
| 637 getVariableUse(node.value)); | 638 getVariableUse(node.value)); |
| 638 } | 639 } |
| 639 } | 640 } |
| 640 | 641 |
| OLD | NEW |