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

PPC/s390: [log][compiler] Enable first-execution logging

Port b2576418

Original Commit Message:

    Re-implement the --log-function-events functionality after
    refactoring the tiering state bits on the FeedbackVector.

    The new version also tries to log first-execution of non-interpreter
    code and will handle OSR events.

    Not-yet supported:
    - First-execution logging when OSR-ing in Sparkplug or Maglev

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

Change-Id: I2a99ca0976bc81e5994fa2e1c6d8045c303fc0f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3876375Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#83074}
parent c4177c53
......@@ -2156,13 +2156,18 @@ void MacroAssembler::LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing(
void MacroAssembler::MaybeOptimizeCodeOrTailCallOptimizedCodeSlot(
Register flags, Register feedback_vector) {
DCHECK(!AreAliased(flags, feedback_vector));
Label maybe_has_optimized_code;
Label maybe_has_optimized_code, maybe_needs_logging;
// Check if optimized code is available
TestBitMask(flags, ((FeedbackVector::kFlagsTieringStateIsAnyRequested, r0);
beq(&maybe_has_optimized_code, cr0);
TestBitMask(flags, FeedbackVector::kFlagsTieringStateIsAnyRequested, r0);
beq(&maybe_needs_logging, cr0);
GenerateTailCallToReturnedCode(Runtime::kCompileOptimized);
bind(&maybe_needs_logging);
TestBitMask(flags, FeedbackVector::LogNextExecutionBit::kMask, r0);
beq(&maybe_has_optimized_code, cr0);
GenerateTailCallToReturnedCode(Runtime::kFunctionLogNextExecution);
bind(&maybe_has_optimized_code);
Register optimized_code_entry = flags;
LoadAnyTaggedField(optimized_code_entry,
......
......@@ -2149,13 +2149,18 @@ void MacroAssembler::LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing(
void MacroAssembler::MaybeOptimizeCodeOrTailCallOptimizedCodeSlot(
Register flags, Register feedback_vector) {
DCHECK(!AreAliased(flags, feedback_vector));
Label maybe_has_optimized_code;
Label maybe_has_optimized_code, maybe_needs_logging;
// Check if optimized code is available
TestBitMask(flags, ((FeedbackVector::kFlagsTieringStateIsAnyRequested, r0);
beq(&maybe_has_optimized_code);
TestBitMask(flags, FeedbackVector::kFlagsTieringStateIsAnyRequested, r0);
beq(&maybe_needs_logging);
GenerateTailCallToReturnedCode(Runtime::kCompileOptimized);
bind(&maybe_needs_logging);
TestBitMask(flags, FeedbackVector::LogNextExecutionBit::kMask, r0);
beq(&maybe_has_optimized_code);
GenerateTailCallToReturnedCode(Runtime::kFunctionLogNextExecution);
bind(&maybe_has_optimized_code);
Register optimized_code_entry = flags;
LoadAnyTaggedField(
......
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