| 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 dart_backend.tracer; | 5 library dart_backend.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 'dart_tree.dart'; | 9 import 'dart_tree.dart'; |
| 10 | 10 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 return "$head($args)"; | 284 return "$head($args)"; |
| 285 } | 285 } |
| 286 | 286 |
| 287 String visitInvokeMethod(InvokeMethod node) { | 287 String visitInvokeMethod(InvokeMethod node) { |
| 288 String receiver = node.receiver.accept(this); | 288 String receiver = node.receiver.accept(this); |
| 289 String name = node.selector.name; | 289 String name = node.selector.name; |
| 290 String args = formatArguments(node); | 290 String args = formatArguments(node); |
| 291 return "$receiver.$name($args)"; | 291 return "$receiver.$name($args)"; |
| 292 } | 292 } |
| 293 | 293 |
| 294 String visitInvokeSuperMethod(InvokeSuperMethod node) { |
| 295 String name = node.selector.name; |
| 296 String args = formatArguments(node); |
| 297 return "super.$name($args)"; |
| 298 } |
| 299 |
| 294 String visitInvokeConstructor(InvokeConstructor node) { | 300 String visitInvokeConstructor(InvokeConstructor node) { |
| 295 String callName; | 301 String callName; |
| 296 if (node.target.name.isEmpty) { | 302 if (node.target.name.isEmpty) { |
| 297 callName = '${node.type}'; | 303 callName = '${node.type}'; |
| 298 } else { | 304 } else { |
| 299 callName = '${node.type}.${node.target.name}'; | 305 callName = '${node.type}.${node.target.name}'; |
| 300 } | 306 } |
| 301 String args = formatArguments(node); | 307 String args = formatArguments(node); |
| 302 String keyword = node.constant != null ? 'const' : 'new'; | 308 String keyword = node.constant != null ? 'const' : 'new'; |
| 303 return "$keyword $callName($args)"; | 309 return "$keyword $callName($args)"; |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 String prefix = v.element == null ? 'v' : '${v.element.name}_'; | 398 String prefix = v.element == null ? 'v' : '${v.element.name}_'; |
| 393 while (name == null || _usedNames.contains(name)) { | 399 while (name == null || _usedNames.contains(name)) { |
| 394 name = "$prefix${_counter++}"; | 400 name = "$prefix${_counter++}"; |
| 395 } | 401 } |
| 396 _names[v] = name; | 402 _names[v] = name; |
| 397 _usedNames.add(name); | 403 _usedNames.add(name); |
| 398 } | 404 } |
| 399 return name; | 405 return name; |
| 400 } | 406 } |
| 401 } | 407 } |
| OLD | NEW |