PPC/s390: [compiler] Merge all CompileFoo_Bar runtime functions
Port 8b4272c2ca
Original Commit Message:
There's no need to decode the tiering state in generated code - merge
these runtime functions and decode in the new generic CompileOptimized
runtime function instead.
CompileMaglev_Synchronized
CompileMaglev_Concurrent
CompileTurbofan_Synchronized
CompileTurbofan_Concurrent
->
CompileOptimized
R=jgruber@chromium.org, joransiu@ca.ibm.com, junyan@redhat.com, midawson@redhat.com
BUG=
LOG=N
Change-Id: Ia61852825fc747ad7fec9983a18bf4e9d4245ad0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3826053
Commit-Queue: Milad Farazmand <mfarazma@redhat.com>
Reviewed-by: Junliang Yan <junyan@redhat.com>
Cr-Commit-Position: refs/heads/main@{#82417}
This commit is contained in:
parent
08607d37a2
commit
8154ac1468
@ -1982,40 +1982,6 @@ void TurboAssembler::TryInlineTruncateDoubleToI(Register result,
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Tail-call |function_id| if |actual_state| == |expected_state|
|
|
||||||
static void TailCallRuntimeIfStateEquals(MacroAssembler* masm,
|
|
||||||
Register actual_state,
|
|
||||||
TieringState expected_state,
|
|
||||||
Runtime::FunctionId function_id) {
|
|
||||||
Label no_match;
|
|
||||||
__ cmpi(actual_state, Operand(static_cast<int>(expected_state)));
|
|
||||||
__ bne(&no_match);
|
|
||||||
__ GenerateTailCallToReturnedCode(function_id);
|
|
||||||
__ bind(&no_match);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaybeOptimizeCode(MacroAssembler* masm, Register feedback_vector,
|
|
||||||
Register tiering_state) {
|
|
||||||
// ----------- S t a t e -------------
|
|
||||||
// -- r3 : actual argument count
|
|
||||||
// -- r6 : new target (preserved for callee if needed, and caller)
|
|
||||||
// -- r4 : target function (preserved for callee if needed, and caller)
|
|
||||||
// -- feedback vector (preserved for caller if needed)
|
|
||||||
// -- tiering_state : a int32 containing a non-zero optimization
|
|
||||||
// marker.
|
|
||||||
// -----------------------------------
|
|
||||||
DCHECK(!AreAliased(feedback_vector, r4, r6, tiering_state));
|
|
||||||
|
|
||||||
TailCallRuntimeIfStateEquals(masm, tiering_state,
|
|
||||||
TieringState::kRequestTurbofan_Synchronous,
|
|
||||||
Runtime::kCompileTurbofan_Synchronous);
|
|
||||||
TailCallRuntimeIfStateEquals(masm, tiering_state,
|
|
||||||
TieringState::kRequestTurbofan_Concurrent,
|
|
||||||
Runtime::kCompileTurbofan_Concurrent);
|
|
||||||
|
|
||||||
__ stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TailCallOptimizedCodeSlot(MacroAssembler* masm,
|
void TailCallOptimizedCodeSlot(MacroAssembler* masm,
|
||||||
Register optimized_code_entry,
|
Register optimized_code_entry,
|
||||||
Register scratch) {
|
Register scratch) {
|
||||||
@ -2143,13 +2109,11 @@ void MacroAssembler::MaybeOptimizeCodeOrTailCallOptimizedCodeSlot(
|
|||||||
r0);
|
r0);
|
||||||
beq(&maybe_has_optimized_code, cr0);
|
beq(&maybe_has_optimized_code, cr0);
|
||||||
|
|
||||||
Register tiering_state = optimization_state;
|
GenerateTailCallToReturnedCode(Runtime::kCompileOptimized);
|
||||||
DecodeField<FeedbackVector::TieringStateBits>(tiering_state);
|
|
||||||
MaybeOptimizeCode(this, feedback_vector, tiering_state);
|
|
||||||
|
|
||||||
bind(&maybe_has_optimized_code);
|
bind(&maybe_has_optimized_code);
|
||||||
Register optimized_code_entry = optimization_state;
|
Register optimized_code_entry = optimization_state;
|
||||||
LoadAnyTaggedField(tiering_state,
|
LoadAnyTaggedField(optimized_code_entry,
|
||||||
FieldMemOperand(feedback_vector,
|
FieldMemOperand(feedback_vector,
|
||||||
FeedbackVector::kMaybeOptimizedCodeOffset),
|
FeedbackVector::kMaybeOptimizedCodeOffset),
|
||||||
r0);
|
r0);
|
||||||
|
@ -1986,39 +1986,6 @@ void TurboAssembler::TryInlineTruncateDoubleToI(Register result,
|
|||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// Tail-call |function_id| if |actual_state| == |expected_state|
|
|
||||||
void TailCallRuntimeIfStateEquals(MacroAssembler* masm, Register actual_state,
|
|
||||||
TieringState expected_state,
|
|
||||||
Runtime::FunctionId function_id) {
|
|
||||||
Label no_match;
|
|
||||||
__ CmpS64(actual_state, Operand(static_cast<int>(expected_state)));
|
|
||||||
__ bne(&no_match);
|
|
||||||
__ GenerateTailCallToReturnedCode(function_id);
|
|
||||||
__ bind(&no_match);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MaybeOptimizeCode(MacroAssembler* masm, Register feedback_vector,
|
|
||||||
Register tiering_state) {
|
|
||||||
// ----------- S t a t e -------------
|
|
||||||
// -- r2 : actual argument count
|
|
||||||
// -- r5 : new target (preserved for callee if needed, and caller)
|
|
||||||
// -- r3 : target function (preserved for callee if needed, and caller)
|
|
||||||
// -- feedback vector (preserved for caller if needed)
|
|
||||||
// -- tiering_state : a int32 containing a non-zero optimization
|
|
||||||
// marker.
|
|
||||||
// -----------------------------------
|
|
||||||
DCHECK(!AreAliased(feedback_vector, r3, r5, tiering_state));
|
|
||||||
|
|
||||||
TailCallRuntimeIfStateEquals(masm, tiering_state,
|
|
||||||
TieringState::kRequestTurbofan_Synchronous,
|
|
||||||
Runtime::kCompileTurbofan_Synchronous);
|
|
||||||
TailCallRuntimeIfStateEquals(masm, tiering_state,
|
|
||||||
TieringState::kRequestTurbofan_Concurrent,
|
|
||||||
Runtime::kCompileTurbofan_Concurrent);
|
|
||||||
|
|
||||||
__ stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
void TailCallOptimizedCodeSlot(MacroAssembler* masm,
|
void TailCallOptimizedCodeSlot(MacroAssembler* masm,
|
||||||
Register optimized_code_entry,
|
Register optimized_code_entry,
|
||||||
Register scratch) {
|
Register scratch) {
|
||||||
@ -2144,14 +2111,12 @@ void MacroAssembler::MaybeOptimizeCodeOrTailCallOptimizedCodeSlot(
|
|||||||
r0);
|
r0);
|
||||||
beq(&maybe_has_optimized_code);
|
beq(&maybe_has_optimized_code);
|
||||||
|
|
||||||
Register tiering_state = optimization_state;
|
GenerateTailCallToReturnedCode(Runtime::kCompileOptimized);
|
||||||
DecodeField<FeedbackVector::TieringStateBits>(tiering_state);
|
|
||||||
MaybeOptimizeCode(this, feedback_vector, tiering_state);
|
|
||||||
|
|
||||||
bind(&maybe_has_optimized_code);
|
bind(&maybe_has_optimized_code);
|
||||||
Register optimized_code_entry = optimization_state;
|
Register optimized_code_entry = optimization_state;
|
||||||
LoadAnyTaggedField(
|
LoadAnyTaggedField(
|
||||||
tiering_state,
|
optimized_code_entry,
|
||||||
FieldMemOperand(feedback_vector,
|
FieldMemOperand(feedback_vector,
|
||||||
FeedbackVector::kMaybeOptimizedCodeOffset));
|
FeedbackVector::kMaybeOptimizedCodeOffset));
|
||||||
TailCallOptimizedCodeSlot(this, optimized_code_entry, r8);
|
TailCallOptimizedCodeSlot(this, optimized_code_entry, r8);
|
||||||
|
Loading…
Reference in New Issue
Block a user