| 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 import 'optimization/optimization.dart'; | 10 import 'optimization/optimization.dart'; |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 return "$head($args)"; | 326 return "$head($args)"; |
| 327 } | 327 } |
| 328 | 328 |
| 329 String visitInvokeMethod(InvokeMethod node) { | 329 String visitInvokeMethod(InvokeMethod node) { |
| 330 String receiver = node.receiver.accept(this); | 330 String receiver = node.receiver.accept(this); |
| 331 String name = node.selector.name; | 331 String name = node.selector.name; |
| 332 String args = formatArguments(node); | 332 String args = formatArguments(node); |
| 333 return "$receiver.$name($args)"; | 333 return "$receiver.$name($args)"; |
| 334 } | 334 } |
| 335 | 335 |
| 336 String visitInvokeSuperMethod(InvokeSuperMethod node) { | 336 String visitInvokeMethodDirectly(InvokeMethodDirectly node) { |
| 337 String receiver = visitExpression(node.receiver); |
| 338 String host = node.target.enclosingClass.name; |
| 337 String name = node.selector.name; | 339 String name = node.selector.name; |
| 338 String args = formatArguments(node); | 340 String args = formatArguments(node); |
| 339 return "super.$name($args)"; | 341 return "$receiver.$host::$name($args)"; |
| 340 } | 342 } |
| 341 | 343 |
| 342 String visitInvokeConstructor(InvokeConstructor node) { | 344 String visitInvokeConstructor(InvokeConstructor node) { |
| 343 String callName; | 345 String callName; |
| 344 if (node.target.name.isEmpty) { | 346 if (node.target.name.isEmpty) { |
| 345 callName = '${node.type}'; | 347 callName = '${node.type}'; |
| 346 } else { | 348 } else { |
| 347 callName = '${node.type}.${node.target.name}'; | 349 callName = '${node.type}.${node.target.name}'; |
| 348 } | 350 } |
| 349 String args = formatArguments(node); | 351 String args = formatArguments(node); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 473 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
| 472 while (name == null || _usedNames.contains(name)) { | 474 while (name == null || _usedNames.contains(name)) { |
| 473 name = "$prefix${_counter++}"; | 475 name = "$prefix${_counter++}"; |
| 474 } | 476 } |
| 475 _names[v] = name; | 477 _names[v] = name; |
| 476 _usedNames.add(name); | 478 _usedNames.add(name); |
| 477 } | 479 } |
| 478 return name; | 480 return name; |
| 479 } | 481 } |
| 480 } | 482 } |
| OLD | NEW |