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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 __ jmp(&done); | 264 __ jmp(&done); |
265 | 265 |
266 // Non-construct frame | 266 // Non-construct frame |
267 __ bind(&non_construct_frame); | 267 __ bind(&non_construct_frame); |
268 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); | 268 __ mov(eax, Immediate(isolate()->factory()->undefined_value())); |
269 | 269 |
270 __ bind(&done); | 270 __ bind(&done); |
271 SetVar(new_target_var, eax, ebx, edx); | 271 SetVar(new_target_var, eax, ebx, edx); |
272 } | 272 } |
273 | 273 |
274 | |
275 // Possibly allocate RestParameters | |
276 int rest_index; | |
277 Variable* rest_param = scope()->rest_parameter(&rest_index); | |
278 if (rest_param) { | |
279 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
280 | |
281 int num_parameters = info->scope()->num_parameters(); | |
282 int offset = num_parameters * kPointerSize; | |
283 | |
284 __ lea(edx, | |
285 Operand(ebp, StandardFrameConstants::kCallerSPOffset + offset)); | |
286 __ push(edx); | |
287 __ push(Immediate(Smi::FromInt(num_parameters))); | |
288 __ push(Immediate(Smi::FromInt(rest_index))); | |
289 __ push(Immediate(Smi::FromInt(language_mode()))); | |
290 | |
291 RestParamAccessStub stub(isolate()); | |
292 __ CallStub(&stub); | |
293 | |
294 SetVar(rest_param, eax, ebx, edx); | |
295 } | |
296 | |
297 Variable* arguments = scope()->arguments(); | 274 Variable* arguments = scope()->arguments(); |
298 if (arguments != NULL) { | 275 if (arguments != NULL) { |
299 // Function uses arguments object. | 276 // Function uses arguments object. |
300 Comment cmnt(masm_, "[ Allocate arguments object"); | 277 Comment cmnt(masm_, "[ Allocate arguments object"); |
301 if (function_in_register) { | 278 if (function_in_register) { |
302 __ push(edi); | 279 __ push(edi); |
303 } else { | 280 } else { |
304 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); | 281 __ push(Operand(ebp, JavaScriptFrameConstants::kFunctionOffset)); |
305 } | 282 } |
306 // Receiver is just before the parameters on the caller's stack. | 283 // Receiver is just before the parameters on the caller's stack. |
(...skipping 4911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5218 Assembler::target_address_at(call_target_address, | 5195 Assembler::target_address_at(call_target_address, |
5219 unoptimized_code)); | 5196 unoptimized_code)); |
5220 return OSR_AFTER_STACK_CHECK; | 5197 return OSR_AFTER_STACK_CHECK; |
5221 } | 5198 } |
5222 | 5199 |
5223 | 5200 |
5224 } // namespace internal | 5201 } // namespace internal |
5225 } // namespace v8 | 5202 } // namespace v8 |
5226 | 5203 |
5227 #endif // V8_TARGET_ARCH_X87 | 5204 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |