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 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 // Return and remove the on-stack parameters. | 1134 // Return and remove the on-stack parameters. |
1135 __ bind(&done); | 1135 __ bind(&done); |
1136 __ ret(3 * kPointerSize); | 1136 __ ret(3 * kPointerSize); |
1137 | 1137 |
1138 // Do the runtime call to allocate the arguments object. | 1138 // Do the runtime call to allocate the arguments object. |
1139 __ bind(&runtime); | 1139 __ bind(&runtime); |
1140 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); | 1140 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
1141 } | 1141 } |
1142 | 1142 |
1143 | 1143 |
1144 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | |
1145 // esp[0] : return address | |
1146 // esp[4] : language mode | |
1147 // esp[8] : index of rest parameter | |
1148 // esp[12] : number of parameters | |
1149 // esp[16] : receiver displacement | |
1150 | |
1151 // Check if the calling frame is an arguments adaptor frame. | |
1152 Label runtime; | |
1153 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | |
1154 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); | |
1155 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | |
1156 __ j(not_equal, &runtime); | |
1157 | |
1158 // Patch the arguments.length and the parameters pointer. | |
1159 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | |
1160 __ mov(Operand(esp, 3 * kPointerSize), ecx); | |
1161 __ lea(edx, Operand(edx, ecx, times_2, | |
1162 StandardFrameConstants::kCallerSPOffset)); | |
1163 __ mov(Operand(esp, 4 * kPointerSize), edx); | |
1164 | |
1165 __ bind(&runtime); | |
1166 __ TailCallRuntime(Runtime::kNewRestParam, 4, 1); | |
1167 } | |
1168 | |
1169 | |
1170 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1144 void RegExpExecStub::Generate(MacroAssembler* masm) { |
1171 // Just jump directly to runtime if native RegExp is not selected at compile | 1145 // Just jump directly to runtime if native RegExp is not selected at compile |
1172 // time or if regexp entry in generated code is turned off runtime switch or | 1146 // time or if regexp entry in generated code is turned off runtime switch or |
1173 // at compilation. | 1147 // at compilation. |
1174 #ifdef V8_INTERPRETED_REGEXP | 1148 #ifdef V8_INTERPRETED_REGEXP |
1175 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); | 1149 __ TailCallRuntime(Runtime::kRegExpExec, 4, 1); |
1176 #else // V8_INTERPRETED_REGEXP | 1150 #else // V8_INTERPRETED_REGEXP |
1177 | 1151 |
1178 // Stack frame on entry. | 1152 // Stack frame on entry. |
1179 // esp[0]: return address | 1153 // esp[0]: return address |
(...skipping 4478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5658 Operand(ebp, 7 * kPointerSize), NULL); | 5632 Operand(ebp, 7 * kPointerSize), NULL); |
5659 } | 5633 } |
5660 | 5634 |
5661 | 5635 |
5662 #undef __ | 5636 #undef __ |
5663 | 5637 |
5664 } // namespace internal | 5638 } // namespace internal |
5665 } // namespace v8 | 5639 } // namespace v8 |
5666 | 5640 |
5667 #endif // V8_TARGET_ARCH_IA32 | 5641 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |