[lworld] RFR: 8370509: [lworld] EnableValhalla is not needed for sync

Paul Hübner phubner at openjdk.org
Fri Oct 24 11:57:31 UTC 2025


On Thu, 23 Oct 2025 20:30:17 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> I took out EnableValhalla as a conditional test in the ObjectSynchronizer code.  If the inline type bit is set in the markWord or the klass is InlineKlass, we can't synchronize on the object.
> I added a test but it was sort of a duplicate of all runtime/valhalla/inlinetypes/MonitorEnterTest.java and duplicates all tests that do locking so I didn't add a test.
> Testing with tier1-4, still in progress.

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 7939:

> 7937:   orr(mark, mark, markWord::unlocked_value);
> 7938:   // Mask inline_type bit such that we go to the slow path if object is an inline type
> 7939:   andr(mark, mark, ~((int) markWord::inline_type_bit_in_place));

Since `EnableValhalla=true` by default, we were already exercising this path by default. 

Can we get into a situation where we do not use the object monitor table and the markword is inflated while we perform this check? We would get in trouble with this bit check if we can.

src/hotspot/share/runtime/synchronizer.cpp line 687:

> 685: intptr_t ObjectSynchronizer::FastHashCode(Thread* current, oop obj) {
> 686:   // VM should be calling bootstrap method
> 687:   assert(!obj->klass()->is_inline_klass(), "should not reach here");

Nitpick: more descriptive message.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1699#discussion_r2460025047
PR Review Comment: https://git.openjdk.org/valhalla/pull/1699#discussion_r2460036561


More information about the valhalla-dev mailing list