Chromium Code Reviews| 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 f->Print(" v%d <- phi(", ssa_temp_index()); | 371 f->Print(" v%d <- phi(", ssa_temp_index()); |
| 372 for (intptr_t i = 0; i < inputs_.length(); ++i) { | 372 for (intptr_t i = 0; i < inputs_.length(); ++i) { |
| 373 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); | 373 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); |
| 374 if (i < inputs_.length() - 1) f->Print(","); | 374 if (i < inputs_.length() - 1) f->Print(","); |
| 375 } | 375 } |
| 376 f->Print(")"); | 376 f->Print(")"); |
| 377 } | 377 } |
| 378 | 378 |
| 379 | 379 |
| 380 void ParameterInstr::PrintTo(BufferFormatter* f) const { | 380 void ParameterInstr::PrintTo(BufferFormatter* f) const { |
| 381 f->Print(" v%d <- parameter(%d)", index()); | 381 f->Print(" v%d <- parameter(%d)", |
| 382 (ssa_temp_index() != -1) ? ssa_temp_index() : temp_index(), | |
|
srdjan
2012/07/12 16:42:26
Maybe introduce HasSSATemp(), since there are many
Kevin Millikin (Google)
2012/07/13 15:34:59
Hmm. There are a few places where we use it to te
| |
| 383 index()); | |
| 382 } | 384 } |
| 383 | 385 |
| 384 | 386 |
| 385 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { | 387 void TargetEntryInstr::PrintTo(BufferFormatter* f) const { |
| 386 f->Print("%2d: [target", block_id()); | 388 f->Print("%2d: [target", block_id()); |
| 387 if (HasTryIndex()) { | 389 if (HasTryIndex()) { |
| 388 f->Print(" catch %d]", try_index()); | 390 f->Print(" catch %d]", try_index()); |
| 389 } else { | 391 } else { |
| 390 f->Print("]"); | 392 f->Print("]"); |
| 391 } | 393 } |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 417 | 419 |
| 418 | 420 |
| 419 void ReThrowInstr::PrintTo(BufferFormatter* f) const { | 421 void ReThrowInstr::PrintTo(BufferFormatter* f) const { |
| 420 f->Print(" %s ", DebugName()); | 422 f->Print(" %s ", DebugName()); |
| 421 exception()->PrintTo(f); | 423 exception()->PrintTo(f); |
| 422 f->Print(", "); | 424 f->Print(", "); |
| 423 stack_trace()->PrintTo(f); | 425 stack_trace()->PrintTo(f); |
| 424 } | 426 } |
| 425 | 427 |
| 426 | 428 |
| 429 void GotoInstr::PrintTo(BufferFormatter* f) const { | |
| 430 f->Print(" goto %d", successor()->block_id()); | |
| 431 } | |
| 432 | |
| 433 | |
| 427 void BranchInstr::PrintTo(BufferFormatter* f) const { | 434 void BranchInstr::PrintTo(BufferFormatter* f) const { |
| 428 f->Print(" %s ", DebugName()); | 435 f->Print(" %s ", DebugName()); |
| 429 f->Print("if "); | 436 f->Print("if "); |
| 430 if (is_fused_with_comparison()) { | 437 if (is_fused_with_comparison()) { |
| 431 if (is_negated()) f->Print(" not "); | 438 if (is_negated()) f->Print(" not "); |
| 432 fused_with_comparison_->PrintTo(f); | 439 fused_with_comparison_->PrintTo(f); |
| 433 } else { | 440 } else { |
| 434 value()->PrintTo(f); | 441 value()->PrintTo(f); |
| 435 } | 442 } |
| 436 | 443 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 668 | 675 |
| 669 | 676 |
| 670 void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const { | 677 void ReThrowInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 671 f->Print("_ %s ", DebugName()); | 678 f->Print("_ %s ", DebugName()); |
| 672 exception()->PrintTo(f); | 679 exception()->PrintTo(f); |
| 673 f->Print(", "); | 680 f->Print(", "); |
| 674 stack_trace()->PrintTo(f); | 681 stack_trace()->PrintTo(f); |
| 675 } | 682 } |
| 676 | 683 |
| 677 | 684 |
| 685 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const { | |
| 686 f->Print("_ goto B%d", successor()->block_id()); | |
| 687 } | |
| 688 | |
| 689 | |
| 678 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { | 690 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 679 f->Print("_ %s ", DebugName()); | 691 f->Print("_ %s ", DebugName()); |
| 680 f->Print("if "); | 692 f->Print("if "); |
| 681 value()->PrintTo(f); | 693 value()->PrintTo(f); |
| 682 f->Print(" goto (B%d, B%d)", | 694 f->Print(" goto (B%d, B%d)", |
| 683 true_successor()->block_id(), | 695 true_successor()->block_id(), |
| 684 false_successor()->block_id()); | 696 false_successor()->block_id()); |
| 685 } | 697 } |
| 686 | 698 |
| 687 | 699 |
| 688 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { | 700 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { |
| 689 UNIMPLEMENTED(); | 701 UNIMPLEMENTED(); |
| 690 } | 702 } |
| 691 | 703 |
| 692 | 704 |
| 693 void Environment::PrintTo(BufferFormatter* f) const { | 705 void Environment::PrintTo(BufferFormatter* f) const { |
| 694 f->Print(" env={ "); | 706 f->Print(" env={ "); |
| 695 for (intptr_t i = 0; i < values_.length(); ++i) { | 707 for (intptr_t i = 0; i < values_.length(); ++i) { |
| 696 if (i > 0) f->Print(", "); | 708 if (i > 0) f->Print(", "); |
| 697 values_[i]->PrintTo(f); | 709 values_[i]->PrintTo(f); |
| 698 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { | 710 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { |
| 699 f->Print(" [%s]", locations_[i].Name()); | 711 f->Print(" [%s]", locations_[i].Name()); |
| 700 } | 712 } |
| 701 } | 713 } |
| 702 f->Print(" }"); | 714 f->Print(" }"); |
| 703 } | 715 } |
| 704 | 716 |
| 705 } // namespace dart | 717 } // namespace dart |
| OLD | NEW |