For example:
java.lang.RuntimeException: Inconsistent field values: expected 0 to equal 675128
at jdk.test.lib.Asserts.fail(Asserts.java:594)
at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
at jdk.test.lib.Asserts.assertEQ(Asserts.java:178)
at compiler.valhalla.inlinetypes.MyValue.incrementAndCheck(TestBufferTearing.java:81)
at compiler.valhalla.inlinetypes.TestBufferTearing$Runner.run(TestBufferTearing.java:124)
java.lang.RuntimeException: Inconsistent field values: expected 0 to equal 555238
at jdk.test.lib.Asserts.fail(Asserts.java:594)
at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
at jdk.test.lib.Asserts.assertEQ(Asserts.java:178)
at compiler.valhalla.inlinetypes.MyValue.incrementAndCheck(TestBufferTearing.java:81)
at compiler.valhalla.inlinetypes.TestBufferTearing$Runner.run(TestBufferTearing.java:125)
I think the fix is to add a store-store barrier after the initialising stores in GraphBuilder::withfield(), so that those stores cannot be reordered with any store that publishes the object to another thread.
java.lang.RuntimeException: Inconsistent field values: expected 0 to equal 675128
at jdk.test.lib.Asserts.fail(Asserts.java:594)
at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
at jdk.test.lib.Asserts.assertEQ(Asserts.java:178)
at compiler.valhalla.inlinetypes.MyValue.incrementAndCheck(TestBufferTearing.java:81)
at compiler.valhalla.inlinetypes.TestBufferTearing$Runner.run(TestBufferTearing.java:124)
java.lang.RuntimeException: Inconsistent field values: expected 0 to equal 555238
at jdk.test.lib.Asserts.fail(Asserts.java:594)
at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
at jdk.test.lib.Asserts.assertEQ(Asserts.java:178)
at compiler.valhalla.inlinetypes.MyValue.incrementAndCheck(TestBufferTearing.java:81)
at compiler.valhalla.inlinetypes.TestBufferTearing$Runner.run(TestBufferTearing.java:125)
I think the fix is to add a store-store barrier after the initialising stores in GraphBuilder::withfield(), so that those stores cannot be reordered with any store that publishes the object to another thread.
- relates to
-
JDK-8271280 [lworld] Revisit memory barrier requirements around inline type allocations
- Open