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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_X87 | 7 #if V8_TARGET_ARCH_X87 |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
837 __ ret(3 * kPointerSize); | 837 __ ret(3 * kPointerSize); |
838 | 838 |
839 // Do the runtime call to allocate the arguments object. | 839 // Do the runtime call to allocate the arguments object. |
840 __ bind(&runtime); | 840 __ bind(&runtime); |
841 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); | 841 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
842 } | 842 } |
843 | 843 |
844 | 844 |
845 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | 845 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { |
846 // esp[0] : return address | 846 // esp[0] : return address |
847 // esp[4] : index of rest parameter | 847 // esp[4] : language mode |
848 // esp[8] : number of parameters | 848 // esp[8] : index of rest parameter |
849 // esp[12] : receiver displacement | 849 // esp[12] : number of parameters |
| 850 // esp[16] : receiver displacement |
850 | 851 |
851 // Check if the calling frame is an arguments adaptor frame. | 852 // Check if the calling frame is an arguments adaptor frame. |
852 Label runtime; | 853 Label runtime; |
853 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 854 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
854 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); | 855 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); |
855 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 856 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
856 __ j(not_equal, &runtime); | 857 __ j(not_equal, &runtime); |
857 | 858 |
858 // Patch the arguments.length and the parameters pointer. | 859 // Patch the arguments.length and the parameters pointer. |
859 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 860 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
860 __ mov(Operand(esp, 2 * kPointerSize), ecx); | 861 __ mov(Operand(esp, 3 * kPointerSize), ecx); |
861 __ lea(edx, Operand(edx, ecx, times_2, | 862 __ lea(edx, Operand(edx, ecx, times_2, |
862 StandardFrameConstants::kCallerSPOffset)); | 863 StandardFrameConstants::kCallerSPOffset)); |
863 __ mov(Operand(esp, 3 * kPointerSize), edx); | 864 __ mov(Operand(esp, 4 * kPointerSize), edx); |
864 | 865 |
865 __ bind(&runtime); | 866 __ bind(&runtime); |
866 __ TailCallRuntime(Runtime::kNewRestParam, 3, 1); | 867 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1); |
867 } | 868 } |
868 | 869 |
869 | 870 |
870 void RegExpExecStub::Generate(MacroAssembler* masm) { | 871 void RegExpExecStub::Generate(MacroAssembler* masm) { |
871 // Just jump directly to runtime if native RegExp is not selected at compile | 872 // Just jump directly to runtime if native RegExp is not selected at compile |
872 // time or if regexp entry in generated code is turned off runtime switch or | 873 // time or if regexp entry in generated code is turned off runtime switch or |
873 // at compilation. | 874 // at compilation. |
874 #ifdef V8_INTERPRETED_REGEXP | 875 #ifdef V8_INTERPRETED_REGEXP |
875 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); | 876 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
876 #else // V8_INTERPRETED_REGEXP | 877 #else // V8_INTERPRETED_REGEXP |
(...skipping 4258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5135 ApiParameterOperand(2), kStackSpace, nullptr, | 5136 ApiParameterOperand(2), kStackSpace, nullptr, |
5136 Operand(ebp, 7 * kPointerSize), NULL); | 5137 Operand(ebp, 7 * kPointerSize), NULL); |
5137 } | 5138 } |
5138 | 5139 |
5139 | 5140 |
5140 #undef __ | 5141 #undef __ |
5141 | 5142 |
5142 } } // namespace v8::internal | 5143 } } // namespace v8::internal |
5143 | 5144 |
5144 #endif // V8_TARGET_ARCH_X87 | 5145 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |