| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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:async' show EventSink; | 7 import 'dart:async' show EventSink; |
| 8 | 8 |
| 9 import 'ssa.dart'; | 9 import 'ssa.dart'; |
| 10 import '../js_backend/js_backend.dart'; | 10 import '../js_backend/js_backend.dart'; |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 final JavaScriptItemCompilationContext context; | 172 final JavaScriptItemCompilationContext context; |
| 173 final HBasicBlock currentBlock; | 173 final HBasicBlock currentBlock; |
| 174 | 174 |
| 175 HInstructionStringifier(this.context, this.currentBlock, this.compiler); | 175 HInstructionStringifier(this.context, this.currentBlock, this.compiler); |
| 176 | 176 |
| 177 visit(HInstruction node) => node.accept(this); | 177 visit(HInstruction node) => node.accept(this); |
| 178 | 178 |
| 179 String temporaryId(HInstruction instruction) { | 179 String temporaryId(HInstruction instruction) { |
| 180 String prefix; | 180 String prefix; |
| 181 HType type = instruction.instructionType; | 181 HType type = instruction.instructionType; |
| 182 if (type.isMutableArray(compiler)) { | 182 if (type.isExtendableArray(compiler)) { |
| 183 prefix = 'e'; |
| 184 } else if (type.isFixedArray(compiler)) { |
| 185 prefix = 'f'; |
| 186 } else if (type.isMutableArray(compiler)) { |
| 183 prefix = 'm'; | 187 prefix = 'm'; |
| 184 } else if (type.isReadableArray(compiler)) { | 188 } else if (type.isReadableArray(compiler)) { |
| 185 prefix = 'a'; | 189 prefix = 'a'; |
| 186 } else if (type.isExtendableArray(compiler)) { | 190 } else if (type.isString(compiler)) { |
| 187 prefix = 'e'; | 191 prefix = 's'; |
| 192 } else if (type.isIndexable(compiler)) { |
| 193 prefix = 'r'; |
| 188 } else if (type == HType.BOOLEAN) { | 194 } else if (type == HType.BOOLEAN) { |
| 189 prefix = 'b'; | 195 prefix = 'b'; |
| 190 } else if (type == HType.INTEGER) { | 196 } else if (type == HType.INTEGER) { |
| 191 prefix = 'i'; | 197 prefix = 'i'; |
| 192 } else if (type == HType.DOUBLE) { | 198 } else if (type == HType.DOUBLE) { |
| 193 prefix = 'd'; | 199 prefix = 'd'; |
| 194 } else if (type == HType.NUMBER) { | 200 } else if (type == HType.NUMBER) { |
| 195 prefix = 'n'; | 201 prefix = 'n'; |
| 196 } else if (type.isString(compiler)) { | |
| 197 prefix = 's'; | |
| 198 } else if (type == HType.UNKNOWN) { | 202 } else if (type == HType.UNKNOWN) { |
| 199 prefix = 'v'; | 203 prefix = 'v'; |
| 200 } else if (type == HType.CONFLICTING) { | 204 } else if (type == HType.CONFLICTING) { |
| 201 prefix = 'c'; | 205 prefix = 'c'; |
| 202 } else if (type.isIndexable(compiler)) { | |
| 203 prefix = 'r'; | |
| 204 } else if (type == HType.NULL) { | 206 } else if (type == HType.NULL) { |
| 205 prefix = 'u'; | 207 prefix = 'u'; |
| 206 } else { | 208 } else { |
| 207 prefix = 'U'; | 209 prefix = 'U'; |
| 208 } | 210 } |
| 209 return "$prefix${instruction.id}"; | 211 return "$prefix${instruction.id}"; |
| 210 } | 212 } |
| 211 | 213 |
| 212 String visitBailoutTarget(HBailoutTarget node) { | 214 String visitBailoutTarget(HBailoutTarget node) { |
| 213 StringBuffer envBuffer = new StringBuffer(); | 215 StringBuffer envBuffer = new StringBuffer(); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 ? temporaryId(node.inputs[1]) | 562 ? temporaryId(node.inputs[1]) |
| 561 : ''; | 563 : ''; |
| 562 return "TypeConversion: ${temporaryId(node.checkedInput)} to " | 564 return "TypeConversion: ${temporaryId(node.checkedInput)} to " |
| 563 "${node.instructionType} $otherInput"; | 565 "${node.instructionType} $otherInput"; |
| 564 } | 566 } |
| 565 | 567 |
| 566 String visitRangeConversion(HRangeConversion node) { | 568 String visitRangeConversion(HRangeConversion node) { |
| 567 return "RangeConversion: ${node.checkedInput}"; | 569 return "RangeConversion: ${node.checkedInput}"; |
| 568 } | 570 } |
| 569 } | 571 } |
| OLD | NEW |