Chromium Code Reviews| Index: lib/compiler/implementation/ssa/tracer.dart |
| diff --git a/lib/compiler/implementation/ssa/tracer.dart b/lib/compiler/implementation/ssa/tracer.dart |
| index 1e163d67c3a7d1ffa0cfab2592e2dfd372852b29..8f218e5ea9a6b3bb746a4a309411fd153f894534 100644 |
| --- a/lib/compiler/implementation/ssa/tracer.dart |
| +++ b/lib/compiler/implementation/ssa/tracer.dart |
| @@ -204,6 +204,16 @@ class HInstructionStringifier implements HVisitor<String> { |
| return "$prefix${instruction.id}"; |
| } |
| + String visitBailoutTarget(HBailoutTarget node) { |
| + StringBuffer envBuffer = new StringBuffer(); |
| + List<HInstruction> inputs = node.inputs; |
| + for (int i = 0; i < inputs.length; i++) { |
| + envBuffer.add(" ${temporaryId(inputs[i])}"); |
| + } |
| + String on = node.isEnabled ? "enabled" : "disabled"; |
| + return "BailoutTarget($on): id: ${node.state} env: $envBuffer"; |
| + } |
| + |
| String visitBoolify(HBoolify node) { |
| return "Boolify: ${temporaryId(node.inputs[0])}"; |
| } |
| @@ -479,16 +489,24 @@ class HInstructionStringifier implements HVisitor<String> { |
| } else { |
| throw new CompilerCancelledException('Unexpected type guard: $type'); |
| } |
| + HInstruction guarded = node.guarded; |
| + HInstruction bailoutTarget = node.bailoutTarget; |
| StringBuffer envBuffer = new StringBuffer(); |
| List<HInstruction> inputs = node.inputs; |
| + bool skippedFirstGuarded = false; |
| for (int i = 0; i < inputs.length; i++) { |
| - if (inputs[i] !== node.guarded) { |
| - envBuffer.add(" ${temporaryId(inputs[i])}"); |
| + if (inputs[i] == guarded && !skippedFirstGuarded) { |
| + skippedFirstGuarded = true; |
|
ricow1
2012/07/23 12:52:26
you should add a comment explaining why we can saf
floitsch
2012/07/23 13:27:48
refactored code.
|
| + continue; |
| } |
| + if (inputs[i] != bailoutTarget) continue; |
| + envBuffer.add(" ${temporaryId(inputs[i])}"); |
| } |
| String on = node.isEnabled ? "enabled" : "disabled"; |
| - String id = temporaryId(node.guarded); |
| - return "TypeGuard($on): $id is $type env: $envBuffer"; |
| + String guardedId = temporaryId(node.guarded); |
| + String bailoutId = temporaryId(node.bailoutTarget); |
| + return "TypeGuard($on): $guardedId is $type bailout: $bailoutId " |
| + "env: $envBuffer"; |
| } |
| String visitIs(HIs node) { |