Skip to content

Commit 19cb44f

Browse files
authored
Merge pull request #22545 from BradleyWood/itable_jmp
x86: Fix interface dispatch performance
2 parents 083efbb + dfb7e76 commit 19cb44f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

runtime/compiler/x/codegen/X86PrivateLinkage.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3028,14 +3028,10 @@ void J9::X86::PrivateLinkage::buildInterfaceDispatchUsingLastITable (TR::X86Call
30283028
og.endOutlinedInstructionSequence();
30293029

30303030
//----------------------------------------------
3031-
// Typically a JNE to lookupDispatchSnippetLabel is required because of implementation details of routines in
3032-
// X86PicBuilder, such as resolveIPicClass, which expect a JNE before the done label must jmp to the lookup
3033-
// routine. Since we already have JNE to the outlined sequence where we check multiple entries before executing
3034-
// the slow path, we now need a JMP instruction to lookup routine. We add a one-byte nop to compensate for the
3035-
// smaller instruction.
3031+
// This extra JNE to lookupDispatchSnippetLabel is required because routines in X86PicBuilder,
3032+
// such as resolveIPicClass, expects the last JNE before the done label must jmp to the look up routine.
30363033
//
3037-
generatePaddingInstruction(1, callNode, cg());
3038-
generateLongLabelInstruction(TR::InstOpCode::JMP4, callNode, lookupDispatchSnippetLabel, cg()); // PICBuilder needs this to have a 4-byte offset
3034+
generateLongLabelInstruction(TR::InstOpCode::JNE4, callNode, lookupDispatchSnippetLabel, cg()); // PICBuilder needs this to have a 4-byte offset
30393035

30403036
generateLabelInstruction(TR::InstOpCode::label, callNode, gotoLastITableDispatchLabel, cg());
30413037
if (comp()->target().is32Bit())

0 commit comments

Comments
 (0)