| 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_tracer; | 5 library tree_ir_tracer; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink; | 7 import 'dart:async' show EventSink; |
| 8 import '../tracer.dart'; | 8 import '../tracer.dart'; |
| 9 import 'tree_ir_nodes.dart'; | 9 import 'tree_ir_nodes.dart'; |
| 10 | 10 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 return "concat [$args]"; | 323 return "concat [$args]"; |
| 324 } | 324 } |
| 325 | 325 |
| 326 String visitLiteralList(LiteralList node) { | 326 String visitLiteralList(LiteralList node) { |
| 327 String values = node.values.map(visitExpression).join(', '); | 327 String values = node.values.map(visitExpression).join(', '); |
| 328 return "list [$values]"; | 328 return "list [$values]"; |
| 329 } | 329 } |
| 330 | 330 |
| 331 String visitLiteralMap(LiteralMap node) { | 331 String visitLiteralMap(LiteralMap node) { |
| 332 List<String> entries = new List<String>(); | 332 List<String> entries = new List<String>(); |
| 333 for (int i = 0; i < node.values.length; ++i) { | 333 node.entries.forEach((LiteralMapEntry entry) { |
| 334 String key = visitExpression(node.keys[i]); | 334 String key = visitExpression(entry.key); |
| 335 String value = visitExpression(node.values[i]); | 335 String value = visitExpression(entry.value); |
| 336 entries.add("$key: $value"); | 336 entries.add("$key: $value"); |
| 337 } | 337 }); |
| 338 return "map [${entries.join(', ')}]"; | 338 return "map [${entries.join(', ')}]"; |
| 339 } | 339 } |
| 340 | 340 |
| 341 String visitConstant(Constant node) { | 341 String visitConstant(Constant node) { |
| 342 return "${node.value}"; | 342 return "${node.value}"; |
| 343 } | 343 } |
| 344 | 344 |
| 345 String visitThis(This node) { | 345 String visitThis(This node) { |
| 346 return "this"; | 346 return "this"; |
| 347 } | 347 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 411 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
| 412 while (name == null || _usedNames.contains(name)) { | 412 while (name == null || _usedNames.contains(name)) { |
| 413 name = "$prefix${_counter++}"; | 413 name = "$prefix${_counter++}"; |
| 414 } | 414 } |
| 415 _names[v] = name; | 415 _names[v] = name; |
| 416 _usedNames.add(name); | 416 _usedNames.add(name); |
| 417 } | 417 } |
| 418 return name; | 418 return name; |
| 419 } | 419 } |
| 420 } | 420 } |
| OLD | NEW |