| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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('tracer'); | 5 #library('tracer'); |
| 6 | 6 |
| 7 #import('dart:io'); | 7 #import('dart:io'); |
| 8 #import('ssa.dart'); | 8 #import('ssa.dart'); |
| 9 | 9 |
| 10 class HTracer extends HGraphVisitor { | 10 class HTracer extends HGraphVisitor { |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 | 361 |
| 362 String visitMultiply(HMultiply node) => visitInvokeStatic(node); | 362 String visitMultiply(HMultiply node) => visitInvokeStatic(node); |
| 363 | 363 |
| 364 String visitNegate(HNegate node) => visitInvokeStatic(node); | 364 String visitNegate(HNegate node) => visitInvokeStatic(node); |
| 365 | 365 |
| 366 String visitNot(HNot node) => "Not: ${temporaryId(node.inputs[0])}"; | 366 String visitNot(HNot node) => "Not: ${temporaryId(node.inputs[0])}"; |
| 367 | 367 |
| 368 String visitParameterValue(HParameterValue node) => "p${node.element.name}"; | 368 String visitParameterValue(HParameterValue node) => "p${node.element.name}"; |
| 369 | 369 |
| 370 String visitPhi(HPhi phi) { | 370 String visitPhi(HPhi phi) { |
| 371 return "Phi(${temporaryId(phi.inputs[0])}, ${temporaryId(phi.inputs[1])})"; | 371 StringBuffer buffer = new StringBuffer(); |
| 372 buffer.add("Phi("); |
| 373 for (int i = 0; i < phi.inputs.length; i++) { |
| 374 if (i > 0) buffer.add(", "); |
| 375 buffer.add(temporaryId(phi.inputs[i])); |
| 376 } |
| 377 buffer.add(")"); |
| 378 return buffer.toString(); |
| 372 } | 379 } |
| 373 | 380 |
| 374 String visitReturn(HReturn node) => "Return ${temporaryId(node.inputs[0])}"; | 381 String visitReturn(HReturn node) => "Return ${temporaryId(node.inputs[0])}"; |
| 375 | 382 |
| 376 String visitShiftLeft(HShiftLeft node) => visitInvokeStatic(node); | 383 String visitShiftLeft(HShiftLeft node) => visitInvokeStatic(node); |
| 377 | 384 |
| 378 String visitShiftRight(HShiftRight node) => visitInvokeStatic(node); | 385 String visitShiftRight(HShiftRight node) => visitInvokeStatic(node); |
| 379 | 386 |
| 380 String visitStatic(HStatic node) | 387 String visitStatic(HStatic node) |
| 381 => "Static ${node.element.name}"; | 388 => "Static ${node.element.name}"; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 default: unreachable(); | 436 default: unreachable(); |
| 430 } | 437 } |
| 431 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; | 438 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; |
| 432 } | 439 } |
| 433 | 440 |
| 434 String visitIs(HIs node) { | 441 String visitIs(HIs node) { |
| 435 String type = node.typeExpression.toString(); | 442 String type = node.typeExpression.toString(); |
| 436 return "TypeTest: ${temporaryId(node.expression)} is $type"; | 443 return "TypeTest: ${temporaryId(node.expression)} is $type"; |
| 437 } | 444 } |
| 438 } | 445 } |
| OLD | NEW |