| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 finallyBlock = 'B${node.finallyBlock.id}'; | 396 finallyBlock = 'B${node.finallyBlock.id}'; |
| 397 } else { | 397 } else { |
| 398 catchBlocks.add('B${successors[successors.length - 1].id}'); | 398 catchBlocks.add('B${successors[successors.length - 1].id}'); |
| 399 finallyBlock = 'none'; | 399 finallyBlock = 'none'; |
| 400 } | 400 } |
| 401 return "Try: $tryBlock, Catch: $catchBlocks, Finally: $finallyBlock"; | 401 return "Try: $tryBlock, Catch: $catchBlocks, Finally: $finallyBlock"; |
| 402 } | 402 } |
| 403 | 403 |
| 404 String visitTypeGuard(HTypeGuard node) { | 404 String visitTypeGuard(HTypeGuard node) { |
| 405 String type; | 405 String type; |
| 406 switch (node.propagatedType) { | 406 switch (node.guardedType) { |
| 407 case HType.MUTABLE_ARRAY: type = "mutable_array"; break; | 407 case HType.MUTABLE_ARRAY: type = "mutable_array"; break; |
| 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 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; | 418 String activeString = node.isActive ? "active" : "inactive"; |
| 419 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type ($activeString)"; |
| 419 } | 420 } |
| 420 | 421 |
| 421 String visitIs(HIs node) { | 422 String visitIs(HIs node) { |
| 422 String type = node.typeName.toString(); | 423 String type = node.typeName.toString(); |
| 423 return "TypeTest: ${temporaryId(node.expression)} is $type"; | 424 return "TypeTest: ${temporaryId(node.expression)} is $type"; |
| 424 } | 425 } |
| 425 } | 426 } |
| OLD | NEW |