Index: src/arm64/code-stubs-arm64.cc |
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc |
index f5ed9aafcabf7bbf2c213ea544b82c56bef4e73f..57a0ffde92128c807ebeaceeb38ae7b3f16abfd4 100644 |
--- a/src/arm64/code-stubs-arm64.cc |
+++ b/src/arm64/code-stubs-arm64.cc |
@@ -2289,7 +2289,6 @@ |
void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { |
- // x0 - number of arguments |
// x1 - function |
// x3 - slot id |
// x2 - vector |
@@ -2304,6 +2303,8 @@ |
__ Cmp(function, scratch); |
__ B(ne, miss); |
+ __ Mov(x0, Operand(arg_count())); |
+ |
// Increment the call count for monomorphic function calls. |
__ Add(feedback_vector, feedback_vector, |
Operand::UntagSmiAndScale(index, kPointerSizeLog2)); |
@@ -2318,31 +2319,20 @@ |
Register new_target_arg = index; |
__ Mov(allocation_site_arg, allocation_site); |
__ Mov(new_target_arg, function); |
- if (argc_in_register()) { |
- // Pass a default ArgumentCountKey::Any since the argc is only available |
- // in r0. We do not have the actual count here. |
- ArrayConstructorStub stub(masm->isolate()); |
- __ TailCallStub(&stub); |
- } else { |
- // arg_count() is expected in r0 if the arg_count() >= 2 |
- // (ArgumentCountKey::MORE_THAN_ONE). |
- ArrayConstructorStub stub(masm->isolate(), arg_count()); |
- __ TailCallStub(&stub); |
- } |
+ ArrayConstructorStub stub(masm->isolate(), arg_count()); |
+ __ TailCallStub(&stub); |
} |
void CallICStub::Generate(MacroAssembler* masm) { |
ASM_LOCATION("CallICStub"); |
- // x0 - number of arguments if argc_in_register() is true |
// x1 - function |
// x3 - slot id (Smi) |
// x2 - vector |
Label extra_checks_or_miss, call, call_function; |
- if (!argc_in_register()) { |
- __ Mov(x0, arg_count()); |
- } |
+ int argc = arg_count(); |
+ ParameterCount actual(argc); |
Register function = x1; |
Register feedback_vector = x2; |
@@ -2385,6 +2375,7 @@ |
__ Str(index, FieldMemOperand(feedback_vector, 0)); |
__ Bind(&call_function); |
+ __ Mov(x0, argc); |
__ Jump(masm->isolate()->builtins()->CallFunction(convert_mode(), |
tail_call_mode()), |
RelocInfo::CODE_TARGET); |
@@ -2419,6 +2410,7 @@ |
__ Str(x5, FieldMemOperand(x4, FixedArray::kHeaderSize)); |
__ Bind(&call); |
+ __ Mov(x0, argc); |
__ Jump(masm->isolate()->builtins()->Call(convert_mode(), tail_call_mode()), |
RelocInfo::CODE_TARGET); |
@@ -2456,13 +2448,9 @@ |
{ |
FrameScope scope(masm, StackFrame::INTERNAL); |
CreateWeakCellStub create_stub(masm->isolate()); |
- __ SmiTag(x0); |
- __ Push(x0); |
__ Push(function); |
__ CallStub(&create_stub); |
__ Pop(function); |
- __ Pop(x0); |
- __ SmiUntag(x0); |
} |
__ B(&call_function); |
@@ -2481,10 +2469,6 @@ |
FrameScope scope(masm, StackFrame::INTERNAL); |
- // Store number of arguments. |
- __ SmiTag(x0); |
- __ Push(x0); |
- |
// Push the receiver and the function and feedback info. |
__ Push(x1, x2, x3); |
@@ -2493,10 +2477,6 @@ |
// Move result to edi and exit the internal frame. |
__ Mov(x1, x0); |
- |
- // Restore number of arguments. |
- __ Pop(x0); |
- __ SmiUntag(x0); |
} |