RFR: 8206144: [lworld] Adapt and add C2 intrinsics for value types Unsafe API

Roland Westrelin rwestrel at redhat.com
Mon Jan 21 13:32:39 UTC 2019

Hi Tobias,

Thanks for looking at this.

> I've quickly submitted some testing for this before going on vacation (haven't reviewed it yet) and
> now had a look at the results. Many tests fail with:
> #  assert(bt == alias_type->basic_type() || bt == T_VALUETYPE) failed: should match

Updated webrev should fix it:


I also tweaked the code. The first patch wouldn't set the mark work to
larval state. The new one does. But that caused new issues: escape
analysis doesn't like the loads/stores to the mark work because it's at
offset 0 and there's no AddP. I also had to tweak the code so the
allocation of a non escaping larval buffer can be eliminated.

> Caused by: java.lang.RuntimeException: assertEquals: expected 0 to equal 768
> 	at jdk.test.lib.Asserts.fail(Asserts.java:594)
> 	at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
> 	at jdk.test.lib.Asserts.assertEquals(Asserts.java:189)
> 	at jdk.test.lib.Asserts.assertEQ(Asserts.java:166)
> 	at compiler.valhalla.valuetypes.TestIntrinsics.test29_verifier(TestIntrinsics.java:508)
> 	... 6 more

That one is an upstream bug: 8216549: "Mismatched unsafe access to non
escaping object fails". I propose we cherry pick it.


More information about the valhalla-dev mailing list