| 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/flow_graph_range_analysis.h" | 7 #include "vm/flow_graph_range_analysis.h" |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 #include "vm/os.h" | 9 #include "vm/os.h" |
| 10 #include "vm/parser.h" | 10 #include "vm/parser.h" |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 Definition::PrintOperandsTo(f); | 585 Definition::PrintOperandsTo(f); |
| 586 } | 586 } |
| 587 | 587 |
| 588 | 588 |
| 589 void ExtractNthOutputInstr::PrintOperandsTo(BufferFormatter* f) const { | 589 void ExtractNthOutputInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 590 f->Print("Extract %" Pd " from ", index()); | 590 f->Print("Extract %" Pd " from ", index()); |
| 591 Definition::PrintOperandsTo(f); | 591 Definition::PrintOperandsTo(f); |
| 592 } | 592 } |
| 593 | 593 |
| 594 | 594 |
| 595 void BinarySmiOpInstr::PrintTo(BufferFormatter* f) const { | 595 void UnaryIntegerOpInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 596 Definition::PrintTo(f); | 596 f->Print("%s, ", Token::Str(op_kind())); |
| 597 f->Print(" %co", overflow_ ? '+' : '-'); | 597 value()->PrintTo(f); |
| 598 f->Print(" %ct", IsTruncating() ? '+' : '-'); | |
| 599 } | 598 } |
| 600 | 599 |
| 601 | 600 |
| 602 void BinarySmiOpInstr::PrintOperandsTo(BufferFormatter* f) const { | 601 void BinaryIntegerOpInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 603 f->Print("%s, ", Token::Str(op_kind())); | 602 f->Print("%s", Token::Str(op_kind())); |
| 603 if (is_truncating()) { |
| 604 f->Print(" [tr]"); |
| 605 } else if (!can_overflow()) { |
| 606 f->Print(" [-o]"); |
| 607 } |
| 608 f->Print(", "); |
| 604 left()->PrintTo(f); | 609 left()->PrintTo(f); |
| 605 f->Print(", "); | 610 f->Print(", "); |
| 606 right()->PrintTo(f); | 611 right()->PrintTo(f); |
| 607 } | |
| 608 | |
| 609 | |
| 610 void BinaryInt32OpInstr::PrintTo(BufferFormatter* f) const { | |
| 611 Definition::PrintTo(f); | |
| 612 f->Print(" %co", overflow_ ? '+' : '-'); | |
| 613 f->Print(" %ct", IsTruncating() ? '+' : '-'); | |
| 614 } | |
| 615 | |
| 616 | |
| 617 void BinaryInt32OpInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 618 f->Print("%s, ", Token::Str(op_kind())); | |
| 619 left()->PrintTo(f); | |
| 620 f->Print(", "); | |
| 621 right()->PrintTo(f); | |
| 622 } | 612 } |
| 623 | 613 |
| 624 | 614 |
| 625 void BinaryDoubleOpInstr::PrintOperandsTo(BufferFormatter* f) const { | 615 void BinaryDoubleOpInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 626 f->Print("%s, ", Token::Str(op_kind())); | 616 f->Print("%s, ", Token::Str(op_kind())); |
| 627 left()->PrintTo(f); | 617 left()->PrintTo(f); |
| 628 f->Print(", "); | 618 f->Print(", "); |
| 629 right()->PrintTo(f); | 619 right()->PrintTo(f); |
| 630 } | 620 } |
| 631 | 621 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 | 854 |
| 865 | 855 |
| 866 void BinaryInt32x4OpInstr::PrintOperandsTo(BufferFormatter* f) const { | 856 void BinaryInt32x4OpInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 867 f->Print("%s, ", Token::Str(op_kind())); | 857 f->Print("%s, ", Token::Str(op_kind())); |
| 868 left()->PrintTo(f); | 858 left()->PrintTo(f); |
| 869 f->Print(", "); | 859 f->Print(", "); |
| 870 right()->PrintTo(f); | 860 right()->PrintTo(f); |
| 871 } | 861 } |
| 872 | 862 |
| 873 | 863 |
| 874 void BinaryMintOpInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 875 f->Print("%s, ", Token::Str(op_kind())); | |
| 876 left()->PrintTo(f); | |
| 877 f->Print(", "); | |
| 878 right()->PrintTo(f); | |
| 879 } | |
| 880 | |
| 881 | |
| 882 void ShiftMintOpInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 883 f->Print("%s, ", Token::Str(op_kind())); | |
| 884 left()->PrintTo(f); | |
| 885 f->Print(", "); | |
| 886 right()->PrintTo(f); | |
| 887 } | |
| 888 | |
| 889 | |
| 890 void UnaryMintOpInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 891 f->Print("%s, ", Token::Str(op_kind())); | |
| 892 value()->PrintTo(f); | |
| 893 } | |
| 894 | |
| 895 | |
| 896 void BinaryUint32OpInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 897 f->Print("%s, ", Token::Str(op_kind())); | |
| 898 left()->PrintTo(f); | |
| 899 f->Print(", "); | |
| 900 right()->PrintTo(f); | |
| 901 } | |
| 902 | |
| 903 | |
| 904 void ShiftUint32OpInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 905 f->Print("%s, ", Token::Str(op_kind())); | |
| 906 left()->PrintTo(f); | |
| 907 f->Print(", "); | |
| 908 right()->PrintTo(f); | |
| 909 } | |
| 910 | |
| 911 | |
| 912 void UnaryUint32OpInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 913 f->Print("%s, ", Token::Str(op_kind())); | |
| 914 value()->PrintTo(f); | |
| 915 } | |
| 916 | |
| 917 | |
| 918 void UnarySmiOpInstr::PrintOperandsTo(BufferFormatter* f) const { | |
| 919 f->Print("%s, ", Token::Str(op_kind())); | |
| 920 value()->PrintTo(f); | |
| 921 } | |
| 922 | |
| 923 | |
| 924 void UnaryDoubleOpInstr::PrintOperandsTo(BufferFormatter* f) const { | 864 void UnaryDoubleOpInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 925 f->Print("%s, ", Token::Str(op_kind())); | 865 f->Print("%s, ", Token::Str(op_kind())); |
| 926 value()->PrintTo(f); | 866 value()->PrintTo(f); |
| 927 } | 867 } |
| 928 | 868 |
| 929 | 869 |
| 930 void CheckClassInstr::PrintOperandsTo(BufferFormatter* f) const { | 870 void CheckClassInstr::PrintOperandsTo(BufferFormatter* f) const { |
| 931 value()->PrintTo(f); | 871 value()->PrintTo(f); |
| 932 PrintICDataHelper(f, unary_checks()); | 872 PrintICDataHelper(f, unary_checks()); |
| 933 if (IsNullCheck()) { | 873 if (IsNullCheck()) { |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 } | 1110 } |
| 1171 | 1111 |
| 1172 const char* Environment::ToCString() const { | 1112 const char* Environment::ToCString() const { |
| 1173 char buffer[1024]; | 1113 char buffer[1024]; |
| 1174 BufferFormatter bf(buffer, 1024); | 1114 BufferFormatter bf(buffer, 1024); |
| 1175 PrintTo(&bf); | 1115 PrintTo(&bf); |
| 1176 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); | 1116 return Isolate::Current()->current_zone()->MakeCopyOfString(buffer); |
| 1177 } | 1117 } |
| 1178 | 1118 |
| 1179 } // namespace dart | 1119 } // namespace dart |
| OLD | NEW |