| 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 #include "vm/il_printer.h" | 5 #include "vm/il_printer.h" |
| 6 | 6 |
| 7 #include "vm/intermediate_language.h" | 7 #include "vm/intermediate_language.h" |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 f->Print(" v%d <- phi(", ssa_temp_index()); | 387 f->Print(" v%d <- phi(", ssa_temp_index()); |
| 388 for (intptr_t i = 0; i < inputs_.length(); ++i) { | 388 for (intptr_t i = 0; i < inputs_.length(); ++i) { |
| 389 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); | 389 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); |
| 390 if (i < inputs_.length() - 1) f->Print(","); | 390 if (i < inputs_.length() - 1) f->Print(","); |
| 391 } | 391 } |
| 392 f->Print(")"); | 392 f->Print(")"); |
| 393 } | 393 } |
| 394 | 394 |
| 395 | 395 |
| 396 void ParameterInstr::PrintTo(BufferFormatter* f) const { | 396 void ParameterInstr::PrintTo(BufferFormatter* f) const { |
| 397 f->Print(" v%d <- parameter(%d)", index()); | 397 f->Print(" v%d <- parameter(%d)", |
| 398 (ssa_temp_index() != -1) ? ssa_temp_index() : temp_index(), |
| 399 index()); |
| 398 } | 400 } |
| 399 | 401 |
| 400 | 402 |
| 401 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { | 403 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { |
| 402 f->Print("%2d: [target", block_id()); | 404 f->Print("%2d: [target", block_id()); |
| 403 if (HasTryIndex()) { | 405 if (HasTryIndex()) { |
| 404 f->Print(" catch %d]", try_index()); | 406 f->Print(" catch %d]", try_index()); |
| 405 } else { | 407 } else { |
| 406 f->Print("]"); | 408 f->Print("]"); |
| 407 } | 409 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 433 | 435 |
| 434 | 436 |
| 435 void ReThrowInstr::PrintTo(BufferFormatter* f) const { | 437 void ReThrowInstr::PrintTo(BufferFormatter* f) const { |
| 436 f->Print(" %s ", DebugName()); | 438 f->Print(" %s ", DebugName()); |
| 437 exception()->PrintTo(f); | 439 exception()->PrintTo(f); |
| 438 f->Print(", "); | 440 f->Print(", "); |
| 439 stack_trace()->PrintTo(f); | 441 stack_trace()->PrintTo(f); |
| 440 } | 442 } |
| 441 | 443 |
| 442 | 444 |
| 445 void GotoInstr::PrintTo(BufferFormatter* f) const { |
| 446 f->Print(" goto %d", successor()->block_id()); |
| 447 } |
| 448 |
| 449 |
| 443 void BranchInstr::PrintTo(BufferFormatter* f) const { | 450 void BranchInstr::PrintTo(BufferFormatter* f) const { |
| 444 f->Print(" %s ", DebugName()); | 451 f->Print(" %s ", DebugName()); |
| 445 f->Print("if "); | 452 f->Print("if "); |
| 446 if (is_fused_with_comparison()) { | 453 if (is_fused_with_comparison()) { |
| 447 if (is_negated()) f->Print(" not "); | 454 if (is_negated()) f->Print(" not "); |
| 448 fused_with_comparison_->PrintTo(f); | 455 fused_with_comparison_->PrintTo(f); |
| 449 } else { | 456 } else { |
| 450 value()->PrintTo(f); | 457 value()->PrintTo(f); |
| 451 } | 458 } |
| 452 | 459 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 | 691 |
| 685 | 692 |
| 686 void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const { | 693 void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 687 f->Print("_ %s ", DebugName()); | 694 f->Print("_ %s ", DebugName()); |
| 688 exception()->PrintTo(f); | 695 exception()->PrintTo(f); |
| 689 f->Print(", "); | 696 f->Print(", "); |
| 690 stack_trace()->PrintTo(f); | 697 stack_trace()->PrintTo(f); |
| 691 } | 698 } |
| 692 | 699 |
| 693 | 700 |
| 701 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 702 f->Print("_ goto B%d", successor()->block_id()); |
| 703 } |
| 704 |
| 705 |
| 694 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { | 706 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 695 f->Print("_ %s ", DebugName()); | 707 f->Print("_ %s ", DebugName()); |
| 696 f->Print("if "); | 708 f->Print("if "); |
| 697 value()->PrintTo(f); | 709 value()->PrintTo(f); |
| 698 f->Print(" goto (B%d, B%d)", | 710 f->Print(" goto (B%d, B%d)", |
| 699 true_successor()->block_id(), | 711 true_successor()->block_id(), |
| 700 false_successor()->block_id()); | 712 false_successor()->block_id()); |
| 701 } | 713 } |
| 702 | 714 |
| 703 | 715 |
| 704 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { | 716 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 705 UNIMPLEMENTED(); | 717 UNIMPLEMENTED(); |
| 706 } | 718 } |
| 707 | 719 |
| 708 | 720 |
| 709 void Environment::PrintTo(BufferFormatter* f) const { | 721 void Environment::PrintTo(BufferFormatter* f) const { |
| 710 f->Print(" env={ "); | 722 f->Print(" env={ "); |
| 711 for (intptr_t i = 0; i < values_.length(); ++i) { | 723 for (intptr_t i = 0; i < values_.length(); ++i) { |
| 712 if (i > 0) f->Print(", "); | 724 if (i > 0) f->Print(", "); |
| 713 values_[i]->PrintTo(f); | 725 values_[i]->PrintTo(f); |
| 714 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { | 726 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { |
| 715 f->Print(" [%s]", locations_[i].Name()); | 727 f->Print(" [%s]", locations_[i].Name()); |
| 716 } | 728 } |
| 717 } | 729 } |
| 718 f->Print(" }"); | 730 f->Print(" }"); |
| 719 } | 731 } |
| 720 | 732 |
| 721 } // namespace dart | 733 } // namespace dart |
| OLD | NEW |