-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b110
Mismatched access detection is too coarse, e.g. Unsafe.getBoolean() from boolean[] instance is considered mismatched.
http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/file/tip/src/share/vm/opto/library_call.cpp#l2532:
bool mismatched = false;
if (alias_type->element() != NULL || alias_type->field() != NULL) {
BasicType bt;
if (alias_type->element() != NULL) {
const Type* element = alias_type->element();
bt = element->isa_narrowoop() ? T_OBJECT : element->array_element_basic_type();
} else {
bt = alias_type->field()->type()->basic_type();
}
if (bt == T_ARRAY) {
// accessing an array field with getObject is not a mismatch
bt = T_OBJECT;
}
if (bt != type) {
mismatched = true;
}
}
$ p alias_type->_adr_type
byte[int:>=0]:exact+any *
$ adr_type->dump()
stable:bool[int:2]<ciTypeArray length=2 type=<ciTypeArrayKlass name=[Z ident=1036 address=0x0000000105037750> ident=1051 SCAVENGABLE address=0x00000001009dd030>[0] *
http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/file/tip/src/share/vm/opto/library_call.cpp#l2532:
bool mismatched = false;
if (alias_type->element() != NULL || alias_type->field() != NULL) {
BasicType bt;
if (alias_type->element() != NULL) {
const Type* element = alias_type->element();
bt = element->isa_narrowoop() ? T_OBJECT : element->array_element_basic_type();
} else {
bt = alias_type->field()->type()->basic_type();
}
if (bt == T_ARRAY) {
// accessing an array field with getObject is not a mismatch
bt = T_OBJECT;
}
if (bt != type) {
mismatched = true;
}
}
$ p alias_type->_adr_type
byte[int:>=0]:exact+any *
$ adr_type->dump()
stable:bool[int:2]<ciTypeArray length=2 type=<ciTypeArrayKlass name=[Z ident=1036 address=0x0000000105037750> ident=1051 SCAVENGABLE address=0x00000001009dd030>[0] *
- duplicates
-
JDK-8150817 Many @Stable related test failures after JDK-8150186 was pushed
-
- Closed
-
- relates to
-
JDK-8150933 System::arraycopy intrinsic doesn't mark mismatched loads
-
- Resolved
-
-
JDK-8151020 [TESTBUG] UnsafeGetStableArrayElement::testL_* fail intermittently
-
- Resolved
-