| 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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.slowToString()}: (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 visitConstant(HConstant constant) => "Constant ${constant.constant}"; |
| 222 |
| 221 String visitDivide(HDivide node) => visitInvokeStatic(node); | 223 String visitDivide(HDivide node) => visitInvokeStatic(node); |
| 222 | 224 |
| 223 String visitEquals(HEquals node) => visitInvokeStatic(node); | 225 String visitEquals(HEquals node) => visitInvokeStatic(node); |
| 224 | 226 |
| 225 String visitExit(HExit node) => "exit"; | 227 String visitExit(HExit node) => "exit"; |
| 226 | 228 |
| 227 String visitFieldGet(HFieldGet node) { | 229 String visitFieldGet(HFieldGet node) { |
| 228 return 'get ${node.element.name.slowToString()}'; | 230 return 'get ${node.element.name.slowToString()}'; |
| 229 } | 231 } |
| 230 | 232 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 | 323 |
| 322 String visitForeignNew(HForeignNew node) { | 324 String visitForeignNew(HForeignNew node) { |
| 323 return visitGenericInvoke("New", | 325 return visitGenericInvoke("New", |
| 324 "${node.element.name.slowToString()}", | 326 "${node.element.name.slowToString()}", |
| 325 node.inputs); | 327 node.inputs); |
| 326 } | 328 } |
| 327 | 329 |
| 328 String visitLess(HLess node) => visitInvokeStatic(node); | 330 String visitLess(HLess node) => visitInvokeStatic(node); |
| 329 String visitLessEqual(HLessEqual node) => visitInvokeStatic(node); | 331 String visitLessEqual(HLessEqual node) => visitInvokeStatic(node); |
| 330 | 332 |
| 331 String visitLiteral(HLiteral literal) => "Literal ${literal.value}"; | |
| 332 | |
| 333 String visitLiteralList(HLiteralList node) { | 333 String visitLiteralList(HLiteralList node) { |
| 334 StringBuffer elementsString = new StringBuffer(); | 334 StringBuffer elementsString = new StringBuffer(); |
| 335 for (int i = 0; i < node.inputs.length; i++) { | 335 for (int i = 0; i < node.inputs.length; i++) { |
| 336 if (i != 0) elementsString.add(", "); | 336 if (i != 0) elementsString.add(", "); |
| 337 elementsString.add(temporaryId(node.inputs[i])); | 337 elementsString.add(temporaryId(node.inputs[i])); |
| 338 } | 338 } |
| 339 return "Literal list: [$elementsString]"; | 339 return "Literal list: [$elementsString]"; |
| 340 } | 340 } |
| 341 | 341 |
| 342 String visitLoad(HLoad node) => "Load: ${temporaryId(node.inputs[0])}"; | 342 String visitLoad(HLoad node) => "Load: ${temporaryId(node.inputs[0])}"; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 default: unreachable(); | 444 default: unreachable(); |
| 445 } | 445 } |
| 446 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; | 446 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; |
| 447 } | 447 } |
| 448 | 448 |
| 449 String visitIs(HIs node) { | 449 String visitIs(HIs node) { |
| 450 String type = node.typeExpression.toString(); | 450 String type = node.typeExpression.toString(); |
| 451 return "TypeTest: ${temporaryId(node.expression)} is $type"; | 451 return "TypeTest: ${temporaryId(node.expression)} is $type"; |
| 452 } | 452 } |
| 453 } | 453 } |
| OLD | NEW |