Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: runtime/vm/il_printer.cc

Issue 10967007: Inlining functions with control flow. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "vm/parser.h" 9 #include "vm/parser.h"
10 10
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 Definition* def = defns[i]; 515 Definition* def = defns[i];
516 f->Print("\n "); 516 f->Print("\n ");
517 def->PrintTo(f); 517 def->PrintTo(f);
518 } 518 }
519 f->Print("\n}"); 519 f->Print("\n}");
520 } 520 }
521 } 521 }
522 522
523 523
524 void JoinEntryInstr::PrintTo(BufferFormatter* f) const { 524 void JoinEntryInstr::PrintTo(BufferFormatter* f) const {
525 f->Print("B%"Pd"[join]", block_id()); 525 f->Print("B%"Pd"[join] pred(", block_id());
526 for (intptr_t i = 0; i < predecessors_.length(); ++i) {
527 if (i > 0) f->Print(", ");
528 f->Print("B%"Pd, predecessors_[i]->block_id());
529 }
530 f->Print(")");
526 if (phis_ != NULL) { 531 if (phis_ != NULL) {
527 f->Print(" {"); 532 f->Print(" {");
528 for (intptr_t i = 0; i < phis_->length(); ++i) { 533 for (intptr_t i = 0; i < phis_->length(); ++i) {
529 if ((*phis_)[i] == NULL) continue; 534 if ((*phis_)[i] == NULL) continue;
530 f->Print("\n "); 535 f->Print("\n ");
531 (*phis_)[i]->PrintTo(f); 536 (*phis_)[i]->PrintTo(f);
532 } 537 }
533 f->Print("\n}"); 538 f->Print("\n}");
534 } 539 }
535 if (HasParallelMove()) { 540 if (HasParallelMove()) {
536 f->Print(" "); 541 f->Print(" ");
537 parallel_move()->PrintTo(f); 542 parallel_move()->PrintTo(f);
538 } 543 }
539 } 544 }
540 545
541 546
542 void PhiInstr::PrintTo(BufferFormatter* f) const { 547 void PhiInstr::PrintTo(BufferFormatter* f) const {
543 f->Print("v%"Pd" <- phi(", ssa_temp_index()); 548 f->Print("v%"Pd" <- phi(", ssa_temp_index());
544 for (intptr_t i = 0; i < inputs_.length(); ++i) { 549 for (intptr_t i = 0; i < inputs_.length(); ++i) {
545 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f); 550 if (inputs_[i] != NULL) inputs_[i]->PrintTo(f);
546 if (i < inputs_.length() - 1) f->Print(", "); 551 if (i < inputs_.length() - 1) f->Print(", ");
547 } 552 }
548 f->Print(")"); 553 f->Print(")");
549 PrintPropagatedType(f, *this); 554 PrintPropagatedType(f, *this);
555 if (is_alive()) {
556 f->Print(" alive");
557 } else {
558 f->Print(" dead");
559 }
550 if (range_ != NULL) { 560 if (range_ != NULL) {
551 f->Print(" "); 561 f->Print(" ");
552 range_->PrintTo(f); 562 range_->PrintTo(f);
553 } 563 }
554 } 564 }
555 565
556 566
557 void ParameterInstr::PrintOperandsTo(BufferFormatter* f) const { 567 void ParameterInstr::PrintOperandsTo(BufferFormatter* f) const {
558 f->Print("%"Pd, index()); 568 f->Print("%"Pd, index());
559 } 569 }
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 f->Print(" ["); 841 f->Print(" [");
832 locations_[i].PrintTo(f); 842 locations_[i].PrintTo(f);
833 f->Print("]"); 843 f->Print("]");
834 } 844 }
835 } 845 }
836 f->Print(" }"); 846 f->Print(" }");
837 if (outer_ != NULL) outer_->PrintTo(f); 847 if (outer_ != NULL) outer_->PrintTo(f);
838 } 848 }
839 849
840 } // namespace dart 850 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698