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

Side by Side Diff: src/hydrogen-instructions.cc

Issue 8002021: Improved printing of a few Hydrogen instructions. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 3 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 | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 stream->Add(")"); 700 stream->Add(")");
701 } 701 }
702 702
703 703
704 void HUnaryControlInstruction::PrintDataTo(StringStream* stream) { 704 void HUnaryControlInstruction::PrintDataTo(StringStream* stream) {
705 value()->PrintNameTo(stream); 705 value()->PrintNameTo(stream);
706 HControlInstruction::PrintDataTo(stream); 706 HControlInstruction::PrintDataTo(stream);
707 } 707 }
708 708
709 709
710 void HIsNilAndBranch::PrintDataTo(StringStream* stream) {
711 value()->PrintNameTo(stream);
712 stream->Add(kind() == kStrictEquality ? " === " : " == ");
713 stream->Add(nil() == kNullValue ? "null" : "undefined");
714 HControlInstruction::PrintDataTo(stream);
715 }
716
717
710 void HReturn::PrintDataTo(StringStream* stream) { 718 void HReturn::PrintDataTo(StringStream* stream) {
711 value()->PrintNameTo(stream); 719 value()->PrintNameTo(stream);
712 } 720 }
713 721
714 722
715 void HCompareMap::PrintDataTo(StringStream* stream) { 723 void HCompareMap::PrintDataTo(StringStream* stream) {
716 value()->PrintNameTo(stream); 724 value()->PrintNameTo(stream);
717 stream->Add(" (%p)", *map()); 725 stream->Add(" (%p)", *map());
718 HControlInstruction::PrintDataTo(stream); 726 HControlInstruction::PrintDataTo(stream);
719 } 727 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 default: 778 default:
771 break; 779 break;
772 } 780 }
773 } 781 }
774 782
775 783
776 void HTypeofIsAndBranch::PrintDataTo(StringStream* stream) { 784 void HTypeofIsAndBranch::PrintDataTo(StringStream* stream) {
777 value()->PrintNameTo(stream); 785 value()->PrintNameTo(stream);
778 stream->Add(" == "); 786 stream->Add(" == ");
779 stream->Add(type_literal_->GetFlatContent().ToAsciiVector()); 787 stream->Add(type_literal_->GetFlatContent().ToAsciiVector());
788 HControlInstruction::PrintDataTo(stream);
789 }
790
791
792 void HTypeof::PrintDataTo(StringStream* stream) {
793 value()->PrintNameTo(stream);
780 } 794 }
781 795
782 796
783 void HChange::PrintDataTo(StringStream* stream) { 797 void HChange::PrintDataTo(StringStream* stream) {
784 HUnaryOperation::PrintDataTo(stream); 798 HUnaryOperation::PrintDataTo(stream);
785 stream->Add(" %s to %s", from_.Mnemonic(), to().Mnemonic()); 799 stream->Add(" %s to %s", from_.Mnemonic(), to().Mnemonic());
786 800
787 if (CanTruncateToInt32()) stream->Add(" truncating-int32"); 801 if (CanTruncateToInt32()) stream->Add(" truncating-int32");
788 if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?"); 802 if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?");
789 } 803 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 stream->Add(" %p", *map()); 864 stream->Add(" %p", *map());
851 } 865 }
852 866
853 867
854 void HCheckFunction::PrintDataTo(StringStream* stream) { 868 void HCheckFunction::PrintDataTo(StringStream* stream) {
855 value()->PrintNameTo(stream); 869 value()->PrintNameTo(stream);
856 stream->Add(" %p", *target()); 870 stream->Add(" %p", *target());
857 } 871 }
858 872
859 873
874 const char* HCheckInstanceType::GetCheckName() {
875 switch (check_) {
876 case IS_SPEC_OBJECT: return "object";
877 case IS_JS_ARRAY: return "array";
878 case IS_STRING: return "string";
879 case IS_SYMBOL: return "symbol";
880 default: UNREACHABLE();
881 }
882 return "";
883 }
884
885 void HCheckInstanceType::PrintDataTo(StringStream* stream) {
886 stream->Add("%s ", GetCheckName());
887 HUnaryOperation::PrintDataTo(stream);
888 }
889
890
860 void HCallStub::PrintDataTo(StringStream* stream) { 891 void HCallStub::PrintDataTo(StringStream* stream) {
861 stream->Add("%s ", 892 stream->Add("%s ",
862 CodeStub::MajorName(major_key_, false)); 893 CodeStub::MajorName(major_key_, false));
863 HUnaryCall::PrintDataTo(stream); 894 HUnaryCall::PrintDataTo(stream);
864 } 895 }
865 896
866 897
867 void HInstanceOf::PrintDataTo(StringStream* stream) { 898 void HInstanceOf::PrintDataTo(StringStream* stream) {
868 left()->PrintNameTo(stream); 899 left()->PrintNameTo(stream);
869 stream->Add(" "); 900 stream->Add(" ");
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1304 void HCompareIDAndBranch::PrintDataTo(StringStream* stream) { 1335 void HCompareIDAndBranch::PrintDataTo(StringStream* stream) {
1305 stream->Add(Token::Name(token())); 1336 stream->Add(Token::Name(token()));
1306 stream->Add(" "); 1337 stream->Add(" ");
1307 left()->PrintNameTo(stream); 1338 left()->PrintNameTo(stream);
1308 stream->Add(" "); 1339 stream->Add(" ");
1309 right()->PrintNameTo(stream); 1340 right()->PrintNameTo(stream);
1310 HControlInstruction::PrintDataTo(stream); 1341 HControlInstruction::PrintDataTo(stream);
1311 } 1342 }
1312 1343
1313 1344
1345 void HCompareObjectEqAndBranch::PrintDataTo(StringStream* stream) {
1346 left()->PrintNameTo(stream);
1347 stream->Add(" ");
1348 right()->PrintNameTo(stream);
1349 HControlInstruction::PrintDataTo(stream);
1350 }
1351
1352
1314 void HGoto::PrintDataTo(StringStream* stream) { 1353 void HGoto::PrintDataTo(StringStream* stream) {
1315 stream->Add("B%d", SuccessorAt(0)->block_id()); 1354 stream->Add("B%d", SuccessorAt(0)->block_id());
1316 } 1355 }
1317 1356
1318 1357
1319 void HCompareIDAndBranch::SetInputRepresentation(Representation r) { 1358 void HCompareIDAndBranch::SetInputRepresentation(Representation r) {
1320 input_representation_ = r; 1359 input_representation_ = r;
1321 if (r.IsDouble()) { 1360 if (r.IsDouble()) {
1322 SetFlag(kDeoptimizeOnUndefined); 1361 SetFlag(kDeoptimizeOnUndefined);
1323 } else { 1362 } else {
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
1887 1926
1888 1927
1889 void HCheckPrototypeMaps::Verify() { 1928 void HCheckPrototypeMaps::Verify() {
1890 HInstruction::Verify(); 1929 HInstruction::Verify();
1891 ASSERT(HasNoUses()); 1930 ASSERT(HasNoUses());
1892 } 1931 }
1893 1932
1894 #endif 1933 #endif
1895 1934
1896 } } // namespace v8::internal 1935 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698