Commit b2411f93 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

PPC/s390: [builtins] Tweak optimized check in InterpreterEntryTrampoline

Port 7177d87f

Original Commit Message:

    Reorders the Smi check and the empty OptimizationMarker check as the
    latter implies the first and means there is now just a single comparison
    on the fast path.

R=delphick@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I4129e8d710d25fb1df02742816ab3b56430a7523
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1841611Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#64113}
parent a6b0756d
......@@ -1079,24 +1079,17 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ cmpi(r7, Operand(FEEDBACK_VECTOR_TYPE));
__ bne(&push_stack_frame);
Label has_optimization_marker;
Label maybe_has_optimized_code;
Register optimized_code_entry = r7;
// Read off the optimized code slot in the feedback vector.
__ LoadP(optimized_code_entry,
FieldMemOperand(feedback_vector,
FeedbackVector::kOptimizedCodeWeakOrSmiOffset));
// If not a Smi, then it must be a weak reference to the optimized code.
__ JumpIfNotSmi(optimized_code_entry, &maybe_has_optimized_code);
// Check if there is an optimization marker, if so carry onto the the
// MaybeOptimizeCode path.
// Check if the optimized code slot is not empty.
Label optimized_code_slot_not_empty;
__ CmpSmiLiteral(optimized_code_entry,
Smi::FromEnum(OptimizationMarker::kNone), r0);
__ bne(&has_optimization_marker);
__ bne(&optimized_code_slot_not_empty);
Label not_optimized;
__ bind(&not_optimized);
......@@ -1222,7 +1215,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
LeaveInterpreterFrame(masm, r5);
__ blr();
__ bind(&has_optimization_marker);
__ bind(&optimized_code_slot_not_empty);
Label maybe_has_optimized_code;
// Check if optimized code marker is actually a weak reference to the
// optimized code.
__ JumpIfNotSmi(optimized_code_entry, &maybe_has_optimized_code);
MaybeOptimizeCode(masm, feedback_vector, optimized_code_entry);
// Fall through if there's no runnable optimized code.
__ jmp(&not_optimized);
......
......@@ -1138,9 +1138,6 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ CmpP(r6, Operand(FEEDBACK_VECTOR_TYPE));
__ bne(&push_stack_frame);
Label has_optimization_marker;
Label maybe_has_optimized_code;
Register optimized_code_entry = r6;
// Read off the optimized code slot in the feedback vector.
......@@ -1148,14 +1145,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
FieldMemOperand(feedback_vector,
FeedbackVector::kOptimizedCodeWeakOrSmiOffset));
// If not a Smi, then it must be a weak reference to the optimized code.
__ JumpIfNotSmi(optimized_code_entry, &maybe_has_optimized_code);
// Check if there is an optimization marker, if so carry onto the the
// MaybeOptimizeCode path.
// Check if the optimized code slot is not empty.
Label optimized_code_slot_not_empty;
__ CmpSmiLiteral(optimized_code_entry,
Smi::FromEnum(OptimizationMarker::kNone), r0);
__ bne(&has_optimization_marker);
__ bne(&optimized_code_slot_not_empty);
Label not_optimized;
__ bind(&not_optimized);
......@@ -1276,7 +1270,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
LeaveInterpreterFrame(masm, r4);
__ Ret();
__ bind(&has_optimization_marker);
__ bind(&optimized_code_slot_not_empty);
Label maybe_has_optimized_code;
// Check if optimized code marker is actually a weak reference to the
// optimized code.
__ JumpIfNotSmi(optimized_code_entry, &maybe_has_optimized_code);
MaybeOptimizeCode(masm, feedback_vector, optimized_code_entry);
// Fall through if there's no runnable optimized code.
__ jmp(&not_optimized);
......
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