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 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 __ bind(&runtime); | 1145 __ bind(&runtime); |
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, 3, 1); | 1151 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
1152 } | 1152 } |
1153 | 1153 |
1154 | 1154 |
| 1155 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { |
| 1156 // 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 |
| 1162 // Check if the calling frame is an arguments adaptor frame. |
| 1163 Label runtime; |
| 1164 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); |
| 1165 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); |
| 1166 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); |
| 1167 __ j(not_equal, &runtime); |
| 1168 |
| 1169 // Patch the arguments.length and the parameters pointer. |
| 1170 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); |
| 1171 __ mov(Operand(esp, 3 * kPointerSize), ecx); |
| 1172 __ lea(edx, |
| 1173 Operand(edx, ecx, times_2, StandardFrameConstants::kCallerSPOffset)); |
| 1174 __ mov(Operand(esp, 4 * kPointerSize), edx); |
| 1175 |
| 1176 __ bind(&runtime); |
| 1177 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1); |
| 1178 } |
| 1179 |
| 1180 |
1155 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1181 void RegExpExecStub::Generate(MacroAssembler* masm) { |
1156 // Just jump directly to runtime if native RegExp is not selected at compile | 1182 // Just jump directly to runtime if native RegExp is not selected at compile |
1157 // time or if regexp entry in generated code is turned off runtime switch or | 1183 // time or if regexp entry in generated code is turned off runtime switch or |
1158 // at compilation. | 1184 // at compilation. |
1159 #ifdef V8_INTERPRETED_REGEXP | 1185 #ifdef V8_INTERPRETED_REGEXP |
1160 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); | 1186 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
1161 #else // V8_INTERPRETED_REGEXP | 1187 #else // V8_INTERPRETED_REGEXP |
1162 | 1188 |
1163 // Stack frame on entry. | 1189 // Stack frame on entry. |
1164 // esp[0]: return address | 1190 // esp[0]: return address |
(...skipping 4487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5652 Operand(ebp, 7 * kPointerSize), NULL); | 5678 Operand(ebp, 7 * kPointerSize), NULL); |
5653 } | 5679 } |
5654 | 5680 |
5655 | 5681 |
5656 #undef __ | 5682 #undef __ |
5657 | 5683 |
5658 } // namespace internal | 5684 } // namespace internal |
5659 } // namespace v8 | 5685 } // namespace v8 |
5660 | 5686 |
5661 #endif // V8_TARGET_ARCH_IA32 | 5687 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |