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_X64 | 7 #if V8_TARGET_ARCH_X64 |
8 | 8 |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 __ jmp(&done); | 266 __ jmp(&done); |
267 | 267 |
268 // Non-construct frame | 268 // Non-construct frame |
269 __ bind(&non_construct_frame); | 269 __ bind(&non_construct_frame); |
270 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 270 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
271 | 271 |
272 __ bind(&done); | 272 __ bind(&done); |
273 SetVar(new_target_var, rax, rbx, rdx); | 273 SetVar(new_target_var, rax, rbx, rdx); |
274 } | 274 } |
275 | 275 |
276 // Possibly allocate RestParameters | |
277 int rest_index; | |
278 Variable* rest_param = scope()->rest_parameter(&rest_index); | |
279 if (rest_param) { | |
280 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
281 | |
282 int num_parameters = info->scope()->num_parameters(); | |
283 int offset = num_parameters * kPointerSize; | |
284 | |
285 __ leap(rdx, | |
286 Operand(rbp, StandardFrameConstants::kCallerSPOffset + offset)); | |
287 __ Push(rdx); | |
288 __ Push(Smi::FromInt(num_parameters)); | |
289 __ Push(Smi::FromInt(rest_index)); | |
290 __ Push(Smi::FromInt(language_mode())); | |
291 | |
292 RestParamAccessStub stub(isolate()); | |
293 __ CallStub(&stub); | |
294 | |
295 SetVar(rest_param, rax, rbx, rdx); | |
296 } | |
297 | |
298 // Possibly allocate an arguments object. | 276 // Possibly allocate an arguments object. |
299 Variable* arguments = scope()->arguments(); | 277 Variable* arguments = scope()->arguments(); |
300 if (arguments != NULL) { | 278 if (arguments != NULL) { |
301 // Arguments object must be allocated after the context object, in | 279 // Arguments object must be allocated after the context object, in |
302 // case the "arguments" or ".arguments" variables are in the context. | 280 // case the "arguments" or ".arguments" variables are in the context. |
303 Comment cmnt(masm_, "[ Allocate arguments object"); | 281 Comment cmnt(masm_, "[ Allocate arguments object"); |
304 if (function_in_register) { | 282 if (function_in_register) { |
305 __ Push(rdi); | 283 __ Push(rdi); |
306 } else { | 284 } else { |
307 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 285 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
(...skipping 5166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5474 Assembler::target_address_at(call_target_address, | 5452 Assembler::target_address_at(call_target_address, |
5475 unoptimized_code)); | 5453 unoptimized_code)); |
5476 return OSR_AFTER_STACK_CHECK; | 5454 return OSR_AFTER_STACK_CHECK; |
5477 } | 5455 } |
5478 | 5456 |
5479 | 5457 |
5480 } // namespace internal | 5458 } // namespace internal |
5481 } // namespace v8 | 5459 } // namespace v8 |
5482 | 5460 |
5483 #endif // V8_TARGET_ARCH_X64 | 5461 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |