[lworld] RFR: 8332387: [lworld] monitorenter on value class instances must throw IdentityException instead of IllegalMonitorStateException
Frederic Parain
fparain at openjdk.org
Thu May 23 17:24:15 UTC 2024
On Thu, 23 May 2024 13:42:33 GMT, Dan Heidinga <heidinga 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
>
> 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.
When creating a LIR_OpLock for lir_unlock (in LIR_List::unlock_object(), c1_LIR.cpp:1576), no stub is provided so _throw_ie_stub is null. And do_stub() does nothing if the pointer passed in argument is null.
Did I miss something?
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1108#discussion_r1612064611
More information about the valhalla-dev
mailing list