| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #if V8_TARGET_ARCH_X87 | 5 #if V8_TARGET_ARCH_X87 |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 __ pop(eax); // Pop return address. | 847 __ pop(eax); // Pop return address. |
| 848 __ push(edi); // Push function. | 848 __ push(edi); // Push function. |
| 849 __ push(edx); // Push parameters pointer. | 849 __ push(edx); // Push parameters pointer. |
| 850 __ push(ecx); // Push parameter count. | 850 __ push(ecx); // Push parameter count. |
| 851 __ push(eax); // Push return address. | 851 __ push(eax); // Push return address. |
| 852 __ TailCallRuntime(Runtime::kNewStrictArguments); | 852 __ TailCallRuntime(Runtime::kNewStrictArguments); |
| 853 } | 853 } |
| 854 | 854 |
| 855 | 855 |
| 856 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | 856 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { |
| 857 // ecx : number of parameters (tagged) |
| 858 // edx : parameters pointer |
| 859 // ebx : rest parameter index (tagged) |
| 860 // edi : language mode (tagged) |
| 857 // esp[0] : return address | 861 // esp[0] : return address |
| 858 // esp[4] : language mode | |
| 859 // esp[8] : index of rest parameter | |
| 860 // esp[12] : number of parameters | |
| 861 // esp[16] : receiver displacement | |
| 862 | 862 |
| 863 // Check if the calling frame is an arguments adaptor frame. | 863 // Check if the calling frame is an arguments adaptor frame. |
| 864 Label runtime; | 864 Label runtime; |
| 865 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 865 __ mov(eax, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 866 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); | 866 __ mov(eax, Operand(eax, StandardFrameConstants::kContextOffset)); |
| 867 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 867 __ cmp(eax, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 868 __ j(not_equal, &runtime); | 868 __ j(not_equal, &runtime); |
| 869 | 869 |
| 870 // Patch the arguments.length and the parameters pointer. | 870 // Patch the arguments.length and the parameters pointer. |
| 871 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 871 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 872 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 872 __ mov(Operand(esp, 3 * kPointerSize), ecx); | |
| 873 __ lea(edx, | 873 __ lea(edx, |
| 874 Operand(edx, ecx, times_2, StandardFrameConstants::kCallerSPOffset)); | 874 Operand(edx, ecx, times_2, StandardFrameConstants::kCallerSPOffset)); |
| 875 __ mov(Operand(esp, 4 * kPointerSize), edx); | |
| 876 | 875 |
| 877 __ bind(&runtime); | 876 __ bind(&runtime); |
| 877 __ pop(eax); // Save return address. |
| 878 __ push(ecx); // Push number of parameters. |
| 879 __ push(edx); // Push parameters pointer. |
| 880 __ push(ebx); // Push rest parameter index. |
| 881 __ push(edi); // Push language mode. |
| 882 __ push(eax); // Push return address. |
| 878 __ TailCallRuntime(Runtime::kNewRestParam); | 883 __ TailCallRuntime(Runtime::kNewRestParam); |
| 879 } | 884 } |
| 880 | 885 |
| 881 | 886 |
| 882 void RegExpExecStub::Generate(MacroAssembler* masm) { | 887 void RegExpExecStub::Generate(MacroAssembler* masm) { |
| 883 // Just jump directly to runtime if native RegExp is not selected at compile | 888 // Just jump directly to runtime if native RegExp is not selected at compile |
| 884 // time or if regexp entry in generated code is turned off runtime switch or | 889 // time or if regexp entry in generated code is turned off runtime switch or |
| 885 // at compilation. | 890 // at compilation. |
| 886 #ifdef V8_INTERPRETED_REGEXP | 891 #ifdef V8_INTERPRETED_REGEXP |
| 887 __ TailCallRuntime(Runtime::kRegExpExec); | 892 __ TailCallRuntime(Runtime::kRegExpExec); |
| (...skipping 4460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5348 Operand(ebp, 7 * kPointerSize), NULL); | 5353 Operand(ebp, 7 * kPointerSize), NULL); |
| 5349 } | 5354 } |
| 5350 | 5355 |
| 5351 | 5356 |
| 5352 #undef __ | 5357 #undef __ |
| 5353 | 5358 |
| 5354 } // namespace internal | 5359 } // namespace internal |
| 5355 } // namespace v8 | 5360 } // namespace v8 |
| 5356 | 5361 |
| 5357 #endif // V8_TARGET_ARCH_X87 | 5362 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |