| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 251 |
| 252 // Possibly allocate RestParameters | 252 // Possibly allocate RestParameters |
| 253 int rest_index; | 253 int rest_index; |
| 254 Variable* rest_param = scope()->rest_parameter(&rest_index); | 254 Variable* rest_param = scope()->rest_parameter(&rest_index); |
| 255 if (rest_param) { | 255 if (rest_param) { |
| 256 Comment cmnt(masm_, "[ Allocate rest parameter array"); | 256 Comment cmnt(masm_, "[ Allocate rest parameter array"); |
| 257 | 257 |
| 258 int num_parameters = info->scope()->num_parameters(); | 258 int num_parameters = info->scope()->num_parameters(); |
| 259 int offset = num_parameters * kPointerSize; | 259 int offset = num_parameters * kPointerSize; |
| 260 | 260 |
| 261 __ leap(rdx, | 261 __ Move(RestParamAccessDescriptor::parameter_count(), |
| 262 Smi::FromInt(num_parameters)); |
| 263 __ leap(RestParamAccessDescriptor::parameter_pointer(), |
| 262 Operand(rbp, StandardFrameConstants::kCallerSPOffset + offset)); | 264 Operand(rbp, StandardFrameConstants::kCallerSPOffset + offset)); |
| 263 __ Push(rdx); | 265 __ Move(RestParamAccessDescriptor::rest_parameter_index(), |
| 264 __ Push(Smi::FromInt(num_parameters)); | 266 Smi::FromInt(rest_index)); |
| 265 __ Push(Smi::FromInt(rest_index)); | 267 __ Move(RestParamAccessDescriptor::language_mode(), |
| 266 __ Push(Smi::FromInt(language_mode())); | 268 Smi::FromInt(language_mode())); |
| 267 function_in_register = false; | 269 function_in_register = false; |
| 268 | 270 |
| 269 RestParamAccessStub stub(isolate()); | 271 RestParamAccessStub stub(isolate()); |
| 270 __ CallStub(&stub); | 272 __ CallStub(&stub); |
| 271 | 273 |
| 272 SetVar(rest_param, rax, rbx, rdx); | 274 SetVar(rest_param, rax, rbx, rdx); |
| 273 } | 275 } |
| 274 | 276 |
| 275 // Possibly allocate an arguments object. | 277 // Possibly allocate an arguments object. |
| 276 Variable* arguments = scope()->arguments(); | 278 Variable* arguments = scope()->arguments(); |
| (...skipping 4515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4792 Assembler::target_address_at(call_target_address, | 4794 Assembler::target_address_at(call_target_address, |
| 4793 unoptimized_code)); | 4795 unoptimized_code)); |
| 4794 return OSR_AFTER_STACK_CHECK; | 4796 return OSR_AFTER_STACK_CHECK; |
| 4795 } | 4797 } |
| 4796 | 4798 |
| 4797 | 4799 |
| 4798 } // namespace internal | 4800 } // namespace internal |
| 4799 } // namespace v8 | 4801 } // namespace v8 |
| 4800 | 4802 |
| 4801 #endif // V8_TARGET_ARCH_X64 | 4803 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |