| 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 dart2js.ir_nodes_sexpr; | 5 library dart2js.ir_nodes_sexpr; |
| 6 | 6 |
| 7 import '../constants/values.dart'; | 7 import '../constants/values.dart'; |
| 8 import '../util/util.dart'; | 8 import '../util/util.dart'; |
| 9 import 'cps_ir_nodes.dart'; | 9 import 'cps_ir_nodes.dart'; |
| 10 import '../universe/call_structure.dart' show | 10 import '../universe/call_structure.dart' show |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 return '(Refinement $value ${node.type})'; | 441 return '(Refinement $value ${node.type})'; |
| 442 } | 442 } |
| 443 | 443 |
| 444 String visitBoundsCheck(BoundsCheck node) { | 444 String visitBoundsCheck(BoundsCheck node) { |
| 445 String object = access(node.object); | 445 String object = access(node.object); |
| 446 String index = optionalAccess(node.index); | 446 String index = optionalAccess(node.index); |
| 447 String length = optionalAccess(node.length); | 447 String length = optionalAccess(node.length); |
| 448 return '(BoundsCheck $object $index $length ${node.checkString})'; | 448 return '(BoundsCheck $object $index $length ${node.checkString})'; |
| 449 } | 449 } |
| 450 | 450 |
| 451 String visitNullCheck(NullCheck node) { | 451 String visitReceiverCheck(ReceiverCheck node) { |
| 452 String value = access(node.value); | 452 String value = access(node.value); |
| 453 String condition = optionalAccess(node.condition); | 453 String condition = optionalAccess(node.condition); |
| 454 return '(NullCheck $value $condition (${node.selector ?? ""}))'; | 454 return '(ReceiverCheck $value ${node.selector} $condition ' |
| 455 '${node.flagString}))'; |
| 455 } | 456 } |
| 456 } | 457 } |
| 457 | 458 |
| 458 class ConstantStringifier extends ConstantValueVisitor<String, Null> { | 459 class ConstantStringifier extends ConstantValueVisitor<String, Null> { |
| 459 // Some of these methods are unimplemented because we haven't had a need | 460 // Some of these methods are unimplemented because we haven't had a need |
| 460 // to print such constants. When printing is implemented, the corresponding | 461 // to print such constants. When printing is implemented, the corresponding |
| 461 // parsing support should be added to SExpressionUnstringifier.parseConstant | 462 // parsing support should be added to SExpressionUnstringifier.parseConstant |
| 462 // in the dart2js tests (currently in the file | 463 // in the dart2js tests (currently in the file |
| 463 // tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart). | 464 // tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart). |
| 464 | 465 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 void setReturnContinuation(Continuation node) { | 561 void setReturnContinuation(Continuation node) { |
| 561 assert(!_names.containsKey(node) || _names[node] == 'return'); | 562 assert(!_names.containsKey(node) || _names[node] == 'return'); |
| 562 _names[node] = 'return'; | 563 _names[node] = 'return'; |
| 563 } | 564 } |
| 564 | 565 |
| 565 String getName(Node node) { | 566 String getName(Node node) { |
| 566 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 567 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
| 567 return _names[node]; | 568 return _names[node]; |
| 568 } | 569 } |
| 569 } | 570 } |
| OLD | NEW |