| 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_tracer; | 5 library dart2js.ir_tracer; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink; | 7 import 'dart:async' show EventSink; |
| 8 import 'cps_ir_nodes.dart' as cps_ir hide Function; | 8 import 'cps_ir_nodes.dart' as cps_ir hide Function; |
| 9 import '../tracer.dart'; | 9 import '../tracer.dart'; |
| 10 | 10 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 String args = node.arguments.map(formatReference).join(', '); | 364 String args = node.arguments.map(formatReference).join(', '); |
| 365 return 'ApplyBuiltinOperator $operator ($args)'; | 365 return 'ApplyBuiltinOperator $operator ($args)'; |
| 366 } | 366 } |
| 367 | 367 |
| 368 @override | 368 @override |
| 369 visitForeignCode(cps_ir.ForeignCode node) { | 369 visitForeignCode(cps_ir.ForeignCode node) { |
| 370 String id = names.name(node); | 370 String id = names.name(node); |
| 371 String arguments = node.arguments.map(formatReference).join(', '); | 371 String arguments = node.arguments.map(formatReference).join(', '); |
| 372 String continuation = node.continuation == null ? '' | 372 String continuation = node.continuation == null ? '' |
| 373 : ' ${formatReference(node.continuation)}'; | 373 : ' ${formatReference(node.continuation)}'; |
| 374 printStmt(id, "ForeignCode ${node.type} ${node.codeTemplate} $arguments" | 374 printStmt(id, "ForeignCode ${node.type} ${node.codeTemplate.source} " |
| 375 "$continuation"); | 375 "$arguments $continuation"); |
| 376 } | 376 } |
| 377 } | 377 } |
| 378 | 378 |
| 379 /** | 379 /** |
| 380 * Invents (and remembers) names for Continuations, Parameters, etc. | 380 * Invents (and remembers) names for Continuations, Parameters, etc. |
| 381 * The names must match the conventions used by IR Hydra, e.g. | 381 * The names must match the conventions used by IR Hydra, e.g. |
| 382 * Continuations and Functions must have names of form B### since they | 382 * Continuations and Functions must have names of form B### since they |
| 383 * are visualized as basic blocks. | 383 * are visualized as basic blocks. |
| 384 */ | 384 */ |
| 385 class Names { | 385 class Names { |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 unexpectedNode(node); | 633 unexpectedNode(node); |
| 634 } | 634 } |
| 635 | 635 |
| 636 @override | 636 @override |
| 637 visitForeignCode(cps_ir.ForeignCode node) { | 637 visitForeignCode(cps_ir.ForeignCode node) { |
| 638 if (node.continuation != null) { | 638 if (node.continuation != null) { |
| 639 addEdgeToContinuation(node.continuation); | 639 addEdgeToContinuation(node.continuation); |
| 640 } | 640 } |
| 641 } | 641 } |
| 642 } | 642 } |
| OLD | NEW |