OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 } else { | 328 } else { |
329 ASSERT(mode_ == UC16); | 329 ASSERT(mode_ == UC16); |
330 // Save important/volatile registers before calling C function. | 330 // Save important/volatile registers before calling C function. |
331 #ifndef _WIN64 | 331 #ifndef _WIN64 |
332 // Caller save on Linux and callee save in Windows. | 332 // Caller save on Linux and callee save in Windows. |
333 __ push(rsi); | 333 __ push(rsi); |
334 __ push(rdi); | 334 __ push(rdi); |
335 #endif | 335 #endif |
336 __ push(backtrack_stackpointer()); | 336 __ push(backtrack_stackpointer()); |
337 | 337 |
338 int num_arguments = 3; | 338 static const int num_arguments = 3; |
339 __ PrepareCallCFunction(num_arguments); | 339 __ PrepareCallCFunction(num_arguments); |
340 | 340 |
341 // Put arguments into parameter registers. Parameters are | 341 // Put arguments into parameter registers. Parameters are |
342 // Address byte_offset1 - Address captured substring's start. | 342 // Address byte_offset1 - Address captured substring's start. |
343 // Address byte_offset2 - Address of current character position. | 343 // Address byte_offset2 - Address of current character position. |
344 // size_t byte_length - length of capture in bytes(!) | 344 // size_t byte_length - length of capture in bytes(!) |
345 #ifdef _WIN64 | 345 #ifdef _WIN64 |
346 // Compute and set byte_offset1 (start of capture). | 346 // Compute and set byte_offset1 (start of capture). |
347 __ lea(rcx, Operand(rsi, rdx, times_1, 0)); | 347 __ lea(rcx, Operand(rsi, rdx, times_1, 0)); |
348 // Set byte_offset2. | 348 // Set byte_offset2. |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 | 842 |
843 Label grow_failed; | 843 Label grow_failed; |
844 // Save registers before calling C function | 844 // Save registers before calling C function |
845 #ifndef _WIN64 | 845 #ifndef _WIN64 |
846 // Callee-save in Microsoft 64-bit ABI, but not in AMD64 ABI. | 846 // Callee-save in Microsoft 64-bit ABI, but not in AMD64 ABI. |
847 __ push(rsi); | 847 __ push(rsi); |
848 __ push(rdi); | 848 __ push(rdi); |
849 #endif | 849 #endif |
850 | 850 |
851 // Call GrowStack(backtrack_stackpointer()) | 851 // Call GrowStack(backtrack_stackpointer()) |
852 int num_arguments = 2; | 852 static const int num_arguments = 2; |
853 __ PrepareCallCFunction(num_arguments); | 853 __ PrepareCallCFunction(num_arguments); |
854 #ifdef _WIN64 | 854 #ifdef _WIN64 |
855 // Microsoft passes parameters in rcx, rdx. | 855 // Microsoft passes parameters in rcx, rdx. |
856 // First argument, backtrack stackpointer, is already in rcx. | 856 // First argument, backtrack stackpointer, is already in rcx. |
857 __ lea(rdx, Operand(rbp, kStackHighEnd)); // Second argument | 857 __ lea(rdx, Operand(rbp, kStackHighEnd)); // Second argument |
858 #else | 858 #else |
859 // AMD64 ABI passes parameters in rdi, rsi. | 859 // AMD64 ABI passes parameters in rdi, rsi. |
860 __ movq(rdi, backtrack_stackpointer()); // First argument. | 860 __ movq(rdi, backtrack_stackpointer()); // First argument. |
861 __ lea(rsi, Operand(rbp, kStackHighEnd)); // Second argument. | 861 __ lea(rsi, Operand(rbp, kStackHighEnd)); // Second argument. |
862 #endif | 862 #endif |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 __ subq(rax, Operand(rbp, kStackHighEnd)); | 1022 __ subq(rax, Operand(rbp, kStackHighEnd)); |
1023 __ movq(register_location(reg), rax); | 1023 __ movq(register_location(reg), rax); |
1024 } | 1024 } |
1025 | 1025 |
1026 | 1026 |
1027 // Private methods: | 1027 // Private methods: |
1028 | 1028 |
1029 void RegExpMacroAssemblerX64::CallCheckStackGuardState() { | 1029 void RegExpMacroAssemblerX64::CallCheckStackGuardState() { |
1030 // This function call preserves no register values. Caller should | 1030 // This function call preserves no register values. Caller should |
1031 // store anything volatile in a C call or overwritten by this function. | 1031 // store anything volatile in a C call or overwritten by this function. |
1032 int num_arguments = 3; | 1032 static const int num_arguments = 3; |
1033 __ PrepareCallCFunction(num_arguments); | 1033 __ PrepareCallCFunction(num_arguments); |
1034 #ifdef _WIN64 | 1034 #ifdef _WIN64 |
1035 // Second argument: Code* of self. (Do this before overwriting r8). | 1035 // Second argument: Code* of self. (Do this before overwriting r8). |
1036 __ movq(rdx, code_object_pointer()); | 1036 __ movq(rdx, code_object_pointer()); |
1037 // Third argument: RegExp code frame pointer. | 1037 // Third argument: RegExp code frame pointer. |
1038 __ movq(r8, rbp); | 1038 __ movq(r8, rbp); |
1039 // First argument: Next address on the stack (will be address of | 1039 // First argument: Next address on the stack (will be address of |
1040 // return address). | 1040 // return address). |
1041 __ lea(rcx, Operand(rsp, -kPointerSize)); | 1041 __ lea(rcx, Operand(rsp, -kPointerSize)); |
1042 #else | 1042 #else |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 Operand(rsi, rdi, times_1, cp_offset * sizeof(uc16))); | 1294 Operand(rsi, rdi, times_1, cp_offset * sizeof(uc16))); |
1295 } | 1295 } |
1296 } | 1296 } |
1297 } | 1297 } |
1298 | 1298 |
1299 #undef __ | 1299 #undef __ |
1300 | 1300 |
1301 #endif // V8_NATIVE_REGEXP | 1301 #endif // V8_NATIVE_REGEXP |
1302 | 1302 |
1303 }} // namespace v8::internal | 1303 }} // namespace v8::internal |
OLD | NEW |