Index: src/full-codegen/arm64/full-codegen-arm64.cc |
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc |
index 5b6fd81b9451a18c447824ca1ac4d9b11c163b2b..d3a159712f1e88151bcad5e1f4e19db6b8554cad 100644 |
--- a/src/full-codegen/arm64/full-codegen-arm64.cc |
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc |
@@ -289,31 +289,26 @@ void FullCodeGenerator::Generate() { |
if (arguments != NULL) { |
// Function uses arguments object. |
Comment cmnt(masm_, "[ Allocate arguments object"); |
+ DCHECK(x1.is(ArgumentsAccessNewDescriptor::function())); |
if (!function_in_register_x1) { |
// Load this again, if it's used by the local context below. |
- __ Ldr(x3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
- } else { |
- __ Mov(x3, x1); |
+ __ Ldr(x1, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
} |
// Receiver is just before the parameters on the caller's stack. |
int num_parameters = info->scope()->num_parameters(); |
int offset = num_parameters * kPointerSize; |
- __ Add(x2, fp, StandardFrameConstants::kCallerSPOffset + offset); |
- __ Mov(x1, Smi::FromInt(num_parameters)); |
- __ Push(x3, x2, x1); |
+ __ Mov(ArgumentsAccessNewDescriptor::parameter_count(), |
+ Smi::FromInt(num_parameters)); |
+ __ Add(ArgumentsAccessNewDescriptor::parameter_pointer(), fp, |
+ StandardFrameConstants::kCallerSPOffset + offset); |
// Arguments to ArgumentsAccessStub: |
- // function, receiver address, parameter count. |
- // The stub will rewrite receiver and parameter count if the previous |
- // stack frame was an arguments adapter frame. |
- ArgumentsAccessStub::Type type; |
- if (is_strict(language_mode()) || !has_simple_parameters()) { |
- type = ArgumentsAccessStub::NEW_STRICT; |
- } else if (literal()->has_duplicate_parameters()) { |
- type = ArgumentsAccessStub::NEW_SLOPPY_SLOW; |
- } else { |
- type = ArgumentsAccessStub::NEW_SLOPPY_FAST; |
- } |
+ // function, parameter pointer, parameter count. |
+ // The stub will rewrite parameter pointer and parameter count if the |
+ // previous stack frame was an arguments adapter frame. |
+ bool is_unmapped = is_strict(language_mode()) || !has_simple_parameters(); |
+ ArgumentsAccessStub::Type type = ArgumentsAccessStub::ComputeType( |
+ is_unmapped, literal()->has_duplicate_parameters()); |
ArgumentsAccessStub stub(isolate(), type); |
__ CallStub(&stub); |