| 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 ssa.tracer; | 5 library ssa.tracer; |
| 6 | 6 |
| 7 import 'dart:async' show EventSink; | 7 import 'dart:async' show EventSink; |
| 8 | 8 |
| 9 import '../compiler.dart' show Compiler; | 9 import '../compiler.dart' show Compiler; |
| 10 import '../diagnostics/invariant.dart' show DEBUG_MODE; | 10 import '../diagnostics/invariant.dart' show DEBUG_MODE; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 String visitConstant(HConstant constant) => "Constant: ${constant.constant}"; | 195 String visitConstant(HConstant constant) => "Constant: ${constant.constant}"; |
| 196 | 196 |
| 197 String visitContinue(HContinue node) { | 197 String visitContinue(HContinue node) { |
| 198 HBasicBlock target = currentBlock.successors[0]; | 198 HBasicBlock target = currentBlock.successors[0]; |
| 199 if (node.label != null) { | 199 if (node.label != null) { |
| 200 return "Continue ${node.label.labelName}: (B${target.id})"; | 200 return "Continue ${node.label.labelName}: (B${target.id})"; |
| 201 } | 201 } |
| 202 return "Continue: (B${target.id})"; | 202 return "Continue: (B${target.id})"; |
| 203 } | 203 } |
| 204 | 204 |
| 205 String visitCreate(HCreate node) { |
| 206 return handleGenericInvoke( |
| 207 "Create", "${node.element.name}", node.inputs); |
| 208 } |
| 209 |
| 205 String visitDivide(HDivide node) => handleInvokeBinary(node, 'Divide'); | 210 String visitDivide(HDivide node) => handleInvokeBinary(node, 'Divide'); |
| 206 | 211 |
| 207 String visitExit(HExit node) => "Exit"; | 212 String visitExit(HExit node) => "Exit"; |
| 208 | 213 |
| 209 String visitFieldGet(HFieldGet node) { | 214 String visitFieldGet(HFieldGet node) { |
| 210 if (node.isNullCheck) { | 215 if (node.isNullCheck) { |
| 211 return 'FieldGet: NullCheck ${temporaryId(node.receiver)}'; | 216 return 'FieldGet: NullCheck ${temporaryId(node.receiver)}'; |
| 212 } | 217 } |
| 213 String fieldName = node.element.name; | 218 String fieldName = node.element.name; |
| 214 return 'FieldGet: ${temporaryId(node.receiver)}.$fieldName'; | 219 return 'FieldGet: ${temporaryId(node.receiver)}.$fieldName'; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 String visitInvokeConstructorBody(HInvokeConstructorBody invoke) { | 335 String visitInvokeConstructorBody(HInvokeConstructorBody invoke) { |
| 331 String target = invoke.element.name; | 336 String target = invoke.element.name; |
| 332 return handleGenericInvoke("InvokeConstructorBody", target, invoke.inputs); | 337 return handleGenericInvoke("InvokeConstructorBody", target, invoke.inputs); |
| 333 } | 338 } |
| 334 | 339 |
| 335 String visitForeignCode(HForeignCode foreign) { | 340 String visitForeignCode(HForeignCode foreign) { |
| 336 return handleGenericInvoke( | 341 return handleGenericInvoke( |
| 337 "ForeignCode", "${foreign.codeTemplate.ast}", foreign.inputs); | 342 "ForeignCode", "${foreign.codeTemplate.ast}", foreign.inputs); |
| 338 } | 343 } |
| 339 | 344 |
| 340 String visitForeignNew(HForeignNew node) { | |
| 341 return handleGenericInvoke( | |
| 342 "ForeignNew", "${node.element.name}", node.inputs); | |
| 343 } | |
| 344 | |
| 345 String visitLess(HLess node) => handleInvokeBinary(node, 'Less'); | 345 String visitLess(HLess node) => handleInvokeBinary(node, 'Less'); |
| 346 String visitLessEqual(HLessEqual node) => | 346 String visitLessEqual(HLessEqual node) => |
| 347 handleInvokeBinary(node, 'LessEqual'); | 347 handleInvokeBinary(node, 'LessEqual'); |
| 348 | 348 |
| 349 String visitLiteralList(HLiteralList node) { | 349 String visitLiteralList(HLiteralList node) { |
| 350 StringBuffer elementsString = new StringBuffer(); | 350 StringBuffer elementsString = new StringBuffer(); |
| 351 for (int i = 0; i < node.inputs.length; i++) { | 351 for (int i = 0; i < node.inputs.length; i++) { |
| 352 if (i != 0) elementsString.write(", "); | 352 if (i != 0) elementsString.write(", "); |
| 353 elementsString.write(temporaryId(node.inputs[i])); | 353 elementsString.write(temporaryId(node.inputs[i])); |
| 354 } | 354 } |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 } | 539 } |
| 540 | 540 |
| 541 String visitAwait(HAwait node) { | 541 String visitAwait(HAwait node) { |
| 542 return "Await: ${temporaryId(node.inputs[0])}"; | 542 return "Await: ${temporaryId(node.inputs[0])}"; |
| 543 } | 543 } |
| 544 | 544 |
| 545 String visitYield(HYield node) { | 545 String visitYield(HYield node) { |
| 546 return "Yield${node.hasStar ? "*" : ""}: ${temporaryId(node.inputs[0])}"; | 546 return "Yield${node.hasStar ? "*" : ""}: ${temporaryId(node.inputs[0])}"; |
| 547 } | 547 } |
| 548 } | 548 } |
| OLD | NEW |