[lworld] RFR: 8275195: [lworld] Revisit use of TypePtr::meet_aryptr() after merge

Tobias Hartmann thartmann at openjdk.java.net
Wed Oct 13 13:12:02 UTC 2021


On Wed, 13 Oct 2021 07:30:38 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> Actually, shouldn't the element type be non exact in the TypeAryPtr case too?

Yes, I think so.

Just noticed this code you added previously in `TypeAryKlassPtr::make`:

    // An object array can't be flat or null-free if the klass is exact
    not_flat = true;
    if (!null_free) {
      not_null_free = true;
    }


How can it happen that `null_free` is true?

src/hotspot/share/opto/type.cpp line 5948:

> 5946:     const TypeKlassPtr *etype = TypeKlassPtr::make(eklass)->cast_to_exactness(false);
> 5947: 
> 5948:     if (etype->klass_is_exact() && etype->isa_instklassptr() && etype->is_instklassptr()->klass()->is_inlinetype() && !null_free) {

Please add a comment similar to the other places where we do this.

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

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



More information about the valhalla-dev mailing list