Commit 0e05d1b7 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

PPC/s390: [osr] Extend OSR tracing

Port 3e43010a

Original Commit Message:

    New trace events:

    - finished OSR compilation.
    - entry into OSR code.

    Since the latter now happens without a trip into runtime, tracing is a
    bit more involved - we need to check FLAG_trace_osr in generated code,
    and call a runtime function if it is set.

R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N

Change-Id: I2f09eb755dd5986d94f736280ad38574129085e2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3635717Reviewed-by: 's avatarJunliang Yan <junyan@redhat.com>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#80431}
parent ce488c01
......@@ -426,6 +426,24 @@ void OnStackReplacement(MacroAssembler* masm, OsrSourceTier source,
__ bind(&jump_to_optimized_code);
DCHECK_EQ(maybe_target_code, r3); // Already in the right spot.
// OSR entry tracing.
{
Label next;
__ Move(r4, ExternalReference::address_of_FLAG_trace_osr());
__ LoadU64(r4, MemOperand(r4));
__ andi(r0, r4, Operand(0xFF)); // Mask to the LSB.
__ beq(&next, cr0);
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
__ Push(r3); // Preserve the code object.
__ CallRuntime(Runtime::kTraceOptimizedOSREntry, 0);
__ Pop(r3);
}
__ 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.
......
......@@ -289,6 +289,24 @@ void OnStackReplacement(MacroAssembler* masm, OsrSourceTier source,
__ bind(&jump_to_optimized_code);
DCHECK_EQ(maybe_target_code, r2); // Already in the right spot.
// OSR entry tracing.
{
Label next;
__ Move(r3, ExternalReference::address_of_FLAG_trace_osr());
__ LoadU64(r3, MemOperand(r3));
__ tmll(r3, Operand(0xFF)); // Mask to the LSB.
__ beq(&next);
{
FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
__ Push(r2); // Preserve the code object.
__ CallRuntime(Runtime::kTraceOptimizedOSREntry, 0);
__ Pop(r2);
}
__ 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