| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 206 |
| 207 String visitBoundsCheck(HBoundsCheck node) { | 207 String visitBoundsCheck(HBoundsCheck node) { |
| 208 String lengthId = temporaryId(node.length); | 208 String lengthId = temporaryId(node.length); |
| 209 String indexId = temporaryId(node.index); | 209 String indexId = temporaryId(node.index); |
| 210 return "Bounds check: length = $lengthId, index = $indexId"; | 210 return "Bounds check: length = $lengthId, index = $indexId"; |
| 211 } | 211 } |
| 212 | 212 |
| 213 String visitBreak(HBreak node) { | 213 String visitBreak(HBreak node) { |
| 214 HBasicBlock target = currentBlock.successors[0]; | 214 HBasicBlock target = currentBlock.successors[0]; |
| 215 if (node.label !== null) { | 215 if (node.label !== null) { |
| 216 return "Break ${node.label.stringValue}: (B${target.id})"; | 216 return "Break ${node.label.slowToString()}: (B${target.id})"; |
| 217 } | 217 } |
| 218 return "Break: (B${target.id})"; | 218 return "Break: (B${target.id})"; |
| 219 } | 219 } |
| 220 | 220 |
| 221 String visitDivide(HDivide node) => visitInvokeStatic(node); | 221 String visitDivide(HDivide node) => visitInvokeStatic(node); |
| 222 | 222 |
| 223 String visitEquals(HEquals node) => visitInvokeStatic(node); | 223 String visitEquals(HEquals node) => visitInvokeStatic(node); |
| 224 | 224 |
| 225 String visitExit(HExit node) => "exit"; | 225 String visitExit(HExit node) => "exit"; |
| 226 | 226 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 if (i != 0) elementsString.add(", "); | 332 if (i != 0) elementsString.add(", "); |
| 333 elementsString.add(temporaryId(node.inputs[i])); | 333 elementsString.add(temporaryId(node.inputs[i])); |
| 334 } | 334 } |
| 335 return "Literal list: [$elementsString]"; | 335 return "Literal list: [$elementsString]"; |
| 336 } | 336 } |
| 337 | 337 |
| 338 String visitLoad(HLoad node) => "Load: ${temporaryId(node.inputs[0])}"; | 338 String visitLoad(HLoad node) => "Load: ${temporaryId(node.inputs[0])}"; |
| 339 | 339 |
| 340 String visitLocal(HLocal node) { | 340 String visitLocal(HLocal node) { |
| 341 if (node.element !== null) { | 341 if (node.element !== null) { |
| 342 return "Local: ${node.element.name.stringValue}"; | 342 return "Local: ${node.element.name.slowToString()}"; |
| 343 } else { | 343 } else { |
| 344 return "Local"; | 344 return "Local"; |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 | 347 |
| 348 String visitLogicalOperator(HLogicalOperator node) { | 348 String visitLogicalOperator(HLogicalOperator node) { |
| 349 return "LogicalOepration: ${temporaryId(node.left)} ${node.operation} " + | 349 return "LogicalOepration: ${temporaryId(node.left)} ${node.operation} " + |
| 350 "${temporaryId(node.right)}"; | 350 "${temporaryId(node.right)}"; |
| 351 } | 351 } |
| 352 | 352 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 default: unreachable(); | 429 default: unreachable(); |
| 430 } | 430 } |
| 431 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; | 431 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; |
| 432 } | 432 } |
| 433 | 433 |
| 434 String visitIs(HIs node) { | 434 String visitIs(HIs node) { |
| 435 String type = node.typeExpression.toString(); | 435 String type = node.typeExpression.toString(); |
| 436 return "TypeTest: ${temporaryId(node.expression)} is $type"; | 436 return "TypeTest: ${temporaryId(node.expression)} is $type"; |
| 437 } | 437 } |
| 438 } | 438 } |
| OLD | NEW |