Skip to content

Commit b52af18

Browse files
Srinivas Vamsi ParasaSandhya Viswanathan
authored andcommitted
8359386: Fix incorrect value for max_size of C2CodeStub when APX is used
Reviewed-by: thartmann, shade, jbhateja, sviswanathan
1 parent 7bc0d82 commit b52af18

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4655,6 +4655,7 @@ static void convertF2I_slowpath(C2_MacroAssembler& masm, C2GeneralStub<Register,
46554655
__ subptr(rsp, 8);
46564656
__ movdbl(Address(rsp), src);
46574657
__ call(RuntimeAddress(target));
4658+
// APX REX2 encoding for pop(dst) increases the stub size by 1 byte.
46584659
__ pop(dst);
46594660
__ jmp(stub.continuation());
46604661
#undef __
@@ -4687,7 +4688,9 @@ void C2_MacroAssembler::convertF2I(BasicType dst_bt, BasicType src_bt, Register
46874688
}
46884689
}
46894690

4690-
auto stub = C2CodeStub::make<Register, XMMRegister, address>(dst, src, slowpath_target, 23, convertF2I_slowpath);
4691+
// Using the APX extended general purpose registers increases the instruction encoding size by 1 byte.
4692+
int max_size = 23 + (UseAPX ? 1 : 0);
4693+
auto stub = C2CodeStub::make<Register, XMMRegister, address>(dst, src, slowpath_target, max_size, convertF2I_slowpath);
46914694
jcc(Assembler::equal, stub->entry());
46924695
bind(stub->continuation());
46934696
}

0 commit comments

Comments
 (0)