| 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/universe.dart' show Selector, CallStructure; | 10 import '../universe/universe.dart' show Selector, CallStructure; |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 String method = node.method.toString(); | 330 String method = node.method.toString(); |
| 331 String receiver = access(node.receiver); | 331 String receiver = access(node.receiver); |
| 332 String args = node.arguments.map(access).join(' '); | 332 String args = node.arguments.map(access).join(' '); |
| 333 return '(ApplyBuiltinMethod $method $receiver ($args))'; | 333 return '(ApplyBuiltinMethod $method $receiver ($args))'; |
| 334 } | 334 } |
| 335 | 335 |
| 336 String visitForeignCode(ForeignCode node) { | 336 String visitForeignCode(ForeignCode node) { |
| 337 String arguments = node.arguments.map(access).join(' '); | 337 String arguments = node.arguments.map(access).join(' '); |
| 338 String continuation = node.continuation == null ? '' | 338 String continuation = node.continuation == null ? '' |
| 339 : ' ${access(node.continuation)}'; | 339 : ' ${access(node.continuation)}'; |
| 340 return '(JS ${node.type} ${node.codeTemplate} ($arguments)$continuation)'; | 340 return '$indentation(JS "${node.codeTemplate.source}"' |
| 341 ' ($arguments)$continuation)'; |
| 341 } | 342 } |
| 342 | 343 |
| 343 String visitGetLength(GetLength node) { | 344 String visitGetLength(GetLength node) { |
| 344 String object = access(node.object); | 345 String object = access(node.object); |
| 345 return '(GetLength $object)'; | 346 return '(GetLength $object)'; |
| 346 } | 347 } |
| 347 | 348 |
| 348 String visitGetIndex(GetIndex node) { | 349 String visitGetIndex(GetIndex node) { |
| 349 String object = access(node.object); | 350 String object = access(node.object); |
| 350 String index = access(node.index); | 351 String index = access(node.index); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 void setReturnContinuation(Continuation node) { | 472 void setReturnContinuation(Continuation node) { |
| 472 assert(!_names.containsKey(node) || _names[node] == 'return'); | 473 assert(!_names.containsKey(node) || _names[node] == 'return'); |
| 473 _names[node] = 'return'; | 474 _names[node] = 'return'; |
| 474 } | 475 } |
| 475 | 476 |
| 476 String getName(Node node) { | 477 String getName(Node node) { |
| 477 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 478 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
| 478 return _names[node]; | 479 return _names[node]; |
| 479 } | 480 } |
| 480 } | 481 } |
| OLD | NEW |