| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #import('../leg.dart'); | 9 #import('../leg.dart'); |
| 10 | 10 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 244 |
| 245 String visitFieldGet(HFieldGet node) { | 245 String visitFieldGet(HFieldGet node) { |
| 246 return 'get ${temporaryId(node.receiver)}'; | 246 return 'get ${temporaryId(node.receiver)}'; |
| 247 } | 247 } |
| 248 | 248 |
| 249 String visitFieldSet(HFieldSet node) { | 249 String visitFieldSet(HFieldSet node) { |
| 250 String valueId = temporaryId(node.value); | 250 String valueId = temporaryId(node.value); |
| 251 return 'set ${temporaryId(node.receiver)} to $valueId'; | 251 return 'set ${temporaryId(node.receiver)} to $valueId'; |
| 252 } | 252 } |
| 253 | 253 |
| 254 String visitLocalGet(HLocalGet node) => visitFieldGet(node); |
| 255 String visitLocalSet(HLocalSet node) => visitFieldSet(node); |
| 256 |
| 254 String visitGoto(HGoto node) { | 257 String visitGoto(HGoto node) { |
| 255 HBasicBlock target = currentBlock.successors[0]; | 258 HBasicBlock target = currentBlock.successors[0]; |
| 256 return "Goto: (B${target.id})"; | 259 return "Goto: (B${target.id})"; |
| 257 } | 260 } |
| 258 | 261 |
| 259 String visitGreater(HGreater node) => visitInvokeStatic(node); | 262 String visitGreater(HGreater node) => visitInvokeStatic(node); |
| 260 String visitGreaterEqual(HGreaterEqual node) => visitInvokeStatic(node); | 263 String visitGreaterEqual(HGreaterEqual node) => visitInvokeStatic(node); |
| 261 | 264 |
| 262 String visitIdentity(HIdentity node) => visitInvokeStatic(node); | 265 String visitIdentity(HIdentity node) => visitInvokeStatic(node); |
| 263 | 266 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 String visitMultiply(HMultiply node) => visitInvokeStatic(node); | 361 String visitMultiply(HMultiply node) => visitInvokeStatic(node); |
| 359 | 362 |
| 360 String visitNegate(HNegate node) => visitInvokeStatic(node); | 363 String visitNegate(HNegate node) => visitInvokeStatic(node); |
| 361 | 364 |
| 362 String visitNot(HNot node) => "Not: ${temporaryId(node.inputs[0])}"; | 365 String visitNot(HNot node) => "Not: ${temporaryId(node.inputs[0])}"; |
| 363 | 366 |
| 364 String visitParameterValue(HParameterValue node) { | 367 String visitParameterValue(HParameterValue node) { |
| 365 return "p${node.sourceElement.name.slowToString()}"; | 368 return "p${node.sourceElement.name.slowToString()}"; |
| 366 } | 369 } |
| 367 | 370 |
| 371 String visitLocalValue(HParameterValue node) { |
| 372 return "l${node.sourceElement.name.slowToString()}"; |
| 373 } |
| 374 |
| 368 String visitPhi(HPhi phi) { | 375 String visitPhi(HPhi phi) { |
| 369 StringBuffer buffer = new StringBuffer(); | 376 StringBuffer buffer = new StringBuffer(); |
| 370 buffer.add("Phi("); | 377 buffer.add("Phi("); |
| 371 for (int i = 0; i < phi.inputs.length; i++) { | 378 for (int i = 0; i < phi.inputs.length; i++) { |
| 372 if (i > 0) buffer.add(", "); | 379 if (i > 0) buffer.add(", "); |
| 373 buffer.add(temporaryId(phi.inputs[i])); | 380 buffer.add(temporaryId(phi.inputs[i])); |
| 374 } | 381 } |
| 375 buffer.add(")"); | 382 buffer.add(")"); |
| 376 return buffer.toString(); | 383 return buffer.toString(); |
| 377 } | 384 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 String visitIs(HIs node) { | 486 String visitIs(HIs node) { |
| 480 String type = node.typeExpression.toString(); | 487 String type = node.typeExpression.toString(); |
| 481 return "TypeTest: ${temporaryId(node.expression)} is $type"; | 488 return "TypeTest: ${temporaryId(node.expression)} is $type"; |
| 482 } | 489 } |
| 483 | 490 |
| 484 String visitTypeConversion(HTypeConversion node) { | 491 String visitTypeConversion(HTypeConversion node) { |
| 485 String type = node.propagatedType.toString(); | 492 String type = node.propagatedType.toString(); |
| 486 return "TypeConversion: ${temporaryId(node.inputs[0])} to $type"; | 493 return "TypeConversion: ${temporaryId(node.inputs[0])} to $type"; |
| 487 } | 494 } |
| 488 } | 495 } |
| OLD | NEW |