< prev index next >
src/hotspot/share/opto/memnode.cpp
Print this page
rev 52427 : 8213371: GC/C2 abstraction and cleanup to handle custom offset for GC memory accesses
*** 1695,1705 ****
// Different array types begin at slightly different offsets (12 vs. 16).
// We choose T_BYTE as an example base type that is least restrictive
// as to alignment, which will therefore produce the smallest
// possible base offset.
const int min_base_off = arrayOopDesc::base_offset_in_bytes(T_BYTE);
! const bool off_beyond_header = ((uint)off >= (uint)min_base_off);
// Try to constant-fold a stable array element.
if (FoldStableValues && !is_mismatched_access() && ary->is_stable()) {
// Make sure the reference is not into the header and the offset is constant
ciObject* aobj = ary->const_oop();
--- 1695,1705 ----
// Different array types begin at slightly different offsets (12 vs. 16).
// We choose T_BYTE as an example base type that is least restrictive
// as to alignment, which will therefore produce the smallest
// possible base offset.
const int min_base_off = arrayOopDesc::base_offset_in_bytes(T_BYTE);
! const bool off_beyond_header = (off >= min_base_off);
// Try to constant-fold a stable array element.
if (FoldStableValues && !is_mismatched_access() && ary->is_stable()) {
// Make sure the reference is not into the header and the offset is constant
ciObject* aobj = ary->const_oop();
*** 1732,1742 ****
if ((t->isa_int() == NULL) && (t->isa_long() == NULL)
&& (_type->isa_vect() == NULL)
&& Opcode() != Op_LoadKlass && Opcode() != Op_LoadNKlass) {
// t might actually be lower than _type, if _type is a unique
// concrete subclass of abstract class t.
! if (off_beyond_header) { // is the offset beyond the header?
const Type* jt = t->join_speculative(_type);
// In any case, do not allow the join, per se, to empty out the type.
if (jt->empty() && !t->empty()) {
// This can happen if a interface-typed array narrows to a class type.
jt = _type;
--- 1732,1742 ----
if ((t->isa_int() == NULL) && (t->isa_long() == NULL)
&& (_type->isa_vect() == NULL)
&& Opcode() != Op_LoadKlass && Opcode() != Op_LoadNKlass) {
// t might actually be lower than _type, if _type is a unique
// concrete subclass of abstract class t.
! if (off_beyond_header || off == Type::OffsetBot) { // is the offset beyond the header?
const Type* jt = t->join_speculative(_type);
// In any case, do not allow the join, per se, to empty out the type.
if (jt->empty() && !t->empty()) {
// This can happen if a interface-typed array narrows to a class type.
jt = _type;
< prev index next >