Chromium Code Reviews| 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 #import('../leg.dart'); | 9 #import('../leg.dart'); |
| 10 | 10 |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 408 case HType.READABLE_ARRAY: type = "readable_array"; break; | 408 case HType.READABLE_ARRAY: type = "readable_array"; break; |
| 409 case HType.BOOLEAN: type = "bool"; break; | 409 case HType.BOOLEAN: type = "bool"; break; |
| 410 case HType.INTEGER: type = "integer"; break; | 410 case HType.INTEGER: type = "integer"; break; |
| 411 case HType.DOUBLE: type = "double"; break; | 411 case HType.DOUBLE: type = "double"; break; |
| 412 case HType.NUMBER: type = "number"; break; | 412 case HType.NUMBER: type = "number"; break; |
| 413 case HType.STRING: type = "string"; break; | 413 case HType.STRING: type = "string"; break; |
| 414 case HType.STRING_OR_ARRAY: type = "string_or_array"; break; | 414 case HType.STRING_OR_ARRAY: type = "string_or_array"; break; |
| 415 case HType.UNKNOWN: type = 'unknown'; break; | 415 case HType.UNKNOWN: type = 'unknown'; break; |
| 416 default: unreachable(); | 416 default: unreachable(); |
| 417 } | 417 } |
| 418 String onString = node.isOn ? "on" : "off"; | 418 StringBuffer result = new StringBuffer(); |
| 419 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type ($onString)"; | 419 result.add("TypeGuard(${node.isOn ? "on" : "off"}):"); |
| 420 result.add(" ${temporaryId(node.guarded)} is $type"); | |
| 421 result.add(" env:"); | |
| 422 List<HInstruction> inputs = node.inputs; | |
| 423 for (int i = 0; i < inputs.length - 1; i++) { | |
| 424 result.add(" ${temporaryId(inputs[i])}"); | |
| 425 } | |
| 426 return result.toString(); | |
|
kasperl
2012/04/19 06:45:57
I kind of like doing this in this way:
var on
floitsch
2012/04/19 12:06:27
Done.
| |
| 420 } | 427 } |
| 421 | 428 |
| 422 String visitIs(HIs node) { | 429 String visitIs(HIs node) { |
| 423 String type = node.typeName.toString(); | 430 String type = node.typeName.toString(); |
| 424 return "TypeTest: ${temporaryId(node.expression)} is $type"; | 431 return "TypeTest: ${temporaryId(node.expression)} is $type"; |
| 425 } | 432 } |
| 426 } | 433 } |
| OLD | NEW |