| 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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
| 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 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1146 __ pop(eax); // Pop return address. | 1146 __ pop(eax); // Pop return address. |
| 1147 __ push(edi); // Push function. | 1147 __ push(edi); // Push function. |
| 1148 __ push(edx); // Push parameters pointer. | 1148 __ push(edx); // Push parameters pointer. |
| 1149 __ push(ecx); // Push parameter count. | 1149 __ push(ecx); // Push parameter count. |
| 1150 __ push(eax); // Push return address. | 1150 __ push(eax); // Push return address. |
| 1151 __ TailCallRuntime(Runtime::kNewStrictArguments); | 1151 __ TailCallRuntime(Runtime::kNewStrictArguments); |
| 1152 } | 1152 } |
| 1153 | 1153 |
| 1154 | 1154 |
| 1155 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | 1155 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { |
| 1156 // ecx : number of parameters (tagged) |
| 1157 // edx : parameters pointer |
| 1158 // ebx : rest parameter index (tagged) |
| 1159 // edi : language mode (tagged) |
| 1156 // esp[0] : return address | 1160 // esp[0] : return address |
| 1157 // esp[4] : language mode | |
| 1158 // esp[8] : index of rest parameter | |
| 1159 // esp[12] : number of parameters | |
| 1160 // esp[16] : receiver displacement | |
| 1161 | 1161 |
| 1162 // Check if the calling frame is an arguments adaptor frame. | 1162 // Check if the calling frame is an arguments adaptor frame. |
| 1163 Label runtime; | 1163 Label runtime; |
| 1164 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | 1164 __ mov(eax, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 1165 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); | 1165 __ mov(eax, Operand(eax, StandardFrameConstants::kContextOffset)); |
| 1166 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | 1166 __ cmp(eax, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 1167 __ j(not_equal, &runtime); | 1167 __ j(not_equal, &runtime); |
| 1168 | 1168 |
| 1169 // Patch the arguments.length and the parameters pointer. | 1169 // Patch the arguments.length and the parameters pointer. |
| 1170 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 1170 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | 1171 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 1171 __ mov(Operand(esp, 3 * kPointerSize), ecx); | |
| 1172 __ lea(edx, | 1172 __ lea(edx, |
| 1173 Operand(edx, ecx, times_2, StandardFrameConstants::kCallerSPOffset)); | 1173 Operand(edx, ecx, times_2, StandardFrameConstants::kCallerSPOffset)); |
| 1174 __ mov(Operand(esp, 4 * kPointerSize), edx); | |
| 1175 | 1174 |
| 1176 __ bind(&runtime); | 1175 __ bind(&runtime); |
| 1176 __ pop(eax); // Save return address. |
| 1177 __ push(ecx); // Push number of parameters. |
| 1178 __ push(edx); // Push parameters pointer. |
| 1179 __ push(ebx); // Push rest parameter index. |
| 1180 __ push(edi); // Push language mode. |
| 1181 __ push(eax); // Push return address. |
| 1177 __ TailCallRuntime(Runtime::kNewRestParam); | 1182 __ TailCallRuntime(Runtime::kNewRestParam); |
| 1178 } | 1183 } |
| 1179 | 1184 |
| 1180 | 1185 |
| 1181 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1186 void RegExpExecStub::Generate(MacroAssembler* masm) { |
| 1182 // Just jump directly to runtime if native RegExp is not selected at compile | 1187 // Just jump directly to runtime if native RegExp is not selected at compile |
| 1183 // time or if regexp entry in generated code is turned off runtime switch or | 1188 // time or if regexp entry in generated code is turned off runtime switch or |
| 1184 // at compilation. | 1189 // at compilation. |
| 1185 #ifdef V8_INTERPRETED_REGEXP | 1190 #ifdef V8_INTERPRETED_REGEXP |
| 1186 __ TailCallRuntime(Runtime::kRegExpExec); | 1191 __ TailCallRuntime(Runtime::kRegExpExec); |
| (...skipping 4479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5666 Operand(ebp, 7 * kPointerSize), NULL); | 5671 Operand(ebp, 7 * kPointerSize), NULL); |
| 5667 } | 5672 } |
| 5668 | 5673 |
| 5669 | 5674 |
| 5670 #undef __ | 5675 #undef __ |
| 5671 | 5676 |
| 5672 } // namespace internal | 5677 } // namespace internal |
| 5673 } // namespace v8 | 5678 } // namespace v8 |
| 5674 | 5679 |
| 5675 #endif // V8_TARGET_ARCH_IA32 | 5680 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |