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

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

Issue 6964011: Refactor HCheckInstanceType to allow mask/tag tests. (Closed)
Patch Set: Rebased Created 9 years, 7 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
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('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 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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 744
745 void HChange::PrintDataTo(StringStream* stream) { 745 void HChange::PrintDataTo(StringStream* stream) {
746 HUnaryOperation::PrintDataTo(stream); 746 HUnaryOperation::PrintDataTo(stream);
747 stream->Add(" %s to %s", from_.Mnemonic(), to().Mnemonic()); 747 stream->Add(" %s to %s", from_.Mnemonic(), to().Mnemonic());
748 748
749 if (CanTruncateToInt32()) stream->Add(" truncating-int32"); 749 if (CanTruncateToInt32()) stream->Add(" truncating-int32");
750 if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?"); 750 if (CheckFlag(kBailoutOnMinusZero)) stream->Add(" -0?");
751 } 751 }
752 752
753 753
754 HCheckInstanceType* HCheckInstanceType::NewIsJSObjectOrJSFunction( 754 void HCheckInstanceType::GetCheckInterval(InstanceType* first,
755 HValue* value) { 755 InstanceType* last) {
756 STATIC_ASSERT((LAST_JS_OBJECT_TYPE + 1) == JS_FUNCTION_TYPE); 756 ASSERT(is_interval_check());
757 return new HCheckInstanceType(value, FIRST_JS_OBJECT_TYPE, JS_FUNCTION_TYPE); 757 switch (check_) {
758 case IS_JS_OBJECT_OR_JS_FUNCTION:
759 STATIC_ASSERT((LAST_JS_OBJECT_TYPE + 1) == JS_FUNCTION_TYPE);
760 *first = FIRST_JS_OBJECT_TYPE;
761 *last = JS_FUNCTION_TYPE;
762 return;
763 case IS_JS_ARRAY:
764 *first = *last = JS_ARRAY_TYPE;
765 return;
766 default:
767 UNREACHABLE();
768 }
758 } 769 }
759 770
760 771
772 void HCheckInstanceType::GetCheckMaskAndTag(uint8_t* mask, uint8_t* tag) {
773 ASSERT(!is_interval_check());
774 switch (check_) {
775 case IS_STRING:
776 *mask = kIsNotStringMask;
777 *tag = kStringTag;
778 return;
779 case IS_SYMBOL:
780 *mask = kIsSymbolMask;
781 *tag = kSymbolTag;
782 return;
783 default:
784 UNREACHABLE();
785 }
786 }
787
788
761 void HCheckMap::PrintDataTo(StringStream* stream) { 789 void HCheckMap::PrintDataTo(StringStream* stream) {
762 value()->PrintNameTo(stream); 790 value()->PrintNameTo(stream);
763 stream->Add(" %p", *map()); 791 stream->Add(" %p", *map());
764 } 792 }
765 793
766 794
767 void HCheckFunction::PrintDataTo(StringStream* stream) { 795 void HCheckFunction::PrintDataTo(StringStream* stream) {
768 value()->PrintNameTo(stream); 796 value()->PrintNameTo(stream);
769 stream->Add(" %p", *target()); 797 stream->Add(" %p", *target());
770 } 798 }
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
1695 1723
1696 1724
1697 void HCheckPrototypeMaps::Verify() { 1725 void HCheckPrototypeMaps::Verify() {
1698 HInstruction::Verify(); 1726 HInstruction::Verify();
1699 ASSERT(HasNoUses()); 1727 ASSERT(HasNoUses());
1700 } 1728 }
1701 1729
1702 #endif 1730 #endif
1703 1731
1704 } } // namespace v8::internal 1732 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698