[lworld] RFR: 8315745: [lworld] "Meet Not Symmetric" failures

Tobias Hartmann thartmann at openjdk.org
Tue Oct 31 18:18:13 UTC 2023


The following two independent issues showed up with stress testing.


=== Meet Not Symmetric ===
t   =                   not flat:not null free:narrowoop: java/lang/Object:BotPTR *[int:0..max-2] (java/lang/Cloneable,java/io/Serializable):NotNull:exact *
this=                   flat:not flat:not null free:top[int:0..max-2] (java/lang/Cloneable,java/io/Serializable):AnyNull:flat(+bot):null_free *,iid=top (inline_depth=1)
mt=(t meet this)=       not flat:not null free:narrowoop: java/lang/Object:BotPTR *[int:0..max-2] (java/lang/Cloneable,java/io/Serializable):NotNull:exact *
t_dual=                 stable:flat:narrowoop: java/lang/Object:TopPTR *,iid=top (inline_depth=InlineDepthTop)[int:max-2..0] (java/lang/Cloneable,java/io/Serializable):AnyNull:exact:flat(+top):null_free *,iid=top (inline_depth=InlineDepthTop)
this_dual=              stable:bottom[int:max-2..0] (java/lang/Cloneable,java/io/Serializable):NotNull * (inline_depth=-1)
mt_dual=                stable:flat:narrowoop: java/lang/Object:TopPTR *,iid=top (inline_depth=InlineDepthTop)[int:max-2..0] (java/lang/Cloneable,java/io/Serializable):AnyNull:exact:flat(+top):null_free *,iid=top (inline_depth=InlineDepthTop)
mt_dual meet t_dual=    stable:flat:narrowoop: java/lang/Object:TopPTR *,iid=top (inline_depth=InlineDepthTop)[int:max-2..0] (java/lang/Cloneable,java/io/Serializable):AnyNull:exact:flat(+top):null_free *,iid=top (inline_depth=InlineDepthTop)
mt_dual meet this_dual= stable:bottom[int:max-2..0] (java/lang/Cloneable,java/io/Serializable):NotNull * (inline_depth=-1)


The problem is that `mt_dual meet this_dual != this_dual` with `mt_dual->_field_offset == TOP` and `this_dual->_field_offset == TOP` because the `_field_offset` of the result is `BOTTOM`. The fix is to adjust the code in `TypeAryPtr::xmeet_helper` to not set the field offset from `TOP` to `BOTTOM`.


=== Meet Not Symmetric ===
t   =                   stable:flat:not null free:narrowoop: java/lang/Object:TopPTR *,iid=top (inline_depth=InlineDepthTop)[int:max..0] (java/lang/Cloneable,java/io/Serializable):AnyNull:flat(+top):null_free *,iid=top (inline_depth=InlineDepthTop) (speculative=stable:flat:not null free:narrowoop: java/lang/Object:TopPTR *,iid=top (inline_depth=InlineDepthTop)[int:max..0] (java/lang/Cloneable,java/io/Serializable):AnyNull:flat(+top):null_free *,iid=top (inline_depth=InlineDepthTop))
this=                   stable:flat:not flat:not null free:narrowoop: java/lang/Object:TopPTR *,iid=top (inline_depth=InlineDepthTop)[int:max..0] (java/lang/Cloneable,java/io/Serializable):AnyNull:flat(+top):null_free *,iid=top (inline_depth=InlineDepthTop) (speculative=stable:flat:not null free:narrowoop: java/lang/Object:TopPTR *,iid=top (inline_depth=InlineDepthTop)[int:max..0] (java/lang/Cloneable,java/io/Serializable):AnyNull:flat(+top):null_free *,iid=top (inline_depth=InlineDepthTop))
mt=(t meet this)=       stable:flat:not null free:narrowoop: java/lang/Object:TopPTR *,iid=top (inline_depth=InlineDepthTop)[int:max..0] (java/lang/Cloneable,java/io/Serializable):AnyNull:flat(+top):null_free *,iid=top (inline_depth=InlineDepthTop)
t_dual=                 not flat:narrowoop: java/lang/Object:BotPTR *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull * (speculative=not flat:narrowoop: java/lang/Object:BotPTR *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull *)
this_dual=              narrowoop: java/lang/Object:BotPTR *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull * (speculative=not flat:narrowoop: java/lang/Object:BotPTR *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull *)
mt_dual=                not flat:narrowoop: java/lang/Object:BotPTR *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull *
mt_dual meet t_dual=    not flat:narrowoop: java/lang/Object:BotPTR *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull *
mt_dual meet this_dual= narrowoop: java/lang/Object:BotPTR *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull * (speculative=not flat:narrowoop: java/lang/Object:BotPTR *[int:>=0] (java/lang/Cloneable,java/io/Serializable):NotNull *)


The problem is that `mt_dual meet t_dual != this_dual` because the speculative type is lost. The problem is already that for `t` the speculative type is equivalent to the non-speculative type. Since we keep the speculative part if it contains information about flat-/nullability (see [JDK-8222221](https://bugs.openjdk.org/browse/JDK-8222221)), we need to make sure it's removed if it's not better than the non-speculative type anymore and this check was missing in `TypeAryPtr::cast_to_not_flat`.

Best regards,
Tobias

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

Commit messages:
 - 8315745: [lworld] "Meet Not Symmetric" failures

Changes: https://git.openjdk.org/valhalla/pull/943/files
 Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=943&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8315745
  Stats: 14 lines in 1 file changed: 8 ins; 1 del; 5 mod
  Patch: https://git.openjdk.org/valhalla/pull/943.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/943/head:pull/943

PR: https://git.openjdk.org/valhalla/pull/943



More information about the valhalla-dev mailing list