RFR: 8355034: [JVMCI] assert(static_cast<int>(_jvmci_data_size) == align_up(compiler->is_jvmci() ? jvmci_data->size() : 0, oopSize)) failed: failed: 104 != 16777320

Doug Simon dnsimon at openjdk.org
Fri Apr 18 15:26:41 UTC 2025


On Fri, 18 Apr 2025 13:27:02 GMT, Doug Simon <dnsimon at openjdk.org> wrote:

> After [JDK-8343789](https://bugs.openjdk.org/browse/JDK-8343789), the size of a `JVMCINMethodData` object is limited to `uint16_t`. That object embeds the value of `InstalledCode.name` so effectively imposes a limit on the name length. This PR establishes a lower limit on the name value as this name should only be for informative purposes when inspecting compiled code.
> 
> While debugging the problem that exposed the limit, it was confusing that `-XX:+PrintCompilation` did not show the name so this PR builds on [JDK-8336760](https://bugs.openjdk.org/browse/JDK-8336760) to add the name in `PrintCompilation` output for JVMCI "hosted" methods.

src/hotspot/share/code/nmethod.cpp line 115:

> 113: #define CHECKED_CAST(result, T, thing)      \
> 114:   result = static_cast<T>(thing); \
> 115:   guarantee(static_cast<int>(result) == thing, "failed: %d != %d", static_cast<int>(result), thing);

This check is not is a hot path and so afford to be a guarantee. That said, I've no strong objection to leaving it as an assert.

src/hotspot/share/jvmci/jvmciCodeInstaller.cpp line 831:

> 829:             stringStream st;
> 830:             st.print_cr("(hosted JVMCI compilation: %s)", name);
> 831:             CompileTask::print(tty, nm, st.as_string());

@JohnTortugo this may be of interest to you.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24753#discussion_r2050763430
PR Review Comment: https://git.openjdk.org/jdk/pull/24753#discussion_r2050766285


More information about the graal-dev mailing list