[lworld] RFR: 8332387: [lworld] monitorenter on value class instances must throw IdentityException instead of IllegalMonitorStateException

Dan Heidinga heidinga at openjdk.org
Thu May 23 13:49:16 UTC 2024


On Wed, 22 May 2024 19:58:01 GMT, Frederic Parain <fparain at openjdk.org> wrote:

> Change the exception thrown by monitorenter when attempted on an instance of a value class.
> Monitorexit is not changed according to some discussions about the JVMS changes (it still throws IllegalMonitorStateException).
> 
> Tested with Mach5, tier1-3.
> 
> Fred

Looks straightforward and correct by pattern match =) apart from a minor question

src/hotspot/share/c1/c1_LIR.cpp line 841:

> 839: 
> 840:       do_stub(opLock->_stub);
> 841:       do_stub(opLock->_throw_ie_stub);

Does `_throw_ie_stub` apply to both `lir_lock` & 'lir_unlock`?  I thought only `monitorenter` was being changed.

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

PR Review: https://git.openjdk.org/valhalla/pull/1108#pullrequestreview-2074020257
PR Review Comment: https://git.openjdk.org/valhalla/pull/1108#discussion_r1611724324



More information about the valhalla-dev mailing list