RFR 8220269 [lworld] C1 should return default value for uninitialized non-static Q fields
Ioi Lam
ioi.lam at oracle.com
Thu Mar 7 05:32:51 UTC 2019
https://bugs.openjdk.java.net/browse/JDK-8220269
http://cr.openjdk.java.net/~iklam/valhalla/8220269-getfield-uninited-jumbo-qfield.v01/
For the following bytecode
getfield Holder.f:"QJumboValue"
If the field is too big to be flattened (e.g., ciField::is_flattened()
returns false), we should load the field as an oop, test for null, and
replace with JumboValue.default.
---
I also refactored the handling of unloaded classes by getfield/getstatic
into a new function LIRGenerator::non_nullable_load_field_prolog(). I
needed to
add a new method:
bool ciField::is_never_null() const {
// Cannot use (type()->basic_type() == T_VALUETYPE) -- if the class is
// not loaded, type() is an unloaded ciInstanceKlass!
return signature()->char_at(0) == 'Q';
}
I think putfield also need to be fixed, because it currently rely on
ciField::type(), which essentially changes "Q" to "L" for unloaded value
classes.
But I will do that in a separate JBS issue.
Thanks
- Ioi
More information about the valhalla-dev
mailing list