RFR: 8338007: [JVMCI] ResolvedJavaMethod.reprofile can crash ciMethodData

Vladimir Kozlov kvn at openjdk.org
Tue Oct 29 17:14:06 UTC 2024


On Mon, 28 Oct 2024 19:13:28 GMT, Tom Rodriguez <never at openjdk.org> wrote:

> Graal unit testing uses ResolvedJavaMethod.reprofile to reset profiles between test but the current code rewrites the layout in a non-atomic way which can break other readers.  Instead perform the reinitialization at a safepoint which should protect all readers from seeing any transient initialization states.

Looks fine, just one question.

src/hotspot/share/oops/methodData.cpp line 66:

> 64:   temp._header._struct._tag = tag;
> 65:   temp._header._struct._bci = bci;
> 66:   _header = temp._header;  // Write the cell atomtically

Should we use `Atomic::store()` here?

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

PR Review: https://git.openjdk.org/jdk/pull/21746#pullrequestreview-2402593637
PR Review Comment: https://git.openjdk.org/jdk/pull/21746#discussion_r1821230658


More information about the hotspot-dev mailing list