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 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1152 // Return and remove the on-stack parameters. | 1152 // Return and remove the on-stack parameters. |
1153 __ bind(&done); | 1153 __ bind(&done); |
1154 __ ret(3 * kPointerSize); | 1154 __ ret(3 * kPointerSize); |
1155 | 1155 |
1156 // Do the runtime call to allocate the arguments object. | 1156 // Do the runtime call to allocate the arguments object. |
1157 __ bind(&runtime); | 1157 __ bind(&runtime); |
1158 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); | 1158 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
1159 } | 1159 } |
1160 | 1160 |
1161 | 1161 |
| 1162 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { |
| 1163 // esp[0] : return address |
| 1164 // esp[4] : index of rest parameter |
| 1165 // esp[8] : number of parameters |
| 1166 // esp[12] : receiver displacement |
| 1167 |
| 1168 // Check if the calling frame is an arguments adaptor frame. |
| 1169 Label runtime; |
| 1170 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 1171 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); |
| 1172 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 1173 __ j(not_equal, &runtime); |
| 1174 |
| 1175 // Patch the arguments.length and the parameters pointer. |
| 1176 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 1177 __ mov(Operand(esp, 2 * kPointerSize), ecx); |
| 1178 __ lea(edx, Operand(edx, ecx, times_2, |
| 1179 StandardFrameConstants::kCallerSPOffset)); |
| 1180 __ mov(Operand(esp, 3 * kPointerSize), edx); |
| 1181 |
| 1182 __ bind(&runtime); |
| 1183 __ TailCallRuntime(Runtime::kNewRestParam, 3, 1); |
| 1184 } |
| 1185 |
| 1186 |
1162 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1187 void RegExpExecStub::Generate(MacroAssembler* masm) { |
1163 // Just jump directly to runtime if native RegExp is not selected at compile | 1188 // Just jump directly to runtime if native RegExp is not selected at compile |
1164 // time or if regexp entry in generated code is turned off runtime switch or | 1189 // time or if regexp entry in generated code is turned off runtime switch or |
1165 // at compilation. | 1190 // at compilation. |
1166 #ifdef V8_INTERPRETED_REGEXP | 1191 #ifdef V8_INTERPRETED_REGEXP |
1167 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1); | 1192 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1); |
1168 #else // V8_INTERPRETED_REGEXP | 1193 #else // V8_INTERPRETED_REGEXP |
1169 | 1194 |
1170 // Stack frame on entry. | 1195 // Stack frame on entry. |
1171 // esp[0]: return address | 1196 // esp[0]: return address |
(...skipping 3941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5113 ApiParameterOperand(2), kStackSpace, nullptr, | 5138 ApiParameterOperand(2), kStackSpace, nullptr, |
5114 Operand(ebp, 7 * kPointerSize), NULL); | 5139 Operand(ebp, 7 * kPointerSize), NULL); |
5115 } | 5140 } |
5116 | 5141 |
5117 | 5142 |
5118 #undef __ | 5143 #undef __ |
5119 | 5144 |
5120 } } // namespace v8::internal | 5145 } } // namespace v8::internal |
5121 | 5146 |
5122 #endif // V8_TARGET_ARCH_IA32 | 5147 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |