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 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1141 // Return and remove the on-stack parameters. | 1141 // Return and remove the on-stack parameters. |
1142 __ bind(&done); | 1142 __ bind(&done); |
1143 __ ret(3 * kPointerSize); | 1143 __ ret(3 * kPointerSize); |
1144 | 1144 |
1145 // Do the runtime call to allocate the arguments object. | 1145 // Do the runtime call to allocate the arguments object. |
1146 __ bind(&runtime); | 1146 __ bind(&runtime); |
1147 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); | 1147 __ TailCallRuntime(Runtime::kNewStrictArguments, 3, 1); |
1148 } | 1148 } |
1149 | 1149 |
1150 | 1150 |
1151 void RestParamAccessStub::GenerateNew(MacroAssembler* masm) { | |
1152 // esp[0] : return address | |
1153 // esp[4] : index of rest parameter | |
1154 // esp[8] : number of parameters | |
1155 // esp[12] : receiver displacement | |
1156 // | |
1157 | |
1158 // Check if the calling frame is an arguments adaptor frame. | |
arv (Not doing code reviews)
2015/02/13 16:56:44
Out of scope for this CL but I think this code is
| |
1159 Label runtime; | |
1160 __ mov(edx, Operand(ebp, StandardFrameConstants::kCallerFPOffset)); | |
1161 __ mov(ecx, Operand(edx, StandardFrameConstants::kContextOffset)); | |
1162 __ cmp(ecx, Immediate(Smi::FromInt(StackFrame::ARGUMENTS_ADAPTOR))); | |
1163 __ j(not_equal, &runtime); | |
1164 | |
1165 // Patch the arguments.length and the parameters pointer. | |
1166 __ mov(ecx, Operand(edx, ArgumentsAdaptorFrameConstants::kLengthOffset)); | |
1167 __ mov(Operand(esp, 2 * kPointerSize), ecx); | |
1168 __ lea(edx, Operand(edx, ecx, times_2, | |
1169 StandardFrameConstants::kCallerSPOffset)); | |
1170 __ mov(Operand(esp, 3 * kPointerSize), edx); | |
1171 | |
1172 __ bind(&runtime); | |
1173 __ TailCallRuntime(Runtime::kNewRestParam, 3, 1); | |
1174 } | |
1175 | |
1176 | |
1151 void RegExpExecStub::Generate(MacroAssembler* masm) { | 1177 void RegExpExecStub::Generate(MacroAssembler* masm) { |
1152 // Just jump directly to runtime if native RegExp is not selected at compile | 1178 // Just jump directly to runtime if native RegExp is not selected at compile |
1153 // time or if regexp entry in generated code is turned off runtime switch or | 1179 // time or if regexp entry in generated code is turned off runtime switch or |
1154 // at compilation. | 1180 // at compilation. |
1155 #ifdef V8_INTERPRETED_REGEXP | 1181 #ifdef V8_INTERPRETED_REGEXP |
1156 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1); | 1182 __ TailCallRuntime(Runtime::kRegExpExecRT, 4, 1); |
1157 #else // V8_INTERPRETED_REGEXP | 1183 #else // V8_INTERPRETED_REGEXP |
1158 | 1184 |
1159 // Stack frame on entry. | 1185 // Stack frame on entry. |
1160 // esp[0]: return address | 1186 // esp[0]: return address |
(...skipping 3937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5098 ApiParameterOperand(2), kStackSpace, nullptr, | 5124 ApiParameterOperand(2), kStackSpace, nullptr, |
5099 Operand(ebp, 7 * kPointerSize), NULL); | 5125 Operand(ebp, 7 * kPointerSize), NULL); |
5100 } | 5126 } |
5101 | 5127 |
5102 | 5128 |
5103 #undef __ | 5129 #undef __ |
5104 | 5130 |
5105 } } // namespace v8::internal | 5131 } } // namespace v8::internal |
5106 | 5132 |
5107 #endif // V8_TARGET_ARCH_IA32 | 5133 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |