Commit 26bd559e authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[loong64][mips64][osr] Extend OSR tracing

Port commit 3e43010a

Bug: v8:12161
Change-Id: Ifda4003b9370ff340ea78d495a05dd310324fd8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3694661Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#80992}
parent 15821ebb
......@@ -1826,6 +1826,24 @@ void OnStackReplacement(MacroAssembler* masm, OsrSourceTier source,
// If the code object is null, just return to the caller.
__ Ret(eq, maybe_target_code, Operand(Smi::zero()));
__ bind(&jump_to_optimized_code);
DCHECK_EQ(maybe_target_code, a0); // Already in the right spot.
// OSR entry tracing.
{
Label next;
__ li(a1, ExternalReference::address_of_FLAG_trace_osr());
__ Ld_bu(a1, MemOperand(a1, 0));
__ Branch(&next, eq, a1, Operand(zero_reg));
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(a0); // Preserve the code object.
__ CallRuntime(Runtime::kTraceOptimizedOSREntry, 0);
__ Pop(a0);
}
__ bind(&next);
}
if (source == OsrSourceTier::kInterpreter) {
// Drop the handler frame that is be sitting on top of the actual
......
......@@ -1822,6 +1822,25 @@ void OnStackReplacement(MacroAssembler* masm, OsrSourceTier source,
// If the code object is null, just return to the caller.
__ Ret(eq, maybe_target_code, Operand(Smi::zero()));
__ bind(&jump_to_optimized_code);
DCHECK_EQ(maybe_target_code, a0); // Already in the right spot.
// OSR entry tracing.
{
Label next;
__ li(a1, ExternalReference::address_of_FLAG_trace_osr());
__ Lbu(a1, MemOperand(a1));
__ Branch(&next, eq, a1, Operand(zero_reg));
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(a0); // Preserve the code object.
__ CallRuntime(Runtime::kTraceOptimizedOSREntry, 0);
__ Pop(a0);
}
__ bind(&next);
}
if (source == OsrSourceTier::kInterpreter) {
// Drop the handler frame that is be sitting on top of the actual
// JavaScript frame. This is the case then OSR is triggered from bytecode.
......
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