OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
738 } | 738 } |
739 | 739 |
740 void SetArgsInRegisters() { args_in_registers_ = true; } | 740 void SetArgsInRegisters() { args_in_registers_ = true; } |
741 void SetArgsReversed() { args_reversed_ = true; } | 741 void SetArgsReversed() { args_reversed_ = true; } |
742 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } | 742 bool HasSmiCodeInStub() { return (flags_ & NO_SMI_CODE_IN_STUB) == 0; } |
743 bool HasArgsInRegisters() { return args_in_registers_; } | 743 bool HasArgsInRegisters() { return args_in_registers_; } |
744 bool HasArgsReversed() { return args_reversed_; } | 744 bool HasArgsReversed() { return args_reversed_; } |
745 }; | 745 }; |
746 | 746 |
747 | 747 |
748 // Flag that indicates how to generate code for the stub StringAddStub. | |
749 enum StringAddFlags { | |
750 NO_STRING_ADD_FLAGS = 0, | |
751 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. | |
752 }; | |
753 | |
754 | |
755 class StringStubBase: public CodeStub { | 748 class StringStubBase: public CodeStub { |
756 public: | 749 public: |
757 // Generate code for copying characters using a simple loop. This should only | 750 // Generate code for copying characters using a simple loop. This should only |
758 // be used in places where the number of characters is small and the | 751 // be used in places where the number of characters is small and the |
759 // additional setup and checking in GenerateCopyCharactersREP adds too much | 752 // additional setup and checking in GenerateCopyCharactersREP adds too much |
760 // overhead. Copying of overlapping regions is not supported. | 753 // overhead. Copying of overlapping regions is not supported. |
761 void GenerateCopyCharacters(MacroAssembler* masm, | 754 void GenerateCopyCharacters(MacroAssembler* masm, |
762 Register dest, | 755 Register dest, |
763 Register src, | 756 Register src, |
764 Register count, | 757 Register count, |
765 Register scratch, | 758 Register scratch, |
766 bool ascii); | 759 bool ascii); |
767 | 760 |
768 // Generate code for copying characters using the rep movs instruction. | 761 // Generate code for copying characters using the rep movs instruction. |
769 // Copies ecx characters from esi to edi. Copying of overlapping regions is | 762 // Copies ecx characters from esi to edi. Copying of overlapping regions is |
770 // not supported. | 763 // not supported. |
771 void GenerateCopyCharactersREP(MacroAssembler* masm, | 764 void GenerateCopyCharactersREP(MacroAssembler* masm, |
772 Register dest, // Must be edi. | 765 Register dest, // Must be edi. |
773 Register src, // Must be esi. | 766 Register src, // Must be esi. |
774 Register count, // Must be ecx. | 767 Register count, // Must be ecx. |
775 Register scratch, // Neither of the above. | 768 Register scratch, // Neither of the above. |
776 bool ascii); | 769 bool ascii); |
777 }; | 770 }; |
778 | 771 |
779 | 772 |
| 773 // Flag that indicates how to generate code for the stub StringAddStub. |
| 774 enum StringAddFlags { |
| 775 NO_STRING_ADD_FLAGS = 0, |
| 776 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. |
| 777 }; |
| 778 |
| 779 |
780 class StringAddStub: public StringStubBase { | 780 class StringAddStub: public StringStubBase { |
781 public: | 781 public: |
782 explicit StringAddStub(StringAddFlags flags) { | 782 explicit StringAddStub(StringAddFlags flags) { |
783 string_check_ = ((flags & NO_STRING_CHECK_IN_STUB) == 0); | 783 string_check_ = ((flags & NO_STRING_CHECK_IN_STUB) == 0); |
784 } | 784 } |
785 | 785 |
786 private: | 786 private: |
787 Major MajorKey() { return StringAdd; } | 787 Major MajorKey() { return StringAdd; } |
788 int MinorKey() { return string_check_ ? 0 : 1; } | 788 int MinorKey() { return string_check_ ? 0 : 1; } |
789 | 789 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 Major MajorKey() { return StringCompare; } | 824 Major MajorKey() { return StringCompare; } |
825 int MinorKey() { return 0; } | 825 int MinorKey() { return 0; } |
826 | 826 |
827 void Generate(MacroAssembler* masm); | 827 void Generate(MacroAssembler* masm); |
828 }; | 828 }; |
829 | 829 |
830 | 830 |
831 } } // namespace v8::internal | 831 } } // namespace v8::internal |
832 | 832 |
833 #endif // V8_IA32_CODEGEN_IA32_H_ | 833 #endif // V8_IA32_CODEGEN_IA32_H_ |
OLD | NEW |