| 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 class HTracer extends HGraphVisitor { | 5 class HTracer extends HGraphVisitor { |
| 6 int indent = 0; | 6 int indent = 0; |
| 7 final StringBuffer output; | 7 final StringBuffer output; |
| 8 | 8 |
| 9 factory HTracer.singleton() { | 9 factory HTracer.singleton() { |
| 10 if (_singleton === null) _singleton = new HTracer._internal(); | 10 if (_singleton === null) _singleton = new HTracer._internal(); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 String visitExit(HExit node) => "exit"; | 200 String visitExit(HExit node) => "exit"; |
| 201 | 201 |
| 202 String visitGoto(HGoto node) { | 202 String visitGoto(HGoto node) { |
| 203 HBasicBlock target = currentBlock.successors[0]; | 203 HBasicBlock target = currentBlock.successors[0]; |
| 204 return "Goto: (B${target.id})"; | 204 return "Goto: (B${target.id})"; |
| 205 } | 205 } |
| 206 | 206 |
| 207 String visitGreater(HGreater node) => visitInvokeStatic(node); | 207 String visitGreater(HGreater node) => visitInvokeStatic(node); |
| 208 String visitGreaterEqual(HGreaterEqual node) => visitInvokeStatic(node); | 208 String visitGreaterEqual(HGreaterEqual node) => visitInvokeStatic(node); |
| 209 | 209 |
| 210 String visitIdentity(HIdentity node) => visitInvokeStatic(node); |
| 211 |
| 210 String visitIf(HIf node) { | 212 String visitIf(HIf node) { |
| 211 HBasicBlock thenBlock = currentBlock.successors[0]; | 213 HBasicBlock thenBlock = currentBlock.successors[0]; |
| 212 HBasicBlock elseBlock = currentBlock.successors[1]; | 214 HBasicBlock elseBlock = currentBlock.successors[1]; |
| 213 String conditionId = temporaryId(node.inputs[0]); | 215 String conditionId = temporaryId(node.inputs[0]); |
| 214 if (node.generateAtUseSite()) { | 216 if (node.generateAtUseSite()) { |
| 215 String operation = "&&/||"; | 217 String operation = "&&/||"; |
| 216 if (elseBlock.first is HLogicalOperator) { | 218 if (elseBlock.first is HLogicalOperator) { |
| 217 HLogicalOperator op = elseBlock.first; | 219 HLogicalOperator op = elseBlock.first; |
| 218 operation = op.operation; | 220 operation = op.operation; |
| 219 } | 221 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 case HType.ARRAY: type = "array"; break; | 360 case HType.ARRAY: type = "array"; break; |
| 359 case HType.BOOLEAN: type = "bool"; break; | 361 case HType.BOOLEAN: type = "bool"; break; |
| 360 case HType.NUMBER: type = "number"; break; | 362 case HType.NUMBER: type = "number"; break; |
| 361 case HType.STRING: type = "string"; break; | 363 case HType.STRING: type = "string"; break; |
| 362 case HType.STRING_OR_ARRAY: type = "string_or_array"; break; | 364 case HType.STRING_OR_ARRAY: type = "string_or_array"; break; |
| 363 default: unreachable(); | 365 default: unreachable(); |
| 364 } | 366 } |
| 365 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; | 367 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; |
| 366 } | 368 } |
| 367 } | 369 } |
| OLD | NEW |