Commit 6a041da0 authored by Georgia Kouveli's avatar Georgia Kouveli Committed by Commit Bot

Remove BailoutState and pad accumulator for arm64.

Bug: v8:6644
Change-Id: I5cd713465563f2dc803b175684bf04a05559e653
Reviewed-on: https://chromium-review.googlesource.com/693239
Commit-Queue: Georgia Kouveli <georgia.kouveli@arm.com>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48285}
parent 947101c8
......@@ -210,9 +210,7 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ vldr(reg, r1, src_offset);
}
// Push state, pc, and continuation from the last output frame.
__ ldr(r6, MemOperand(r2, FrameDescription::state_offset()));
__ push(r6);
// Push pc and continuation from the last output frame.
__ ldr(r6, MemOperand(r2, FrameDescription::pc_offset()));
__ push(r6);
__ ldr(r6, MemOperand(r2, FrameDescription::continuation_offset()));
......@@ -295,6 +293,7 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
__ push(scratch);
}
bool Deoptimizer::PadTopOfStackRegister() { return false; }
void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
SetFrameSlot(offset, value);
......
......@@ -202,10 +202,6 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ Ldr(reg, MemOperand(x1, src_offset));
}
// Push state from the last output frame.
__ Ldr(x6, MemOperand(current_frame, FrameDescription::state_offset()));
__ Push(x6);
// TODO(all): ARM copies a lot (if not all) of the last output frame onto the
// stack, then pops it all into registers. Here, we try to load it directly
// into the relevant registers. Is this correct? If so, we should improve the
......@@ -276,6 +272,7 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
__ Push(entry_id);
}
bool Deoptimizer::PadTopOfStackRegister() { return true; }
void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
SetFrameSlot(offset, value);
......
......@@ -1513,7 +1513,6 @@ void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
__ pop(r0);
}
__ add(sp, sp, Operand(kPointerSize)); // Ignore state
__ mov(pc, lr); // Jump to ContinueToBuiltin stub
}
......@@ -1575,28 +1574,9 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
__ CallRuntime(Runtime::kNotifyDeoptimized);
}
// Get the full codegen state from the stack and untag it -> r6.
__ ldr(r6, MemOperand(sp, 0 * kPointerSize));
__ SmiUntag(r6);
// Switch on the state.
Label with_tos_register, unknown_state;
__ cmp(r6,
Operand(static_cast<int>(Deoptimizer::BailoutState::NO_REGISTERS)));
__ b(ne, &with_tos_register);
__ add(sp, sp, Operand(1 * kPointerSize)); // Remove state.
__ Ret();
__ bind(&with_tos_register);
DCHECK_EQ(kInterpreterAccumulatorRegister.code(), r0.code());
__ ldr(r0, MemOperand(sp, 1 * kPointerSize));
__ cmp(r6,
Operand(static_cast<int>(Deoptimizer::BailoutState::TOS_REGISTER)));
__ b(ne, &unknown_state);
__ add(sp, sp, Operand(2 * kPointerSize)); // Remove state.
__ pop(r0);
__ Ret();
__ bind(&unknown_state);
__ stop("no cases left");
}
static void Generate_OnStackReplacementHelper(MacroAssembler* masm,
......
......@@ -1547,9 +1547,6 @@ void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
__ Pop(x0);
}
// Ignore state (pushed by Deoptimizer::EntryGenerator::Generate).
__ Drop(1);
// Jump to the ContinueToBuiltin stub. Deoptimizer::EntryGenerator::Generate
// loads this into lr before it jumps here.
__ Br(lr);
......@@ -1612,31 +1609,10 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
__ CallRuntime(Runtime::kNotifyDeoptimized);
}
// Get the full codegen state from the stack and untag it.
Register state = x6;
__ Peek(state, 0);
__ SmiUntag(state);
// Switch on the state.
Label with_tos_register, unknown_state;
__ CompareAndBranch(state,
static_cast<int>(Deoptimizer::BailoutState::NO_REGISTERS),
ne, &with_tos_register);
__ Drop(1); // Remove state.
__ Ret();
__ Bind(&with_tos_register);
// Reload TOS register.
// Pop TOS register and padding.
DCHECK_EQ(kInterpreterAccumulatorRegister.code(), x0.code());
__ Peek(x0, kPointerSize);
__ CompareAndBranch(state,
static_cast<int>(Deoptimizer::BailoutState::TOS_REGISTER),
ne, &unknown_state);
__ Drop(2); // Remove state and TOS.
__ Pop(x0, padreg);
__ Ret();
__ Bind(&unknown_state);
__ Abort(kInvalidFullCodegenState);
}
static void Generate_OnStackReplacementHelper(MacroAssembler* masm,
......
......@@ -1562,8 +1562,7 @@ void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
// Tear down internal frame.
}
__ pop(MemOperand(esp, 0)); // Ignore state offset
__ ret(0); // Return to ContinueToBuiltin stub still on stack.
__ Ret(); // Return to ContinueToBuiltin stub still on stack.
}
namespace {
......@@ -1624,25 +1623,9 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
// Tear down internal frame.
}
// Get the full codegen state from the stack and untag it.
__ mov(ecx, Operand(esp, 1 * kPointerSize));
__ SmiUntag(ecx);
// Switch on the state.
Label not_no_registers, not_tos_eax;
__ cmp(ecx, static_cast<int>(Deoptimizer::BailoutState::NO_REGISTERS));
__ j(not_equal, &not_no_registers, Label::kNear);
__ ret(1 * kPointerSize); // Remove state.
__ bind(&not_no_registers);
DCHECK_EQ(kInterpreterAccumulatorRegister.code(), eax.code());
__ mov(eax, Operand(esp, 2 * kPointerSize));
__ cmp(ecx, static_cast<int>(Deoptimizer::BailoutState::TOS_REGISTER));
__ j(not_equal, &not_tos_eax, Label::kNear);
__ ret(2 * kPointerSize); // Remove state, eax.
__ bind(&not_tos_eax);
__ Abort(kNoCasesLeft);
__ mov(eax, Operand(esp, 1 * kPointerSize));
__ ret(1 * kPointerSize); // Remove eax.
}
// static
......
......@@ -1488,7 +1488,6 @@ void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
__ Pop(v0);
}
__ Addu(sp, sp, Operand(kPointerSize)); // Ignore state
__ Jump(ra); // Jump to the ContinueToBuiltin stub
}
......@@ -1548,29 +1547,11 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
__ CallRuntime(Runtime::kNotifyDeoptimized);
}
// Get the full codegen state from the stack and untag it -> t2.
__ lw(t2, MemOperand(sp, 0 * kPointerSize));
__ SmiUntag(t2);
// Switch on the state.
Label with_tos_register, unknown_state;
__ Branch(&with_tos_register, ne, t2,
Operand(static_cast<int>(Deoptimizer::BailoutState::NO_REGISTERS)));
__ Ret(USE_DELAY_SLOT);
// Safe to fill delay slot Addu will emit one instruction.
__ Addu(sp, sp, Operand(1 * kPointerSize)); // Remove state.
__ bind(&with_tos_register);
DCHECK_EQ(kInterpreterAccumulatorRegister.code(), v0.code());
__ lw(v0, MemOperand(sp, 1 * kPointerSize));
__ Branch(&unknown_state, ne, t2,
Operand(static_cast<int>(Deoptimizer::BailoutState::TOS_REGISTER)));
__ lw(v0, MemOperand(sp, 0 * kPointerSize));
__ Ret(USE_DELAY_SLOT);
// Safe to fill delay slot Addu will emit one instruction.
__ Addu(sp, sp, Operand(2 * kPointerSize)); // Remove state.
__ bind(&unknown_state);
__ stop("no cases left");
__ Addu(sp, sp, Operand(1 * kPointerSize)); // Remove accumulator.
}
static void Generate_OnStackReplacementHelper(MacroAssembler* masm,
......
......@@ -1492,7 +1492,6 @@ void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
__ pop(v0);
}
__ Daddu(sp, sp, Operand(kPointerSize)); // Ignore state
__ Jump(ra); // Jump to the ContinueToBuiltin stub
}
......@@ -1552,30 +1551,11 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
__ CallRuntime(Runtime::kNotifyDeoptimized);
}
// Get the full codegen state from the stack and untag it -> a6.
__ Lw(a6, UntagSmiMemOperand(sp, 0 * kPointerSize));
// Switch on the state.
Label with_tos_register, unknown_state;
__ Branch(
&with_tos_register, ne, a6,
Operand(static_cast<int64_t>(Deoptimizer::BailoutState::NO_REGISTERS)));
__ Ret(USE_DELAY_SLOT);
// Safe to fill delay slot Addu will emit one instruction.
__ Daddu(sp, sp, Operand(1 * kPointerSize)); // Remove state.
__ bind(&with_tos_register);
DCHECK_EQ(kInterpreterAccumulatorRegister.code(), v0.code());
__ Ld(v0, MemOperand(sp, 1 * kPointerSize));
__ Branch(
&unknown_state, ne, a6,
Operand(static_cast<int64_t>(Deoptimizer::BailoutState::TOS_REGISTER)));
__ Ld(v0, MemOperand(sp, 0 * kPointerSize));
__ Ret(USE_DELAY_SLOT);
// Safe to fill delay slot Addu will emit one instruction.
__ Daddu(sp, sp, Operand(2 * kPointerSize)); // Remove state.
__ bind(&unknown_state);
__ stop("no cases left");
__ Daddu(sp, sp, Operand(1 * kPointerSize)); // Remove state.
}
static void Generate_OnStackReplacementHelper(MacroAssembler* masm,
......
......@@ -1530,7 +1530,6 @@ void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
__ pop(r3);
}
__ addi(sp, sp, Operand(kPointerSize)); // Ignore state
__ blr(); // Jump to ContinueToBuiltin stub
}
......@@ -1592,30 +1591,10 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
__ CallRuntime(Runtime::kNotifyDeoptimized);
}
// Get the full codegen state from the stack and untag it -> r9.
__ LoadP(r9, MemOperand(sp, 0 * kPointerSize));
__ SmiUntag(r9);
// Switch on the state.
Label with_tos_register, unknown_state;
__ cmpi(
r9,
Operand(static_cast<intptr_t>(Deoptimizer::BailoutState::NO_REGISTERS)));
__ bne(&with_tos_register);
__ addi(sp, sp, Operand(1 * kPointerSize)); // Remove state.
__ Ret();
__ bind(&with_tos_register);
DCHECK_EQ(kInterpreterAccumulatorRegister.code(), r3.code());
__ LoadP(r3, MemOperand(sp, 1 * kPointerSize));
__ cmpi(
r9,
Operand(static_cast<intptr_t>(Deoptimizer::BailoutState::TOS_REGISTER)));
__ bne(&unknown_state);
__ addi(sp, sp, Operand(2 * kPointerSize)); // Remove state.
__ LoadP(r3, MemOperand(sp, 0 * kPointerSize));
__ addi(sp, sp, Operand(1 * kPointerSize));
__ Ret();
__ bind(&unknown_state);
__ stop("no cases left");
}
static void Generate_OnStackReplacementHelper(MacroAssembler* masm,
......
......@@ -1525,7 +1525,6 @@ void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
__ pop(r2);
}
__ AddP(sp, sp, Operand(kPointerSize)); // Ignore state
__ Ret(); // Jump to ContinueToBuiltin stub
}
......@@ -1587,30 +1586,9 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
__ CallRuntime(Runtime::kNotifyDeoptimized);
}
// Get the full codegen state from the stack and untag it -> r8.
__ LoadP(r8, MemOperand(sp, 0 * kPointerSize));
__ SmiUntag(r8);
// Switch on the state.
Label with_tos_register, unknown_state;
__ CmpP(
r8,
Operand(static_cast<intptr_t>(Deoptimizer::BailoutState::NO_REGISTERS)));
__ bne(&with_tos_register);
__ la(sp, MemOperand(sp, 1 * kPointerSize)); // Remove state.
__ Ret();
__ bind(&with_tos_register);
DCHECK_EQ(kInterpreterAccumulatorRegister.code(), r2.code());
__ LoadP(r2, MemOperand(sp, 1 * kPointerSize));
__ CmpP(
r8,
Operand(static_cast<intptr_t>(Deoptimizer::BailoutState::TOS_REGISTER)));
__ bne(&unknown_state);
__ la(sp, MemOperand(sp, 2 * kPointerSize)); // Remove state.
__ pop(r2);
__ Ret();
__ bind(&unknown_state);
__ stop("no cases left");
}
static void Generate_OnStackReplacementHelper(MacroAssembler* masm,
......
......@@ -1540,7 +1540,6 @@ void Builtins::Generate_NotifyBuiltinContinuation(MacroAssembler* masm) {
// Tear down internal frame.
}
__ DropUnderReturnAddress(1); // Ignore state offset
__ ret(0); // Return to ContinueToBuiltin stub still on stack.
}
......@@ -1603,26 +1602,9 @@ void Builtins::Generate_NotifyDeoptimized(MacroAssembler* masm) {
// Tear down internal frame.
}
// Get the full codegen state from the stack and untag it.
__ SmiToInteger32(kScratchRegister, Operand(rsp, kPCOnStackSize));
// Switch on the state.
Label not_no_registers, not_tos_rax;
__ cmpp(kScratchRegister,
Immediate(static_cast<int>(Deoptimizer::BailoutState::NO_REGISTERS)));
__ j(not_equal, &not_no_registers, Label::kNear);
__ ret(1 * kPointerSize); // Remove state.
__ bind(&not_no_registers);
DCHECK_EQ(kInterpreterAccumulatorRegister.code(), rax.code());
__ movp(rax, Operand(rsp, kPCOnStackSize + kPointerSize));
__ cmpp(kScratchRegister,
Immediate(static_cast<int>(Deoptimizer::BailoutState::TOS_REGISTER)));
__ j(not_equal, &not_tos_rax, Label::kNear);
__ ret(2 * kPointerSize); // Remove state, rax.
__ bind(&not_tos_rax);
__ Abort(kNoCasesLeft);
__ movp(rax, Operand(rsp, kPCOnStackSize));
__ ret(1 * kPointerSize); // Remove rax.
}
// static
......
......@@ -716,11 +716,9 @@ void Deoptimizer::DoComputeOutputFrames() {
PrintFunctionName();
PrintF(trace_scope_->file(),
" @%d => node=%d, pc=0x%08" V8PRIxPTR ", caller sp=0x%08" V8PRIxPTR
", state=%s, took %0.3f ms]\n",
", took %0.3f ms]\n",
bailout_id_, node_id.ToInt(), output_[index]->GetPc(),
caller_frame_top_, BailoutStateToString(static_cast<BailoutState>(
output_[index]->GetState()->value())),
ms);
caller_frame_top_, ms);
}
}
......@@ -741,10 +739,11 @@ void Deoptimizer::DoComputeInterpretedFrame(TranslatedFrame* translated_frame,
InterpreterFrameConstants::RegisterStackSlotCount(register_count);
int height_in_bytes = register_stack_slot_count * kPointerSize;
// The topmost frame is assumed to be in bailout state
// {BailoutState::TOS_REGISTER} and will contain the accumulator, which we
// add to the frame height here.
if (is_topmost) height_in_bytes += kPointerSize;
// The topmost frame will contain the accumulator.
if (is_topmost) {
height_in_bytes += kPointerSize;
if (PadTopOfStackRegister()) height_in_bytes += kPointerSize;
}
TranslatedFrame::iterator function_iterator = value_iterator;
Object* function = value_iterator->GetRawValue();
......@@ -939,9 +938,13 @@ void Deoptimizer::DoComputeInterpretedFrame(TranslatedFrame* translated_frame,
// Translate the accumulator register (depending on frame position).
if (is_topmost) {
// For topmost frame, put the accumulator on the stack. The bailout state
// for interpreted frames is always set to {BailoutState::TOS_REGISTER} and
// the {NotifyDeoptimized} builtin pops it off the topmost frame (possibly
if (PadTopOfStackRegister()) {
output_offset -= kPointerSize;
WriteValueToOutput(isolate()->heap()->the_hole_value(), 0, frame_index,
output_offset, "padding ");
}
// For topmost frame, put the accumulator on the stack. The
// {NotifyDeoptimized} builtin pops it off the topmost frame (possibly
// after materialization).
output_offset -= kPointerSize;
if (goto_catch_handler) {
......@@ -974,9 +977,6 @@ void Deoptimizer::DoComputeInterpretedFrame(TranslatedFrame* translated_frame,
? builtins->builtin(Builtins::kInterpreterEnterBytecodeAdvance)
: builtins->builtin(Builtins::kInterpreterEnterBytecodeDispatch);
output_frame->SetPc(reinterpret_cast<intptr_t>(dispatch_builtin->entry()));
// Restore accumulator (TOS) register.
output_frame->SetState(
Smi::FromInt(static_cast<int>(BailoutState::TOS_REGISTER)));
// Update constant pool.
if (FLAG_enable_embedded_constant_pool) {
......@@ -1153,10 +1153,11 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslatedFrame* translated_frame,
// If the construct frame appears to be topmost we should ensure that the
// value of result register is preserved during continuation execution.
// We do this here by "pushing" the result of the constructor function to the
// top of the reconstructed stack and then using the
// BailoutState::TOS_REGISTER machinery.
// top of the reconstructed stack and popping it in
// {Builtins::kNotifyDeoptimized}.
if (is_topmost) {
height_in_bytes += kPointerSize;
if (PadTopOfStackRegister()) height_in_bytes += kPointerSize;
}
JSFunction* function = JSFunction::cast(value_iterator->GetRawValue());
......@@ -1271,15 +1272,17 @@ void Deoptimizer::DoComputeConstructStubFrame(TranslatedFrame* translated_frame,
}
if (is_topmost) {
if (PadTopOfStackRegister()) {
output_offset -= kPointerSize;
WriteValueToOutput(isolate()->heap()->the_hole_value(), 0, frame_index,
output_offset, "padding ");
}
// Ensure the result is restored back when we return to the stub.
output_offset -= kPointerSize;
Register result_reg = kReturnRegister0;
value = input_->GetRegister(result_reg.code());
output_frame->SetFrameSlot(output_offset, value);
DebugPrintOutputSlot(value, frame_index, output_offset, "subcall result\n");
output_frame->SetState(
Smi::FromInt(static_cast<int>(BailoutState::TOS_REGISTER)));
}
CHECK_EQ(0u, output_offset);
......@@ -1348,13 +1351,14 @@ void Deoptimizer::DoComputeAccessorStubFrame(TranslatedFrame* translated_frame,
// If the accessor frame appears to be topmost we should ensure that the
// value of result register is preserved during continuation execution.
// We do this here by "pushing" the result of the accessor function to the
// top of the reconstructed stack and then using the
// BailoutState::TOS_REGISTER machinery.
// We don't need to restore the result in case of a setter call because we
// have to return the stored value but not the result of the setter function.
bool should_preserve_result = is_topmost && !is_setter_stub_frame;
if (should_preserve_result) {
// top of the reconstructed stack and then popping it in
// {Builtins::kNotifyDeoptimized}.
// For setter calls, since the result register is going to be overwritten
// anyway in the stub, we store a dummy value to pop into the result register
// to keep the code simpler.
if (is_topmost) {
height_in_bytes += kPointerSize;
if (PadTopOfStackRegister()) height_in_bytes += kPointerSize;
}
const char* kind = is_setter_stub_frame ? "setter" : "getter";
......@@ -1454,7 +1458,12 @@ void Deoptimizer::DoComputeAccessorStubFrame(TranslatedFrame* translated_frame,
output_offset);
}
if (should_preserve_result) {
if (is_topmost) {
if (PadTopOfStackRegister()) {
output_offset -= kPointerSize;
WriteValueToOutput(isolate()->heap()->the_hole_value(), 0, frame_index,
output_offset, "padding ");
}
// Ensure the result is restored back when we return to the stub.
output_offset -= kPointerSize;
Register result_reg = kReturnRegister0;
......@@ -1462,12 +1471,6 @@ void Deoptimizer::DoComputeAccessorStubFrame(TranslatedFrame* translated_frame,
output_frame->SetFrameSlot(output_offset, value);
DebugPrintOutputSlot(value, frame_index, output_offset,
"accessor result\n");
output_frame->SetState(
Smi::FromInt(static_cast<int>(BailoutState::TOS_REGISTER)));
} else {
output_frame->SetState(
Smi::FromInt(static_cast<int>(BailoutState::NO_REGISTERS)));
}
CHECK_EQ(0u, output_offset);
......@@ -1630,9 +1633,6 @@ void Deoptimizer::DoComputeBuiltinContinuation(
}
output_frame->SetTop(top_address);
output_frame->SetState(
Smi::FromInt(static_cast<int>(BailoutState::NO_REGISTERS)));
// Get the possible JSFunction for the case that
intptr_t maybe_function =
reinterpret_cast<intptr_t>(value_iterator->GetRawValue());
......
......@@ -326,21 +326,6 @@ class Deoptimizer : public Malloced {
public:
enum BailoutType { EAGER, LAZY, SOFT, kLastBailoutType = SOFT };
enum class BailoutState {
NO_REGISTERS,
TOS_REGISTER,
};
static const char* BailoutStateToString(BailoutState state) {
switch (state) {
case BailoutState::NO_REGISTERS:
return "NO_REGISTERS";
case BailoutState::TOS_REGISTER:
return "TOS_REGISTER";
}
UNREACHABLE();
}
struct DeoptInfo {
DeoptInfo(SourcePosition position, DeoptimizeReason deopt_reason,
int deopt_id)
......@@ -537,6 +522,10 @@ class Deoptimizer : public Malloced {
// Deoptimizes all code marked in the given context.
static void DeoptimizeMarkedCodeForContext(Context* native_context);
// Some architectures need to push padding together with the TOS register
// in order to maintain stack alignment.
static bool PadTopOfStackRegister();
// Searches the list of known deoptimizing code for a Code object
// containing the given address (which is supposedly faster than
// searching all code objects).
......@@ -722,9 +711,6 @@ class FrameDescription {
constant_pool_ = constant_pool;
}
Smi* GetState() const { return state_; }
void SetState(Smi* state) { state_ = state; }
void SetContinuation(intptr_t pc) { continuation_ = pc; }
// Argument count, including receiver.
......@@ -748,8 +734,6 @@ class FrameDescription {
static int pc_offset() { return offsetof(FrameDescription, pc_); }
static int state_offset() { return offsetof(FrameDescription, state_); }
static int continuation_offset() {
return offsetof(FrameDescription, continuation_);
}
......@@ -772,7 +756,6 @@ class FrameDescription {
intptr_t fp_;
intptr_t context_;
intptr_t constant_pool_;
Smi* state_;
// Continuation is the PC where the execution continues after
// deoptimizing.
......
......@@ -184,12 +184,10 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ movsd(xmm_reg, Operand(ebx, src_offset));
}
// Push state, pc, and continuation from the last output frame.
__ push(Operand(ebx, FrameDescription::state_offset()));
// Push pc and continuation from the last output frame.
__ push(Operand(ebx, FrameDescription::pc_offset()));
__ push(Operand(ebx, FrameDescription::continuation_offset()));
// Push the registers from the last output frame.
for (int i = 0; i < kNumberOfRegisters; i++) {
int offset = (i * kPointerSize) + FrameDescription::registers_offset();
......@@ -217,6 +215,7 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
__ bind(&done);
}
bool Deoptimizer::PadTopOfStackRegister() { return false; }
void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
SetFrameSlot(offset, value);
......
......@@ -209,10 +209,7 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ Ldc1(fpu_reg, MemOperand(a1, src_offset));
}
// Push state, pc, and continuation from the last output frame.
__ lw(t2, MemOperand(a2, FrameDescription::state_offset()));
__ push(t2);
// Push pc and continuation from the last output frame.
__ lw(t2, MemOperand(a2, FrameDescription::pc_offset()));
__ push(t2);
__ lw(t2, MemOperand(a2, FrameDescription::continuation_offset()));
......@@ -314,6 +311,7 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
}
}
bool Deoptimizer::PadTopOfStackRegister() { return false; }
void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
SetFrameSlot(offset, value);
......
......@@ -208,16 +208,12 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ Ldc1(fpu_reg, MemOperand(a1, src_offset));
}
// Push state, pc, and continuation from the last output frame.
__ Ld(a6, MemOperand(a2, FrameDescription::state_offset()));
__ push(a6);
// Push pc and continuation from the last output frame.
__ Ld(a6, MemOperand(a2, FrameDescription::pc_offset()));
__ push(a6);
__ Ld(a6, MemOperand(a2, FrameDescription::continuation_offset()));
__ push(a6);
// Technically restoring 'at' should work unless zero_reg is also restored
// but it's safer to check for this.
DCHECK(!(at.bit() & restored_regs));
......@@ -313,6 +309,7 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
}
}
bool Deoptimizer::PadTopOfStackRegister() { return false; }
void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
SetFrameSlot(offset, value);
......
......@@ -204,9 +204,7 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ lfd(dreg, MemOperand(r4, src_offset));
}
// Push state, pc, and continuation from the last output frame.
__ LoadP(r9, MemOperand(r5, FrameDescription::state_offset()));
__ push(r9);
// Push pc, and continuation from the last output frame.
__ LoadP(r9, MemOperand(r5, FrameDescription::pc_offset()));
__ push(r9);
__ LoadP(r9, MemOperand(r5, FrameDescription::continuation_offset()));
......@@ -249,6 +247,7 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
__ push(ip);
}
bool Deoptimizer::PadTopOfStackRegister() { return false; }
void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
SetFrameSlot(offset, value);
......
......@@ -211,9 +211,7 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ ld(dreg, MemOperand(r3, src_offset));
}
// Push state, pc, and continuation from the last output frame.
__ LoadP(r8, MemOperand(r4, FrameDescription::state_offset()));
__ push(r8);
// Push pc and continuation from the last output frame.
__ LoadP(r8, MemOperand(r4, FrameDescription::pc_offset()));
__ push(r8);
__ LoadP(r8, MemOperand(r4, FrameDescription::continuation_offset()));
......@@ -254,6 +252,8 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
__ StoreP(ip, MemOperand(sp));
}
bool Deoptimizer::PadTopOfStackRegister() { return false; }
void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
SetFrameSlot(offset, value);
}
......
......@@ -196,8 +196,7 @@ void Deoptimizer::TableEntryGenerator::Generate() {
__ Movsd(xmm_reg, Operand(rbx, src_offset));
}
// Push state, pc, and continuation from the last output frame.
__ Push(Operand(rbx, FrameDescription::state_offset()));
// Push pc and continuation from the last output frame.
__ PushQuad(Operand(rbx, FrameDescription::pc_offset()));
__ PushQuad(Operand(rbx, FrameDescription::continuation_offset()));
......@@ -240,6 +239,7 @@ void Deoptimizer::TableEntryGenerator::GeneratePrologue() {
__ bind(&done);
}
bool Deoptimizer::PadTopOfStackRegister() { return false; }
void FrameDescription::SetCallerPc(unsigned offset, intptr_t value) {
if (kPCOnStackSize == 2 * kPointerSize) {
......
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