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

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

Issue 10802025: Fuse compare with branch at graph building time. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 5 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9
10 namespace dart { 10 namespace dart {
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 443
444 444
445 void GotoInstr::PrintTo(BufferFormatter* f) const { 445 void GotoInstr::PrintTo(BufferFormatter* f) const {
446 f->Print(" goto %d", successor()->block_id()); 446 f->Print(" goto %d", successor()->block_id());
447 } 447 }
448 448
449 449
450 void BranchInstr::PrintTo(BufferFormatter* f) const { 450 void BranchInstr::PrintTo(BufferFormatter* f) const {
451 f->Print(" %s ", DebugName()); 451 f->Print(" %s ", DebugName());
452 f->Print("if "); 452 f->Print("if ");
453 if (is_fused_with_comparison()) { 453 left()->PrintTo(f);
454 if (is_negated()) f->Print(" not "); 454 f-> Print(" %s ", Token::Str(kind()));
455 fused_with_comparison_->PrintTo(f); 455 right()->PrintTo(f);
456 } else {
457 value()->PrintTo(f);
458 }
459 456
460 f->Print(" goto (%d, %d)", 457 f->Print(" goto (%d, %d)",
461 true_successor()->block_id(), 458 true_successor()->block_id(),
462 false_successor()->block_id()); 459 false_successor()->block_id());
460 if (HasICData()) {
461 PrintICData(f, *ic_data());
462 }
463 } 463 }
464 464
465 465
466 void ParallelMoveInstr::PrintTo(BufferFormatter* f) const { 466 void ParallelMoveInstr::PrintTo(BufferFormatter* f) const {
467 f->Print(" %s ", DebugName()); 467 f->Print(" %s ", DebugName());
468 for (intptr_t i = 0; i < moves_.length(); i++) { 468 for (intptr_t i = 0; i < moves_.length(); i++) {
469 if (i != 0) f->Print(", "); 469 if (i != 0) f->Print(", ");
470 f->Print("%s = %s", moves_[i].dest().Name(), moves_[i].src().Name()); 470 f->Print("%s = %s", moves_[i].dest().Name(), moves_[i].src().Name());
471 } 471 }
472 } 472 }
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 699
700 700
701 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const { 701 void GotoInstr::PrintToVisualizer(BufferFormatter* f) const {
702 f->Print("_ goto B%d", successor()->block_id()); 702 f->Print("_ goto B%d", successor()->block_id());
703 } 703 }
704 704
705 705
706 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const { 706 void BranchInstr::PrintToVisualizer(BufferFormatter* f) const {
707 f->Print("_ %s ", DebugName()); 707 f->Print("_ %s ", DebugName());
708 f->Print("if "); 708 f->Print("if ");
709 value()->PrintTo(f); 709 left()->PrintTo(f);
710 f-> Print(" %s ", Token::Str(kind()));
711 right()->PrintTo(f);
710 f->Print(" goto (B%d, B%d)", 712 f->Print(" goto (B%d, B%d)",
711 true_successor()->block_id(), 713 true_successor()->block_id(),
712 false_successor()->block_id()); 714 false_successor()->block_id());
713 } 715 }
714 716
715 717
716 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const { 718 void ParallelMoveInstr::PrintToVisualizer(BufferFormatter* f) const {
717 UNIMPLEMENTED(); 719 UNIMPLEMENTED();
718 } 720 }
719 721
720 722
721 void Environment::PrintTo(BufferFormatter* f) const { 723 void Environment::PrintTo(BufferFormatter* f) const {
722 f->Print(" env={ "); 724 f->Print(" env={ ");
723 for (intptr_t i = 0; i < values_.length(); ++i) { 725 for (intptr_t i = 0; i < values_.length(); ++i) {
724 if (i > 0) f->Print(", "); 726 if (i > 0) f->Print(", ");
725 values_[i]->PrintTo(f); 727 values_[i]->PrintTo(f);
726 if ((i < locations_.length()) && !locations_[i].IsInvalid()) { 728 if ((i < locations_.length()) && !locations_[i].IsInvalid()) {
727 f->Print(" [%s]", locations_[i].Name()); 729 f->Print(" [%s]", locations_[i].Name());
728 } 730 }
729 } 731 }
730 f->Print(" }"); 732 f->Print(" }");
731 } 733 }
732 734
733 } // namespace dart 735 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698