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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 } | 283 } |
284 | 284 |
285 String visitSetMutableVariable(SetMutableVariable node) { | 285 String visitSetMutableVariable(SetMutableVariable node) { |
286 String value = access(node.value); | 286 String value = access(node.value); |
287 String body = indentBlock(() => visit(node.body)); | 287 String body = indentBlock(() => visit(node.body)); |
288 return '$indentation(SetMutableVariable ${access(node.variable)} ' | 288 return '$indentation(SetMutableVariable ${access(node.variable)} ' |
289 '$value\n$body)'; | 289 '$value\n$body)'; |
290 } | 290 } |
291 | 291 |
292 String visitTypeOperator(TypeOperator node) { | 292 String visitTypeOperator(TypeOperator node) { |
293 String value = access(node.value); | 293 String receiver = access(node.receiver); |
294 String cont = access(node.continuation); | 294 String cont = access(node.continuation); |
295 String operator = node.isTypeTest ? 'is' : 'as'; | 295 String operator = node.isTypeTest ? 'is' : 'as'; |
296 String typeArguments = node.typeArguments.map(access).join(' '); | 296 return '$indentation(TypeOperator $operator $receiver ${node.type} $cont)'; |
297 return '$indentation(TypeOperator $operator $value ${node.type} ' | |
298 '($typeArguments) $cont)'; | |
299 } | 297 } |
300 | 298 |
301 String visitLiteralList(LiteralList node) { | 299 String visitLiteralList(LiteralList node) { |
302 String values = node.values.map(access).join(' '); | 300 String values = node.values.map(access).join(' '); |
303 return '(LiteralList ($values))'; | 301 return '(LiteralList ($values))'; |
304 } | 302 } |
305 | 303 |
306 String visitLiteralMap(LiteralMap node) { | 304 String visitLiteralMap(LiteralMap node) { |
307 String keys = node.entries.map((e) => access(e.key)).join(' '); | 305 String keys = node.entries.map((e) => access(e.key)).join(' '); |
308 String values = node.entries.map((e) => access(e.value)).join(' '); | 306 String values = node.entries.map((e) => access(e.value)).join(' '); |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 void setReturnContinuation(Continuation node) { | 504 void setReturnContinuation(Continuation node) { |
507 assert(!_names.containsKey(node) || _names[node] == 'return'); | 505 assert(!_names.containsKey(node) || _names[node] == 'return'); |
508 _names[node] = 'return'; | 506 _names[node] = 'return'; |
509 } | 507 } |
510 | 508 |
511 String getName(Node node) { | 509 String getName(Node node) { |
512 if (!_names.containsKey(node)) return 'MISSING_NAME'; | 510 if (!_names.containsKey(node)) return 'MISSING_NAME'; |
513 return _names[node]; | 511 return _names[node]; |
514 } | 512 } |
515 } | 513 } |
OLD | NEW |