--- old/src/hotspot/share/opto/type.cpp 2018-11-30 10:23:21.592046702 +0100 +++ new/src/hotspot/share/opto/type.cpp 2018-11-30 10:23:21.445048210 +0100 @@ -3044,6 +3044,10 @@ 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. @@ -3546,6 +3550,11 @@ 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 @@ -4073,6 +4082,12 @@ 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); +} + + //-----------------------------narrow_size_type------------------------------- // Local cache for arrayOopDesc::max_array_length(etype), // which is kind of slow (and cached elsewhere by other users).