8213371: GC/C2 abstraction and cleanup to handle custom offset for GC memory accesses
Reviewed-by: kvn, roland
This commit is contained in:
parent
bb0212400f
commit
bb792b0337
@ -283,6 +283,11 @@ public:
|
||||
BeforeCodeGen
|
||||
};
|
||||
virtual void verify_gc_barriers(Compile* compile, CompilePhase phase) const {}
|
||||
|
||||
virtual bool flatten_gc_alias_type(const TypePtr*& adr_type) const { return false; }
|
||||
#ifdef ASSERT
|
||||
virtual bool verify_gc_alias_type(const TypePtr* adr_type, int offset) const { return false; }
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_SHARED_C2_BARRIERSETC2_HPP
|
||||
|
@ -1468,6 +1468,8 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const {
|
||||
tj = TypeInstPtr::MARK;
|
||||
ta = TypeAryPtr::RANGE; // generic ignored junk
|
||||
ptr = TypePtr::BotPTR;
|
||||
} else if (BarrierSet::barrier_set()->barrier_set_c2()->flatten_gc_alias_type(tj)) {
|
||||
ta = tj->isa_aryptr();
|
||||
} else { // Random constant offset into array body
|
||||
offset = Type::OffsetBot; // Flatten constant access into array body
|
||||
tj = ta = TypeAryPtr::make(ptr,ta->ary(),ta->klass(),false,offset);
|
||||
@ -1532,6 +1534,8 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const {
|
||||
if (!is_known_inst) { // Do it only for non-instance types
|
||||
tj = to = TypeInstPtr::make(TypePtr::BotPTR, env()->Object_klass(), false, NULL, offset);
|
||||
}
|
||||
} else if (BarrierSet::barrier_set()->barrier_set_c2()->flatten_gc_alias_type(tj)) {
|
||||
to = tj->is_instptr();
|
||||
} else if (offset < 0 || offset >= k->size_helper() * wordSize) {
|
||||
// Static fields are in the space above the normal instance
|
||||
// fields in the java.lang.Class instance.
|
||||
@ -1630,7 +1634,8 @@ const TypePtr *Compile::flatten_alias_type( const TypePtr *tj ) const {
|
||||
(offset == Type::OffsetBot && tj == TypePtr::BOTTOM) ||
|
||||
(offset == oopDesc::mark_offset_in_bytes() && tj->base() == Type::AryPtr) ||
|
||||
(offset == oopDesc::klass_offset_in_bytes() && tj->base() == Type::AryPtr) ||
|
||||
(offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr) ,
|
||||
(offset == arrayOopDesc::length_offset_in_bytes() && tj->base() == Type::AryPtr) ||
|
||||
(BarrierSet::barrier_set()->barrier_set_c2()->verify_gc_alias_type(tj, offset)),
|
||||
"For oops, klasses, raw offset must be constant; for arrays the offset is never known" );
|
||||
assert( tj->ptr() != TypePtr::TopPTR &&
|
||||
tj->ptr() != TypePtr::AnyNull &&
|
||||
|
@ -1697,7 +1697,7 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
|
||||
// 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);
|
||||
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()) {
|
||||
@ -1734,7 +1734,7 @@ const Type* LoadNode::Value(PhaseGVN* phase) const {
|
||||
&& 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?
|
||||
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()) {
|
||||
|
@ -2960,7 +2960,7 @@ TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int o
|
||||
_is_ptr_to_boxed_value = k->as_instance_klass()->is_boxed_value_offset(offset);
|
||||
}
|
||||
#ifdef _LP64
|
||||
if (_offset != 0) {
|
||||
if (_offset > 0 || _offset == Type::OffsetTop || _offset == Type::OffsetBot) {
|
||||
if (_offset == oopDesc::klass_offset_in_bytes()) {
|
||||
_is_ptr_to_narrowklass = UseCompressedClassPointers;
|
||||
} else if (klass() == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user