diff --git a/src/codegen/ppc/macro-assembler-ppc.cc b/src/codegen/ppc/macro-assembler-ppc.cc index 2a7ca1aba9..a198747cd7 100644 --- a/src/codegen/ppc/macro-assembler-ppc.cc +++ b/src/codegen/ppc/macro-assembler-ppc.cc @@ -1982,40 +1982,6 @@ void TurboAssembler::TryInlineTruncateDoubleToI(Register result, 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(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, Register optimized_code_entry, Register scratch) { @@ -2143,13 +2109,11 @@ void MacroAssembler::MaybeOptimizeCodeOrTailCallOptimizedCodeSlot( r0); beq(&maybe_has_optimized_code, cr0); - Register tiering_state = optimization_state; - DecodeField(tiering_state); - MaybeOptimizeCode(this, feedback_vector, tiering_state); + GenerateTailCallToReturnedCode(Runtime::kCompileOptimized); bind(&maybe_has_optimized_code); Register optimized_code_entry = optimization_state; - LoadAnyTaggedField(tiering_state, + LoadAnyTaggedField(optimized_code_entry, FieldMemOperand(feedback_vector, FeedbackVector::kMaybeOptimizedCodeOffset), r0); diff --git a/src/codegen/s390/macro-assembler-s390.cc b/src/codegen/s390/macro-assembler-s390.cc index dc45e6f976..cc5eed48de 100644 --- a/src/codegen/s390/macro-assembler-s390.cc +++ b/src/codegen/s390/macro-assembler-s390.cc @@ -1986,39 +1986,6 @@ void TurboAssembler::TryInlineTruncateDoubleToI(Register result, 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(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, Register optimized_code_entry, Register scratch) { @@ -2144,14 +2111,12 @@ void MacroAssembler::MaybeOptimizeCodeOrTailCallOptimizedCodeSlot( r0); beq(&maybe_has_optimized_code); - Register tiering_state = optimization_state; - DecodeField(tiering_state); - MaybeOptimizeCode(this, feedback_vector, tiering_state); + GenerateTailCallToReturnedCode(Runtime::kCompileOptimized); bind(&maybe_has_optimized_code); Register optimized_code_entry = optimization_state; LoadAnyTaggedField( - tiering_state, + optimized_code_entry, FieldMemOperand(feedback_vector, FeedbackVector::kMaybeOptimizedCodeOffset)); TailCallOptimizedCodeSlot(this, optimized_code_entry, r8);