| 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 | 10 |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 | 317 |
| 318 String visitReifyRuntimeType(ReifyRuntimeType node) { | 318 String visitReifyRuntimeType(ReifyRuntimeType node) { |
| 319 return '(ReifyRuntimeType ${access(node.value)})'; | 319 return '(ReifyRuntimeType ${access(node.value)})'; |
| 320 } | 320 } |
| 321 | 321 |
| 322 String visitReadTypeVariable(ReadTypeVariable node) { | 322 String visitReadTypeVariable(ReadTypeVariable node) { |
| 323 return '(ReadTypeVariable ${access(node.target)}.${node.variable})'; | 323 return '(ReadTypeVariable ${access(node.target)}.${node.variable})'; |
| 324 } | 324 } |
| 325 | 325 |
| 326 String visitTypeExpression(TypeExpression node) { | 326 String visitTypeExpression(TypeExpression node) { |
| 327 String args = node.arguments.map(access).join(', '); | 327 String args = node.arguments.map(access).join(' '); |
| 328 return '(TypeExpression ${node.dartType.toString()} $args)'; | 328 return '(TypeExpression ${node.dartType} ($args))'; |
| 329 } | 329 } |
| 330 | 330 |
| 331 String visitNonTailThrow(NonTailThrow node) { | 331 String visitNonTailThrow(NonTailThrow node) { |
| 332 String value = access(node.value); | 332 String value = access(node.value); |
| 333 return '(NonTailThrow $value)'; | 333 return '(NonTailThrow $value)'; |
| 334 } | 334 } |
| 335 | 335 |
| 336 String visitCreateInvocationMirror(CreateInvocationMirror node) { | 336 String visitCreateInvocationMirror(CreateInvocationMirror node) { |
| 337 String selector = node.selector.name; | 337 String selector = node.selector.name; |
| 338 String args = node.arguments.map(access).join(', '); | 338 String args = node.arguments.map(access).join(' '); |
| 339 return '(CreateInvocationMirror $selector $args)'; | 339 return '(CreateInvocationMirror $selector ($args))'; |
| 340 } |
| 341 |
| 342 String visitApplyBuiltinOperator(ApplyBuiltinOperator node) { |
| 343 String operator = node.operator.toString(); |
| 344 String args = node.arguments.map(access).join(' '); |
| 345 return '(ApplyBuiltinOperator $operator ($args))'; |
| 340 } | 346 } |
| 341 } | 347 } |
| 342 | 348 |
| 343 class ConstantStringifier extends ConstantValueVisitor<String, Null> { | 349 class ConstantStringifier extends ConstantValueVisitor<String, Null> { |
| 344 // Some of these methods are unimplemented because we haven't had a need | 350 // Some of these methods are unimplemented because we haven't had a need |
| 345 // to print such constants. When printing is implemented, the corresponding | 351 // to print such constants. When printing is implemented, the corresponding |
| 346 // parsing support should be added to SExpressionUnstringifier.parseConstant | 352 // parsing support should be added to SExpressionUnstringifier.parseConstant |
| 347 // in the dart2js tests (currently in the file | 353 // in the dart2js tests (currently in the file |
| 348 // tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart). | 354 // tests/compiler/dart2js/backend_dart/sexpr_unstringifier.dart). |
| 349 | 355 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 void setReturnContinuation(Continuation node) { | 451 void setReturnContinuation(Continuation node) { |
| 446 assert(!_names.containsKey(node) || _names[node] == 'return'); | 452 assert(!_names.containsKey(node) || _names[node] == 'return'); |
| 447 _names[node] = 'return'; | 453 _names[node] = 'return'; |
| 448 } | 454 } |
| 449 | 455 |
| 450 String getName(Node node) { | 456 String getName(Node node) { |
| 451 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 457 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
| 452 return _names[node]; | 458 return _names[node]; |
| 453 } | 459 } |
| 454 } | 460 } |
| OLD | NEW |