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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1156 __ ret(3 * kPointerSize); | 1156 __ ret(3 * kPointerSize); |
1157 | 1157 |
1158 // Do the runtime call to allocate the arguments object. | 1158 // Do the runtime call to allocate the arguments object. |
1159 __ bind(&runtime); | 1159 __ bind(&runtime); |
1160 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); | 1160 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
1161 } | 1161 } |
1162 | 1162 |
1163 | 1163 |
1164 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | 1164 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { |
1165 // esp[0] : return address | 1165 // esp[0] : return address |
1166 // esp[4] : index of rest parameter | 1166 // esp[4] : language mode |
1167 // esp[8] : number of parameters | 1167 // esp[8] : index of rest parameter |
1168 // esp[12] : receiver displacement | 1168 // esp[12] : number of parameters |
| 1169 // esp[16] : receiver displacement |
1169 | 1170 |
1170 // Check if the calling frame is an arguments adaptor frame. | 1171 // Check if the calling frame is an arguments adaptor frame. |
1171 Label runtime; | 1172 Label runtime; |
1172 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 1173 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
1173 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); | 1174 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); |
1174 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1175 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
1175 __ j(not_equal, &runtime); | 1176 __ j(not_equal, &runtime); |
1176 | 1177 |
1177 // Patch the arguments.length and the parameters pointer. | 1178 // Patch the arguments.length and the parameters pointer. |
1178 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 1179 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
1179 __ mov(Operand(esp, 2 * kPointerSize), ecx); | 1180 __ mov(Operand(esp, 3 * kPointerSize), ecx); |
1180 __ lea(edx, Operand(edx, ecx, times_2, | 1181 __ lea(edx, Operand(edx, ecx, times_2, |
1181 StandardFrameConstants::kCallerSPOffset)); | 1182 StandardFrameConstants::kCallerSPOffset)); |
1182 __ mov(Operand(esp, 3 * kPointerSize), edx); | 1183 __ mov(Operand(esp, 4 * kPointerSize), edx); |
1183 | 1184 |
1184 __ bind(&runtime); | 1185 __ bind(&runtime); |
1185 __ TailCallRuntime(Runtime::kNewRestParam, 3, 1); | 1186 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1); |
1186 } | 1187 } |
1187 | 1188 |
1188 | 1189 |
1189 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1190 void RegExpExecStub::Generate(MacroAssembler* masm) { |
1190 // Just jump directly to runtime if native RegExp is not selected at compile | 1191 // Just jump directly to runtime if native RegExp is not selected at compile |
1191 // time or if regexp entry in generated code is turned off runtime switch or | 1192 // time or if regexp entry in generated code is turned off runtime switch or |
1192 // at compilation. | 1193 // at compilation. |
1193 #ifdef V8_INTERPRETED_REGEXP | 1194 #ifdef V8_INTERPRETED_REGEXP |
1194 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); | 1195 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
1195 #else // V8_INTERPRETED_REGEXP | 1196 #else // V8_INTERPRETED_REGEXP |
(...skipping 4227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5423 ApiParameterOperand(2), kStackSpace, nullptr, | 5424 ApiParameterOperand(2), kStackSpace, nullptr, |
5424 Operand(ebp, 7 * kPointerSize), NULL); | 5425 Operand(ebp, 7 * kPointerSize), NULL); |
5425 } | 5426 } |
5426 | 5427 |
5427 | 5428 |
5428 #undef __ | 5429 #undef __ |
5429 | 5430 |
5430 } } // namespace v8::internal | 5431 } } // namespace v8::internal |
5431 | 5432 |
5432 #endif // V8_TARGET_ARCH_IA32 | 5433 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |