Commit 6af4cb3c authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[macro-assembler] Delete unused ReturnAddressState

Bug: v8:6921
Change-Id: I9f6457812007f72b5fcc714b8baab59fc8337795
Reviewed-on: https://chromium-review.googlesource.com/718104
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48536}
parent cb0cc492
......@@ -850,7 +850,7 @@ void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
ParameterCount callee_args_count(args_reg);
__ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
scratch3, ReturnAddressState::kOnStack, scratch_count);
scratch3, scratch_count);
__ pop(scratch3);
__ pop(scratch2);
__ pop(scratch1);
......
......@@ -757,7 +757,7 @@ void CodeGenerator::AssemblePopArgumentsAdaptorFrame(Register args_reg,
ParameterCount callee_args_count(args_reg);
__ PrepareForTailCall(callee_args_count, caller_args_count_reg, scratch2,
scratch3, ReturnAddressState::kOnStack);
scratch3);
__ bind(&done);
}
......
......@@ -925,7 +925,7 @@ void MacroAssembler::JumpToExternalReference(const ExternalReference& ext,
void TurboAssembler::PrepareForTailCall(
const ParameterCount& callee_args_count, Register caller_args_count_reg,
Register scratch0, Register scratch1, ReturnAddressState ra_state,
Register scratch0, Register scratch1,
int number_of_temp_values_after_return_address) {
#if DEBUG
if (callee_args_count.is_reg()) {
......@@ -934,8 +934,6 @@ void TurboAssembler::PrepareForTailCall(
} else {
DCHECK(!AreAliased(caller_args_count_reg, scratch0, scratch1));
}
DCHECK(ra_state != ReturnAddressState::kNotOnStack ||
number_of_temp_values_after_return_address == 0);
#endif
// Calculate the destination address where we will put the return address
......@@ -964,15 +962,9 @@ void TurboAssembler::PrepareForTailCall(
// to avoid its trashing and let the following loop copy it to the right
// place.
Register tmp_reg = scratch1;
if (ra_state == ReturnAddressState::kOnStack) {
mov(tmp_reg, Operand(ebp, StandardFrameConstants::kCallerPCOffset));
mov(Operand(esp, number_of_temp_values_after_return_address * kPointerSize),
tmp_reg);
} else {
DCHECK(ReturnAddressState::kNotOnStack == ra_state);
DCHECK_EQ(0, number_of_temp_values_after_return_address);
Push(Operand(ebp, StandardFrameConstants::kCallerPCOffset));
}
mov(tmp_reg, Operand(ebp, StandardFrameConstants::kCallerPCOffset));
mov(Operand(esp, number_of_temp_values_after_return_address * kPointerSize),
tmp_reg);
// Restore caller's frame pointer now as it could be overwritten by
// the copying loop.
......
......@@ -38,8 +38,6 @@ enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
enum RegisterValueType { REGISTER_VALUE_IS_SMI, REGISTER_VALUE_IS_INT32 };
enum class ReturnAddressState { kOnStack, kNotOnStack };
#ifdef DEBUG
bool AreAliased(Register reg1, Register reg2, Register reg3 = no_reg,
Register reg4 = no_reg, Register reg5 = no_reg,
......@@ -140,18 +138,17 @@ class TurboAssembler : public Assembler {
void SmiUntag(Register reg) { sar(reg, kSmiTagSize); }
// Removes current frame and its arguments from the stack preserving
// the arguments and a return address pushed to the stack for the next call.
// |ra_state| defines whether return address is already pushed to stack or
// not. Both |callee_args_count| and |caller_args_count_reg| do not include
// receiver. |callee_args_count| is not modified, |caller_args_count_reg|
// is trashed. |number_of_temp_values_after_return_address| specifies
// the number of words pushed to the stack after the return address. This is
// to allow "allocation" of scratch registers that this function requires
// by saving their values on the stack.
// Removes current frame and its arguments from the stack preserving the
// arguments and a return address pushed to the stack for the next call. Both
// |callee_args_count| and |caller_args_count_reg| do not include receiver.
// |callee_args_count| is not modified, |caller_args_count_reg| is trashed.
// |number_of_temp_values_after_return_address| specifies the number of words
// pushed to the stack after the return address. This is to allow "allocation"
// of scratch registers that this function requires by saving their values on
// the stack.
void PrepareForTailCall(const ParameterCount& callee_args_count,
Register caller_args_count_reg, Register scratch0,
Register scratch1, ReturnAddressState ra_state,
Register scratch1,
int number_of_temp_values_after_return_address);
// Before calling a C-function from generated code, align arguments on stack.
......
......@@ -2227,8 +2227,7 @@ void MacroAssembler::MaybeDropFrames() {
void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
Register caller_args_count_reg,
Register scratch0, Register scratch1,
ReturnAddressState ra_state) {
Register scratch0, Register scratch1) {
#if DEBUG
if (callee_args_count.is_reg()) {
DCHECK(!AreAliased(callee_args_count.reg(), caller_args_count_reg, scratch0,
......@@ -2260,13 +2259,8 @@ void TurboAssembler::PrepareForTailCall(const ParameterCount& callee_args_count,
// to avoid its trashing and let the following loop copy it to the right
// place.
Register tmp_reg = scratch1;
if (ra_state == ReturnAddressState::kOnStack) {
movp(tmp_reg, Operand(rbp, StandardFrameConstants::kCallerPCOffset));
movp(Operand(rsp, 0), tmp_reg);
} else {
DCHECK(ReturnAddressState::kNotOnStack == ra_state);
Push(Operand(rbp, StandardFrameConstants::kCallerPCOffset));
}
movp(tmp_reg, Operand(rbp, StandardFrameConstants::kCallerPCOffset));
movp(Operand(rsp, 0), tmp_reg);
// Restore caller's frame pointer now as it could be overwritten by
// the copying loop.
......
......@@ -45,8 +45,6 @@ typedef Operand MemOperand;
enum RememberedSetAction { EMIT_REMEMBERED_SET, OMIT_REMEMBERED_SET };
enum SmiCheck { INLINE_SMI_CHECK, OMIT_SMI_CHECK };
enum class ReturnAddressState { kOnStack, kNotOnStack };
#ifdef DEBUG
bool AreAliased(Register reg1,
Register reg2,
......@@ -361,15 +359,13 @@ class TurboAssembler : public Assembler {
}
void LeaveFrame(StackFrame::Type type);
// Removes current frame and its arguments from the stack preserving
// the arguments and a return address pushed to the stack for the next call.
// |ra_state| defines whether return address is already pushed to stack or
// not. Both |callee_args_count| and |caller_args_count_reg| do not include
// receiver. |callee_args_count| is not modified, |caller_args_count_reg|
// is trashed.
// Removes current frame and its arguments from the stack preserving the
// arguments and a return address pushed to the stack for the next call. Both
// |callee_args_count| and |caller_args_count_reg| do not include receiver.
// |callee_args_count| is not modified, |caller_args_count_reg| is trashed.
void PrepareForTailCall(const ParameterCount& callee_args_count,
Register caller_args_count_reg, Register scratch0,
Register scratch1, ReturnAddressState ra_state);
Register scratch1);
inline bool AllowThisStubCall(CodeStub* stub);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment