Commit b10c2f25 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

PPC/s390: [cpu-profiler] Fix stack iterability during deopt (arm port)

Port 559a0034

Original Commit Message:

    We didn't think this affected arm but it turns out it does.

    This is a port of
    https://chromium-review.googlesource.com/c/v8/v8/+/1688049

R=petermarshall@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: Id081736420a20216cef5c5f483acd987785c4d97
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1829899Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#64044}
parent 24d9e63e
......@@ -113,6 +113,17 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
__ stfd(d0, MemOperand(r4, dst_offset));
}
// Mark the stack as not iterable for the CPU profiler which won't be able to
// walk the stack without the return address.
{
UseScratchRegisterScope temps(masm);
Register is_iterable = temps.Acquire();
Register zero = r7;
__ Move(is_iterable, ExternalReference::stack_is_iterable_address(isolate));
__ li(zero, Operand(0));
__ stb(zero, MemOperand(is_iterable));
}
// Remove the saved registers from the stack.
__ addi(sp, sp, Operand(kSavedRegistersAreaSize));
......@@ -208,6 +219,15 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
}
}
{
UseScratchRegisterScope temps(masm);
Register is_iterable = temps.Acquire();
Register one = r7;
__ Move(is_iterable, ExternalReference::stack_is_iterable_address(isolate));
__ li(one, Operand(1));
__ stb(one, MemOperand(is_iterable));
}
{
UseScratchRegisterScope temps(masm);
Register scratch = temps.Acquire();
......@@ -216,6 +236,7 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
__ mtlr(r0);
__ Jump(scratch);
}
__ stop();
}
......
......@@ -116,6 +116,17 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
__ StoreDouble(d0, MemOperand(r3, dst_offset));
}
// Mark the stack as not iterable for the CPU profiler which won't be able to
// walk the stack without the return address.
{
UseScratchRegisterScope temps(masm);
Register is_iterable = temps.Acquire();
Register zero = r6;
__ Move(is_iterable, ExternalReference::stack_is_iterable_address(isolate));
__ lhi(zero, Operand(0));
__ StoreByte(zero, MemOperand(is_iterable));
}
// Remove the saved registers from the stack.
__ la(sp, MemOperand(sp, kSavedRegistersAreaSize));
......@@ -206,9 +217,19 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
}
}
{
UseScratchRegisterScope temps(masm);
Register is_iterable = temps.Acquire();
Register one = r6;
__ Move(is_iterable, ExternalReference::stack_is_iterable_address(isolate));
__ lhi(one, Operand(1));
__ StoreByte(one, MemOperand(is_iterable));
}
__ pop(ip); // get continuation, leave pc on stack
__ pop(r14);
__ Jump(ip);
__ stop();
}
......
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