| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 if (new_target_var != nullptr) { | 261 if (new_target_var != nullptr) { |
| 262 Comment cmnt(masm_, "[ new.target"); | 262 Comment cmnt(masm_, "[ new.target"); |
| 263 SetVar(new_target_var, x3, x0, x2); | 263 SetVar(new_target_var, x3, x0, x2); |
| 264 } | 264 } |
| 265 | 265 |
| 266 // Possibly allocate RestParameters | 266 // Possibly allocate RestParameters |
| 267 int rest_index; | 267 int rest_index; |
| 268 Variable* rest_param = scope()->rest_parameter(&rest_index); | 268 Variable* rest_param = scope()->rest_parameter(&rest_index); |
| 269 if (rest_param) { | 269 if (rest_param) { |
| 270 Comment cmnt(masm_, "[ Allocate rest parameter array"); | 270 Comment cmnt(masm_, "[ Allocate rest parameter array"); |
| 271 | 271 if (!function_in_register_x1) { |
| 272 int num_parameters = info->scope()->num_parameters(); | 272 __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 273 int offset = num_parameters * kPointerSize; | 273 } |
| 274 __ Mov(RestParamAccessDescriptor::parameter_count(), | 274 FastNewRestParameterStub stub(isolate()); |
| 275 Smi::FromInt(num_parameters)); | 275 __ CallStub(&stub); |
| 276 __ Add(RestParamAccessDescriptor::parameter_pointer(), fp, | |
| 277 StandardFrameConstants::kCallerSPOffset + offset); | |
| 278 __ Mov(RestParamAccessDescriptor::rest_parameter_index(), | |
| 279 Smi::FromInt(rest_index)); | |
| 280 | |
| 281 function_in_register_x1 = false; | 276 function_in_register_x1 = false; |
| 282 | |
| 283 RestParamAccessStub stub(isolate()); | |
| 284 __ CallStub(&stub); | |
| 285 | |
| 286 SetVar(rest_param, x0, x1, x2); | 277 SetVar(rest_param, x0, x1, x2); |
| 287 } | 278 } |
| 288 | 279 |
| 289 Variable* arguments = scope()->arguments(); | 280 Variable* arguments = scope()->arguments(); |
| 290 if (arguments != NULL) { | 281 if (arguments != NULL) { |
| 291 // Function uses arguments object. | 282 // Function uses arguments object. |
| 292 Comment cmnt(masm_, "[ Allocate arguments object"); | 283 Comment cmnt(masm_, "[ Allocate arguments object"); |
| 293 DCHECK(x1.is(ArgumentsAccessNewDescriptor::function())); | 284 DCHECK(x1.is(ArgumentsAccessNewDescriptor::function())); |
| 294 if (!function_in_register_x1) { | 285 if (!function_in_register_x1) { |
| 295 // Load this again, if it's used by the local context below. | 286 // Load this again, if it's used by the local context below. |
| (...skipping 4443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4739 } | 4730 } |
| 4740 | 4731 |
| 4741 return INTERRUPT; | 4732 return INTERRUPT; |
| 4742 } | 4733 } |
| 4743 | 4734 |
| 4744 | 4735 |
| 4745 } // namespace internal | 4736 } // namespace internal |
| 4746 } // namespace v8 | 4737 } // namespace v8 |
| 4747 | 4738 |
| 4748 #endif // V8_TARGET_ARCH_ARM64 | 4739 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |