| 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_X64 | 5 #if V8_TARGET_ARCH_X64 |
| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 __ jmp(&done); | 263 __ jmp(&done); |
| 264 | 264 |
| 265 // Non-construct frame | 265 // Non-construct frame |
| 266 __ bind(&non_construct_frame); | 266 __ bind(&non_construct_frame); |
| 267 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); | 267 __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
| 268 | 268 |
| 269 __ bind(&done); | 269 __ bind(&done); |
| 270 SetVar(new_target_var, rax, rbx, rdx); | 270 SetVar(new_target_var, rax, rbx, rdx); |
| 271 } | 271 } |
| 272 | 272 |
| 273 // Possibly allocate RestParameters | |
| 274 int rest_index; | |
| 275 Variable* rest_param = scope()->rest_parameter(&rest_index); | |
| 276 if (rest_param) { | |
| 277 Comment cmnt(masm_, "[ Allocate rest parameter array"); | |
| 278 | |
| 279 int num_parameters = info->scope()->num_parameters(); | |
| 280 int offset = num_parameters * kPointerSize; | |
| 281 | |
| 282 __ leap(rdx, | |
| 283 Operand(rbp, StandardFrameConstants::kCallerSPOffset + offset)); | |
| 284 __ Push(rdx); | |
| 285 __ Push(Smi::FromInt(num_parameters)); | |
| 286 __ Push(Smi::FromInt(rest_index)); | |
| 287 __ Push(Smi::FromInt(language_mode())); | |
| 288 | |
| 289 RestParamAccessStub stub(isolate()); | |
| 290 __ CallStub(&stub); | |
| 291 | |
| 292 SetVar(rest_param, rax, rbx, rdx); | |
| 293 } | |
| 294 | |
| 295 // Possibly allocate an arguments object. | 273 // Possibly allocate an arguments object. |
| 296 Variable* arguments = scope()->arguments(); | 274 Variable* arguments = scope()->arguments(); |
| 297 if (arguments != NULL) { | 275 if (arguments != NULL) { |
| 298 // Arguments object must be allocated after the context object, in | 276 // Arguments object must be allocated after the context object, in |
| 299 // case the "arguments" or ".arguments" variables are in the context. | 277 // case the "arguments" or ".arguments" variables are in the context. |
| 300 Comment cmnt(masm_, "[ Allocate arguments object"); | 278 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 301 if (function_in_register) { | 279 if (function_in_register) { |
| 302 __ Push(rdi); | 280 __ Push(rdi); |
| 303 } else { | 281 } else { |
| 304 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); | 282 __ Push(Operand(rbp, JavaScriptFrameConstants::kFunctionOffset)); |
| (...skipping 4953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5258 Assembler::target_address_at(call_target_address, | 5236 Assembler::target_address_at(call_target_address, |
| 5259 unoptimized_code)); | 5237 unoptimized_code)); |
| 5260 return OSR_AFTER_STACK_CHECK; | 5238 return OSR_AFTER_STACK_CHECK; |
| 5261 } | 5239 } |
| 5262 | 5240 |
| 5263 | 5241 |
| 5264 } // namespace internal | 5242 } // namespace internal |
| 5265 } // namespace v8 | 5243 } // namespace v8 |
| 5266 | 5244 |
| 5267 #endif // V8_TARGET_ARCH_X64 | 5245 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |