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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 Register code, | 848 Register code, |
849 Register result, | 849 Register result, |
850 Register scratch, | 850 Register scratch, |
851 InvokeFlag flag); | 851 InvokeFlag flag); |
852 | 852 |
853 // Generate code for copying characters using a simple loop. This should only | 853 // Generate code for copying characters using a simple loop. This should only |
854 // be used in places where the number of characters is small and the | 854 // be used in places where the number of characters is small and the |
855 // additional setup and checking in GenerateCopyCharactersREP adds too much | 855 // additional setup and checking in GenerateCopyCharactersREP adds too much |
856 // overhead. Copying of overlapping regions is not supported. | 856 // overhead. Copying of overlapping regions is not supported. |
857 static void GenerateCopyCharacters(MacroAssembler* masm, | 857 static void GenerateCopyCharacters(MacroAssembler* masm, |
858 Register dest, | 858 Register dest, |
859 Register src, | 859 Register src, |
860 Register count, | 860 Register count, |
861 bool ascii); | 861 bool ascii); |
862 | 862 |
863 // Generate code for copying characters using the rep movs instruction. | 863 // Generate code for copying characters using the rep movs instruction. |
864 // Copies rcx characters from rsi to rdi. Copying of overlapping regions is | 864 // Copies rcx characters from rsi to rdi. Copying of overlapping regions is |
865 // not supported. | 865 // not supported. |
866 static void GenerateCopyCharactersREP(MacroAssembler* masm, | 866 static void GenerateCopyCharactersREP(MacroAssembler* masm, |
867 Register dest, // Must be rdi. | 867 Register dest, // Must be rdi. |
868 Register src, // Must be rsi. | 868 Register src, // Must be rsi. |
869 Register count, // Must be rcx. | 869 Register count, // Must be rcx. |
870 bool ascii); | 870 bool ascii); |
871 | 871 |
872 | 872 |
873 // Probe the symbol table for a two character string. If the string is | 873 // Probe the symbol table for a two character string. If the string is |
874 // not found by probing a jump to the label not_found is performed. This jump | 874 // not found by probing a jump to the label not_found is performed. This jump |
875 // does not guarantee that the string is not in the symbol table. If the | 875 // does not guarantee that the string is not in the symbol table. If the |
876 // string is found the code falls through with the string in register rax. | 876 // string is found the code falls through with the string in register rax. |
877 static void GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm, | 877 static void GenerateTwoCharacterSymbolTableProbe(MacroAssembler* masm, |
878 Register c1, | 878 Register c1, |
879 Register c2, | 879 Register c2, |
880 Register scratch1, | 880 Register scratch1, |
881 Register scratch2, | 881 Register scratch2, |
882 Register scratch3, | 882 Register scratch3, |
883 Register scratch4, | 883 Register scratch4, |
884 Label* not_found); | 884 Label* not_found); |
885 | 885 |
886 // Generate string hash. | 886 // Generate string hash. |
887 static void GenerateHashInit(MacroAssembler* masm, | 887 static void GenerateHashInit(MacroAssembler* masm, |
888 Register hash, | 888 Register hash, |
889 Register character, | 889 Register character, |
890 Register scratch); | 890 Register scratch); |
891 static void GenerateHashAddCharacter(MacroAssembler* masm, | 891 static void GenerateHashAddCharacter(MacroAssembler* masm, |
892 Register hash, | 892 Register hash, |
893 Register character, | 893 Register character, |
894 Register scratch); | 894 Register scratch); |
895 static void GenerateHashGetHash(MacroAssembler* masm, | 895 static void GenerateHashGetHash(MacroAssembler* masm, |
896 Register hash, | 896 Register hash, |
897 Register scratch); | 897 Register scratch); |
| 898 |
898 private: | 899 private: |
899 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); | 900 DISALLOW_IMPLICIT_CONSTRUCTORS(StringHelper); |
900 }; | 901 }; |
901 | 902 |
902 | 903 |
903 // Flag that indicates how to generate code for the stub StringAddStub. | 904 // Flag that indicates how to generate code for the stub StringAddStub. |
904 enum StringAddFlags { | 905 enum StringAddFlags { |
905 NO_STRING_ADD_FLAGS = 0, | 906 NO_STRING_ADD_FLAGS = 0, |
906 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. | 907 NO_STRING_CHECK_IN_STUB = 1 << 0 // Omit string check in stub. |
907 }; | 908 }; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 void Print() { | 992 void Print() { |
992 PrintF("NumberToStringStub\n"); | 993 PrintF("NumberToStringStub\n"); |
993 } | 994 } |
994 #endif | 995 #endif |
995 }; | 996 }; |
996 | 997 |
997 | 998 |
998 } } // namespace v8::internal | 999 } } // namespace v8::internal |
999 | 1000 |
1000 #endif // V8_X64_CODEGEN_X64_H_ | 1001 #endif // V8_X64_CODEGEN_X64_H_ |
OLD | NEW |