RFR(S): 8207242: [lworld] TestLWorld fails with "assert(_base >= AnyPtr && _base <= KlassPtr) failed: Not a pointer"

Tobias Hartmann tobias.hartmann at oracle.com
Thu Jul 19 08:58:40 UTC 2018


Hi,

please review the following patch:
https://bugs.openjdk.java.net/browse/JDK-8207242
http://cr.openjdk.java.net/~thartmann/8207242/webrev.00/

We crash in ValueTypeBaseNode::is_allocated() because the oop input is TOP. The problem is that we
are using a ValueTypeNode from a non-dominating path which died (but since we are not dominated, the
ValueTypeNode was not removed).

Details: In ValueTypeBaseNode::allocate(), if the value type is not yet allocated, we allocate a new
buffer, store the field values and then replace the ValueTypeNode in the map by a clone that has the
oop input set. However, storing the field values can call allocate() recursively to allocate new
buffers for non-flattened value type fields. That code will also replace the ValueTypeNode for these
fields in the map which is not correct because the allocation is only performed in the allocating
branch of the parent allocate() call.

We should save/restore the JVMState in ValueTypeBaseNode::allocate(). I've also added a test that
triggers this deterministically (the bug was otherwise only reproducible with some -Xcomp runs).

During testing, I've found another problem in ValueTypeNode::Ideal() where we fail with
"assert(igvn->type(val)->is_zero_type()) failed: must be zero-type store". The assert is too strong
because we can also have initializing stores that are not zero but the default value type oop.

All tests pass.

Thanks,
Tobias


More information about the valhalla-dev mailing list