[lworld] RFR: 8281283: Remove usages of __WithField in runtime tests

Dan Smith dlsmith at openjdk.java.net
Thu Feb 17 19:13:41 UTC 2022


On Thu, 17 Feb 2022 00:56:50 GMT, Dan Smith <dlsmith at openjdk.org> wrote:

> Modifying Valhalla runtime tests to no longer use `__WithField` as a macro for the `withfield` instruction. Most uses can be replaced with standard constructor compilation via javac. The remaining uses are rewritten in jasm.
> 
> Summary of changes:
> 
> - Remove all uses of `-XDallowWithFieldOperator`
> - Replace various `make` and `create` factory methods for primitive classes with constructors
> - Bug fixes for `JumboInline` that were exposed by this change
> - Rewrote `TestFieldNullability` to use jasm
> - Rewrote `VWithFieldTest` to use jasm, renamed `WithFieldTest`
> - Rewrote `WithFieldAccessorTest` to use jasm, made more comprehensive
> - Deleted `WithFieldNoAccessTest`, made redundant by `WithFieldAccessorTest` changes
> - Minor tweaks to `TestFieldTypeMismatch` for consistent jasm usage
> - Cleanup of some debugging output in `asmtools.JtregDriver`

test/hotspot/jtreg/runtime/valhalla/inlinetypes/JumboInline.java line 79:

> 77:         j = __WithField(j.l1, l1);
> 78:         j = __WithField(j.l2, l0 + l1);
> 79:         j = __WithField(j.l3, l1 + l2);

Bug here (and the following lines): `l2` refers to `this.l2`, not `j.l2`—if `this` is `JumboInline.default`, that value is 0, not `l0+l1`.

test/hotspot/jtreg/runtime/valhalla/inlinetypes/JumboInline.java line 113:

> 111:             return (l0 == j.l0 && l1 == j.l1 && l2 == j.l2 && l3 == j.l3
> 112:                     && l4 == j.l4 && l5 == j.l5 && l6 == j.l6 && l7 == j.l7
> 113:                     && l8 == j.l8 && l9 == j.l9 && l10 == j.l10 && l7 == j.l10

`l7 == j.l10`? Happens to work, because these are always 0, per the above bug.

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

PR: https://git.openjdk.java.net/valhalla/pull/653



More information about the valhalla-dev mailing list