Commit 85b5fbc7 authored by Liu Yu's avatar Liu Yu Committed by V8 LUCI CQ

[loong64][mips64][log][compiler] Enable first-execution logging

Port commit c0f420ef

Change-Id: I061da980f39888f0f43e2746c8c37d683b200a95
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3885381
Auto-Submit: Liu Yu <liuyu@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/main@{#83095}
parent 3eb65be7
......@@ -4274,18 +4274,28 @@ void MacroAssembler::MaybeOptimizeCodeOrTailCallOptimizedCodeSlot(
Register flags, Register feedback_vector) {
ASM_CODE_COMMENT(this);
DCHECK(!AreAliased(flags, feedback_vector));
Label maybe_has_optimized_code;
Label maybe_has_optimized_code, maybe_needs_logging;
// Check if optimized code marker is available.
{
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
And(scratch, flags,
Operand(FeedbackVector::kFlagsTieringStateIsAnyRequested));
Branch(&maybe_has_optimized_code, eq, scratch, Operand(zero_reg));
Branch(&maybe_needs_logging, eq, scratch, Operand(zero_reg));
}
GenerateTailCallToReturnedCode(Runtime::kCompileOptimized);
bind(&maybe_needs_logging);
{
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
And(scratch, flags, Operand(FeedbackVector::LogNextExecutionBit::kMask));
Branch(&maybe_has_optimized_code, eq, scratch, Operand(zero_reg));
}
GenerateTailCallToReturnedCode(Runtime::kFunctionLogNextExecution);
bind(&maybe_has_optimized_code);
Register optimized_code_entry = flags;
Ld_d(optimized_code_entry,
......
......@@ -6318,18 +6318,28 @@ void MacroAssembler::LoadFeedbackVectorFlagsAndJumpIfNeedsProcessing(
void MacroAssembler::MaybeOptimizeCodeOrTailCallOptimizedCodeSlot(
Register flags, Register feedback_vector) {
ASM_CODE_COMMENT(this);
Label maybe_has_optimized_code;
Label maybe_has_optimized_code, maybe_needs_logging;
// Check if optimized code marker is available.
{
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
And(scratch, flags,
Operand(FeedbackVector::kFlagsTieringStateIsAnyRequested));
Branch(&maybe_has_optimized_code, eq, scratch, Operand(zero_reg));
Branch(&maybe_needs_logging, eq, scratch, Operand(zero_reg));
}
GenerateTailCallToReturnedCode(Runtime::kCompileOptimized);
bind(&maybe_needs_logging);
{
UseScratchRegisterScope temps(this);
Register scratch = temps.Acquire();
And(scratch, flags, Operand(FeedbackVector::LogNextExecutionBit::kMask));
Branch(&maybe_has_optimized_code, eq, scratch, Operand(zero_reg));
}
GenerateTailCallToReturnedCode(Runtime::kFunctionLogNextExecution);
bind(&maybe_has_optimized_code);
Register optimized_code_entry = flags;
Ld(optimized_code_entry,
......
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