| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 '../js_backend/js_backend.dart'; | 9 import '../js_backend/js_backend.dart'; |
| 10 import '../dart2jslib.dart'; | 10 import '../dart2jslib.dart'; |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 buf.add("Switch: ("); | 439 buf.add("Switch: ("); |
| 440 buf.add(temporaryId(node.inputs[0])); | 440 buf.add(temporaryId(node.inputs[0])); |
| 441 buf.add(") "); | 441 buf.add(") "); |
| 442 for (int i = 1; i < node.inputs.length; i++) { | 442 for (int i = 1; i < node.inputs.length; i++) { |
| 443 buf.add(temporaryId(node.inputs[i])); | 443 buf.add(temporaryId(node.inputs[i])); |
| 444 buf.add(": B"); | 444 buf.add(": B"); |
| 445 buf.add(node.block.successors[i - 1].id); | 445 buf.add(node.block.successors[i - 1].id); |
| 446 buf.add(", "); | 446 buf.add(", "); |
| 447 } | 447 } |
| 448 buf.add("default: B"); | 448 buf.add("default: B"); |
| 449 buf.add(node.block.successors.last().id); | 449 buf.add(node.block.successors.last.id); |
| 450 return buf.toString(); | 450 return buf.toString(); |
| 451 } | 451 } |
| 452 | 452 |
| 453 String visitThis(HThis node) => "this"; | 453 String visitThis(HThis node) => "this"; |
| 454 | 454 |
| 455 String visitThrow(HThrow node) => "Throw ${temporaryId(node.inputs[0])}"; | 455 String visitThrow(HThrow node) => "Throw ${temporaryId(node.inputs[0])}"; |
| 456 | 456 |
| 457 String visitTruncatingDivide(HTruncatingDivide node) { | 457 String visitTruncatingDivide(HTruncatingDivide node) { |
| 458 return visitInvokeStatic(node); | 458 return visitInvokeStatic(node); |
| 459 } | 459 } |
| 460 | 460 |
| 461 String visitTry(HTry node) { | 461 String visitTry(HTry node) { |
| 462 List<HBasicBlock> successors = currentBlock.successors; | 462 List<HBasicBlock> successors = currentBlock.successors; |
| 463 String tryBlock = 'B${successors[0].id}'; | 463 String tryBlock = 'B${successors[0].id}'; |
| 464 String catchBlock = 'none'; | 464 String catchBlock = 'none'; |
| 465 if (node.catchBlock != null) { | 465 if (node.catchBlock != null) { |
| 466 catchBlock = 'B${successors[1].id}'; | 466 catchBlock = 'B${successors[1].id}'; |
| 467 } | 467 } |
| 468 | 468 |
| 469 String finallyBlock = 'none'; | 469 String finallyBlock = 'none'; |
| 470 if (node.finallyBlock != null) { | 470 if (node.finallyBlock != null) { |
| 471 finallyBlock = 'B${node.finallyBlock.id}'; | 471 finallyBlock = 'B${node.finallyBlock.id}'; |
| 472 } | 472 } |
| 473 | 473 |
| 474 return "Try: $tryBlock, Catch: $catchBlock, Finally: $finallyBlock, " | 474 return "Try: $tryBlock, Catch: $catchBlock, Finally: $finallyBlock, " |
| 475 "Join: B${successors.last().id}"; | 475 "Join: B${successors.last.id}"; |
| 476 } | 476 } |
| 477 | 477 |
| 478 String visitTypeGuard(HTypeGuard node) { | 478 String visitTypeGuard(HTypeGuard node) { |
| 479 String type; | 479 String type; |
| 480 HType guardedType = node.guardedType; | 480 HType guardedType = node.guardedType; |
| 481 if (guardedType == HType.MUTABLE_ARRAY) { | 481 if (guardedType == HType.MUTABLE_ARRAY) { |
| 482 type = "mutable_array"; | 482 type = "mutable_array"; |
| 483 } else if (guardedType == HType.READABLE_ARRAY) { | 483 } else if (guardedType == HType.READABLE_ARRAY) { |
| 484 type = "readable_array"; | 484 type = "readable_array"; |
| 485 } else if (guardedType == HType.EXTENDABLE_ARRAY) { | 485 } else if (guardedType == HType.EXTENDABLE_ARRAY) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 } | 524 } |
| 525 | 525 |
| 526 String visitTypeConversion(HTypeConversion node) { | 526 String visitTypeConversion(HTypeConversion node) { |
| 527 return "TypeConversion: ${temporaryId(node.checkedInput)} to ${node.type}"; | 527 return "TypeConversion: ${temporaryId(node.checkedInput)} to ${node.type}"; |
| 528 } | 528 } |
| 529 | 529 |
| 530 String visitRangeConversion(HRangeConversion node) { | 530 String visitRangeConversion(HRangeConversion node) { |
| 531 return "RangeConversion: ${node.checkedInput}"; | 531 return "RangeConversion: ${node.checkedInput}"; |
| 532 } | 532 } |
| 533 } | 533 } |
| OLD | NEW |