RFR: 8359386: Fix incorrect value for max_size of C2CodeStub when APX is used [v3]
Srinivas Vamsi Parasa
sparasa at openjdk.org
Tue Jun 17 04:07:14 UTC 2025
> The goal of this PR is to fix the value of max_size of the C2CodeStub hardcoded in the C2_MacroAssembler::convertF2I() function when Intel APX instrucitons are used. Currently, max_size is hardcoded to 23 (introduced in [JDK-8306706](https://bugs.openjdk.org/browse/JDK-8306706)) . However, this value is incorrect when Intel APX instructions with extended general-purpose registers (EGPRs) are used in the code stub as using EGPRs with APX instructions leads to an increase in the instruction encoding size by additional 1 byte.
>
> Without this fix, we see the following error for the C2 compiler tests below:
>
> compiler/vectorization/runner/ArrayTypeConvertTest.java
> compiler/intrinsics/zip/TestFpRegsABI.java
>
>
>
>
> # A fatal error has been detected by the Java Runtime Environment:
> #
> # Internal Error (/src/hotspot/share/opto/c2_CodeStubs.cpp:50), pid=3961123, tid=3961332
> # assert(max_size >= actual_size) failed: Expected stub size (23) must be larger than or equal to actual stub size (24)
> #
> # JRE version: OpenJDK Runtime Environment (26.0) (fastdebug build 26-internal-adhoc.parasa.jdkdemotion)
> # Java VM: OpenJDK 64-Bit Server VM (fastdebug 26-internal-adhoc.parasa.jdkdemotion, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
> # Problematic frame:
> # V [libjvm.so+0x955a77] C2CodeStubList::emit(C2_MacroAssembler&)+0x227
> #
>
>
> This PR fixes the errors in the above-mentioned tests.
Srinivas Vamsi Parasa has updated the pull request incrementally with one additional commit since the last revision:
Fix the change in the stub size by 1 byte
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/25787/files
- new: https://git.openjdk.org/jdk/pull/25787/files/37dede6e..4fe56be6
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=25787&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=25787&range=01-02
Stats: 3 lines in 1 file changed: 1 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/25787.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25787/head:pull/25787
PR: https://git.openjdk.org/jdk/pull/25787
More information about the hotspot-compiler-dev
mailing list