8235729: Shenandoah: Remove useless casting to non-constant

Reviewed-by: roland
This commit is contained in:
Roman Kennke 2019-12-11 16:43:02 +01:00
parent 91de8b6c91
commit 3f7ecfb5b1
3 changed files with 4 additions and 24 deletions
src/hotspot/share

@ -1018,7 +1018,7 @@ void ShenandoahBarrierC2Support::in_cset_fast_test(Node*& ctrl, Node*& not_cset_
void ShenandoahBarrierC2Support::call_lrb_stub(Node*& ctrl, Node*& val, Node* load_addr, Node*& result_mem, Node* raw_mem, bool is_native, PhaseIdealLoop* phase) {
IdealLoopTree*loop = phase->get_loop(ctrl);
const TypePtr* obj_type = phase->igvn().type(val)->is_oopptr()->cast_to_nonconst();
const TypePtr* obj_type = phase->igvn().type(val)->is_oopptr();
// The slow path stub consumes and produces raw memory in addition
// to the existing memory edges
@ -2138,7 +2138,7 @@ const Type* ShenandoahEnqueueBarrierNode::bottom_type() const {
if (t == TypePtr::NULL_PTR) {
return t;
}
return t->is_oopptr()->cast_to_nonconst();
return t->is_oopptr();
}
const Type* ShenandoahEnqueueBarrierNode::Value(PhaseGVN* phase) const {
@ -2152,7 +2152,7 @@ const Type* ShenandoahEnqueueBarrierNode::Value(PhaseGVN* phase) const {
if (t == TypePtr::NULL_PTR) {
return t;
}
return t->is_oopptr()->cast_to_nonconst();
return t->is_oopptr();
}
int ShenandoahEnqueueBarrierNode::needed(Node* n) {
@ -3079,7 +3079,7 @@ const Type* ShenandoahLoadReferenceBarrierNode::Value(PhaseGVN* phase) const {
return t2;
}
const Type* type = t2->is_oopptr()/*->cast_to_nonconst()*/;
const Type* type = t2->is_oopptr();
return type;
}

@ -3051,10 +3051,6 @@ const TypeOopPtr *TypeOopPtr::cast_to_instance_id(int instance_id) const {
return this;
}
const TypeOopPtr *TypeOopPtr::cast_to_nonconst() const {
return this;
}
//-----------------------------cast_to_exactness-------------------------------
const Type *TypeOopPtr::cast_to_exactness(bool klass_is_exact) const {
// There is no such thing as an exact general oop.
@ -3561,11 +3557,6 @@ const TypeOopPtr *TypeInstPtr::cast_to_instance_id(int instance_id) const {
return make(_ptr, klass(), _klass_is_exact, const_oop(), _offset, instance_id, _speculative, _inline_depth);
}
const TypeOopPtr *TypeInstPtr::cast_to_nonconst() const {
if (const_oop() == NULL) return this;
return make(NotNull, klass(), _klass_is_exact, NULL, _offset, _instance_id, _speculative, _inline_depth);
}
//------------------------------xmeet_unloaded---------------------------------
// Compute the MEET of two InstPtrs when at least one is unloaded.
// Assume classes are different since called after check for same name/class-loader
@ -4098,11 +4089,6 @@ const TypeOopPtr *TypeAryPtr::cast_to_instance_id(int instance_id) const {
return make(_ptr, const_oop(), _ary, klass(), _klass_is_exact, _offset, instance_id, _speculative, _inline_depth);
}
const TypeOopPtr *TypeAryPtr::cast_to_nonconst() const {
if (const_oop() == NULL) return this;
return make(NotNull, NULL, _ary, klass(), _klass_is_exact, _offset, _instance_id, _speculative, _inline_depth);
}
//-----------------------------max_array_length-------------------------------
// A wrapper around arrayOopDesc::max_array_length(etype) with some input normalization.

@ -1030,8 +1030,6 @@ public:
virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
virtual const TypeOopPtr *cast_to_nonconst() const;
// corresponding pointer to klass, for a given instance
const TypeKlassPtr* as_klass_type() const;
@ -1116,8 +1114,6 @@ class TypeInstPtr : public TypeOopPtr {
virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
virtual const TypeOopPtr *cast_to_nonconst() const;
virtual const TypePtr *add_offset( intptr_t offset ) const;
// Speculative type helper methods.
@ -1202,8 +1198,6 @@ public:
virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
virtual const TypeOopPtr *cast_to_nonconst() const;
virtual const TypeAryPtr* cast_to_size(const TypeInt* size) const;
virtual const TypeInt* narrow_size_type(const TypeInt* size) const;