diff --git a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp index 177be6e59f74a..4317bb3d01825 100644 --- a/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp @@ -4655,6 +4655,7 @@ static void convertF2I_slowpath(C2_MacroAssembler& masm, C2GeneralStub(dst, src, slowpath_target, 23, convertF2I_slowpath); + // Using the APX extended general purpose registers increases the instruction encoding size by 1 byte. + int max_size = 23 + (UseAPX ? 1 : 0); + auto stub = C2CodeStub::make(dst, src, slowpath_target, max_size, convertF2I_slowpath); jcc(Assembler::equal, stub->entry()); bind(stub->continuation()); }