RFR: 8316958: Add test for unstructured locking

Roman Kennke rkennke at openjdk.org
Wed Sep 27 12:31:14 UTC 2023


On Tue, 26 Sep 2023 21:28:17 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> In my original lightweight-locking PR, I had a testcase that exercises unstructured locking, which is permitted by the JVM spec, but not generated by javac, and thus not executed anywhere. JITs don't compile unstructured-locked code, therefore any code which attempts this would be slow anyway.
>> 
>> Testing:
>>  - [x] runtime/locking
>
> test/hotspot/jtreg/runtime/locking/TestUnstructuredLocking.jasm line 50:
> 
>> 48:         monitorexit;
>> 49:         aload_2;
>> 50:         invokevirtual Method java/lang/Object.notify:"()V";
> 
> Curious why this is needed.

I don't think it is needed. It's probably a left-over from an experiment that I did, maybe to avoid this whole method to be optimized-away (but that shouldn't matter, because it's not JIT-compiled anyway) or more likely to see how this interacts with inflation. In any case, I'll remove it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15925#discussion_r1338528779


More information about the hotspot-runtime-dev mailing list