OLD | NEW |
1 // Copyright 2006-2008 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 }; | 716 }; |
717 | 717 |
718 | 718 |
719 class CallFunctionStub: public CodeStub { | 719 class CallFunctionStub: public CodeStub { |
720 public: | 720 public: |
721 CallFunctionStub(int argc, InLoopFlag in_loop, CallFunctionFlags flags) | 721 CallFunctionStub(int argc, InLoopFlag in_loop, CallFunctionFlags flags) |
722 : argc_(argc), in_loop_(in_loop), flags_(flags) { } | 722 : argc_(argc), in_loop_(in_loop), flags_(flags) { } |
723 | 723 |
724 void Generate(MacroAssembler* masm); | 724 void Generate(MacroAssembler* masm); |
725 | 725 |
| 726 static int ExtractArgcFromMinorKey(int minor_key) { |
| 727 return ArgcBits::decode(minor_key); |
| 728 } |
| 729 |
726 private: | 730 private: |
727 int argc_; | 731 int argc_; |
728 InLoopFlag in_loop_; | 732 InLoopFlag in_loop_; |
729 CallFunctionFlags flags_; | 733 CallFunctionFlags flags_; |
730 | 734 |
731 #ifdef DEBUG | 735 #ifdef DEBUG |
732 void Print() { | 736 void Print() { |
733 PrintF("CallFunctionStub (args %d, in_loop %d, flags %d)\n", | 737 PrintF("CallFunctionStub (args %d, in_loop %d, flags %d)\n", |
734 argc_, | 738 argc_, |
735 static_cast<int>(in_loop_), | 739 static_cast<int>(in_loop_), |
(...skipping 11 matching lines...) Expand all Loading... |
747 // Encode the parameters in a unique 32 bit value. | 751 // Encode the parameters in a unique 32 bit value. |
748 return InLoopBits::encode(in_loop_) | 752 return InLoopBits::encode(in_loop_) |
749 | FlagBits::encode(flags_) | 753 | FlagBits::encode(flags_) |
750 | ArgcBits::encode(argc_); | 754 | ArgcBits::encode(argc_); |
751 } | 755 } |
752 | 756 |
753 InLoopFlag InLoop() { return in_loop_; } | 757 InLoopFlag InLoop() { return in_loop_; } |
754 bool ReceiverMightBeValue() { | 758 bool ReceiverMightBeValue() { |
755 return (flags_ & RECEIVER_MIGHT_BE_VALUE) != 0; | 759 return (flags_ & RECEIVER_MIGHT_BE_VALUE) != 0; |
756 } | 760 } |
757 | |
758 public: | |
759 static int ExtractArgcFromMinorKey(int minor_key) { | |
760 return ArgcBits::decode(minor_key); | |
761 } | |
762 }; | 761 }; |
763 | 762 |
764 | 763 |
765 enum StringIndexFlags { | 764 enum StringIndexFlags { |
766 // Accepts smis or heap numbers. | 765 // Accepts smis or heap numbers. |
767 STRING_INDEX_IS_NUMBER, | 766 STRING_INDEX_IS_NUMBER, |
768 | 767 |
769 // Accepts smis or heap numbers that are valid array indices | 768 // Accepts smis or heap numbers that are valid array indices |
770 // (ECMA-262 15.4). Invalid indices are reported as being out of | 769 // (ECMA-262 15.4). Invalid indices are reported as being out of |
771 // range. | 770 // range. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 private: | 913 private: |
915 StringCharCodeAtGenerator char_code_at_generator_; | 914 StringCharCodeAtGenerator char_code_at_generator_; |
916 StringCharFromCodeGenerator char_from_code_generator_; | 915 StringCharFromCodeGenerator char_from_code_generator_; |
917 | 916 |
918 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); | 917 DISALLOW_COPY_AND_ASSIGN(StringCharAtGenerator); |
919 }; | 918 }; |
920 | 919 |
921 } } // namespace v8::internal | 920 } } // namespace v8::internal |
922 | 921 |
923 #endif // V8_CODE_STUBS_H_ | 922 #endif // V8_CODE_STUBS_H_ |
OLD | NEW |