| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 visit(HInstruction node) => node.accept(this); | 160 visit(HInstruction node) => node.accept(this); |
| 161 | 161 |
| 162 visitBasicBlock(HBasicBlock node) { | 162 visitBasicBlock(HBasicBlock node) { |
| 163 unreachable(); | 163 unreachable(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 String temporaryId(HInstruction instruction) { | 166 String temporaryId(HInstruction instruction) { |
| 167 String prefix; | 167 String prefix; |
| 168 HType type = instruction.propagatedType; | 168 HType type = instruction.propagatedType; |
| 169 switch (type) { | 169 switch (type) { |
| 170 case HType.MUTABLE_ARRAY: prefix = 'a'; break; | 170 case HType.MUTABLE_ARRAY: prefix = 'm'; break; |
| 171 case HType.READABLE_ARRAY: prefix = 'roa'; break; | 171 case HType.READABLE_ARRAY: prefix = 'a'; break; |
| 172 case HType.BOOLEAN: prefix = 'b'; break; | 172 case HType.BOOLEAN: prefix = 'b'; break; |
| 173 case HType.INTEGER: prefix = 'i'; break; | 173 case HType.INTEGER: prefix = 'i'; break; |
| 174 case HType.DOUBLE: prefix = 'd'; break; | 174 case HType.DOUBLE: prefix = 'd'; break; |
| 175 case HType.NUMBER: prefix = 'n'; break; | 175 case HType.NUMBER: prefix = 'n'; break; |
| 176 case HType.STRING: prefix = 's'; break; | 176 case HType.STRING: prefix = 's'; break; |
| 177 case HType.UNKNOWN: prefix = 'v'; break; | 177 case HType.UNKNOWN: prefix = 'v'; break; |
| 178 case HType.CONFLICTING: prefix = 'c'; break; | 178 case HType.CONFLICTING: prefix = 'c'; break; |
| 179 case HType.STRING_OR_ARRAY: prefix = 'sa'; break; | 179 case HType.STRING_OR_ARRAY: prefix = 'r'; break; |
| 180 default: unreachable(); | 180 default: unreachable(); |
| 181 } | 181 } |
| 182 return "$prefix${instruction.id}"; | 182 return "$prefix${instruction.id}"; |
| 183 } | 183 } |
| 184 | 184 |
| 185 String visitBoolify(HBoolify node) { | 185 String visitBoolify(HBoolify node) { |
| 186 return "Boolify: ${temporaryId(node.inputs[0])}"; | 186 return "Boolify: ${temporaryId(node.inputs[0])}"; |
| 187 } | 187 } |
| 188 | 188 |
| 189 String visitAdd(HAdd node) => visitInvokeStatic(node); | 189 String visitAdd(HAdd node) => visitInvokeStatic(node); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 default: unreachable(); | 416 default: unreachable(); |
| 417 } | 417 } |
| 418 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; | 418 return "TypeGuard: ${temporaryId(node.inputs[0])} is $type"; |
| 419 } | 419 } |
| 420 | 420 |
| 421 String visitIs(HIs node) { | 421 String visitIs(HIs node) { |
| 422 String type = node.typeName.toString(); | 422 String type = node.typeName.toString(); |
| 423 return "TypeTest: ${temporaryId(node.expression)} is $type"; | 423 return "TypeTest: ${temporaryId(node.expression)} is $type"; |
| 424 } | 424 } |
| 425 } | 425 } |
| OLD | NEW |