src/share/vm/opto/type.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/opto/type.hpp

src/share/vm/opto/type.hpp

Print this page
rev 5771 : 8027422: assert(_gvn.type(obj)->higher_equal(tjp)) failed: cast_up is no longer needed
Summary: type methods shouldn't always operate on speculative part
Reviewed-by:
rev 5772 : imported patch typefixes-8027422-chris
rev 5777 : 8031754: Type speculation should favor profile data from outermost inlined method
Summary: favor profile data coming from outer most method
Reviewed-by:

*** 413,422 **** --- 413,423 ---- static const Type* make_from_constant(ciConstant constant, bool require_constant = false, bool is_autobox_cache = false); // Speculative type. See TypeInstPtr + virtual const TypeOopPtr* speculative() const { return NULL; } virtual ciKlass* speculative_type() const { return NULL; } const Type* maybe_remove_speculative(bool include_speculative) const; virtual const Type* remove_speculative() const { return this; } private:
*** 791,800 **** --- 792,806 ---- static const TypePtr *NOTNULL; static const TypePtr *BOTTOM; #ifndef PRODUCT virtual void dump2( Dict &d, uint depth, outputStream *st ) const; #endif + + virtual int inline_depth() const { + fatal("should not be used"); + return 0; + } }; //------------------------------TypeRawPtr------------------------------------- // Class of raw pointers, pointers to things other than Oops. Examples // include the stack pointer, top of heap, card-marking area, handles, etc.
*** 829,847 **** //------------------------------TypeOopPtr------------------------------------- // Some kind of oop (Java pointer), either klass or instance or array. class TypeOopPtr : public TypePtr { protected: ! TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id, const TypeOopPtr* speculative); public: virtual bool eq( const Type *t ) const; virtual int hash() const; // Type specific hashing virtual bool singleton(void) const; // TRUE if type is a singleton enum { InstanceTop = -1, // undefined instance InstanceBot = 0 // any possible instance }; protected: // Oop is NULL, unless this is a constant oop. ciObject* _const_oop; // Constant oop // If _klass is NULL, then so is _sig. This is an unloaded klass. --- 835,857 ---- //------------------------------TypeOopPtr------------------------------------- // Some kind of oop (Java pointer), either klass or instance or array. class TypeOopPtr : public TypePtr { protected: ! TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id, const TypeOopPtr* speculative, int inline_depth); public: virtual bool eq( const Type *t ) const; virtual int hash() const; // Type specific hashing virtual bool singleton(void) const; // TRUE if type is a singleton enum { InstanceTop = -1, // undefined instance InstanceBot = 0 // any possible instance }; + enum { + InlineDepthTop = INT_MAX, + InlineDepthBottom = -InlineDepthTop + }; protected: // Oop is NULL, unless this is a constant oop. ciObject* _const_oop; // Constant oop // If _klass is NULL, then so is _sig. This is an unloaded klass.
*** 860,869 **** --- 870,884 ---- // Extra type information profiling gave us. We propagate it the // same way the rest of the type info is propagated. If we want to // use it, then we have to emit a guard: this part of the type is // not something we know but something we speculate about the type. const TypeOopPtr* _speculative; + // For speculative types, we record at what inlining depth the + // profiling point that provided the data is. We want to favor + // profile data coming from outer scopes which are likely better for + // the current compilation. + int _inline_depth; static const TypeOopPtr* make_from_klass_common(ciKlass* klass, bool klass_change, bool try_for_exact); int dual_instance_id() const; int meet_instance_id(int uid) const;
*** 875,884 **** --- 890,905 ---- int hash_speculative() const; const TypeOopPtr* add_offset_speculative(intptr_t offset) const; #ifndef PRODUCT void dump_speculative(outputStream *st) const; #endif + // utility methods to work on the inline depth of the type + int dual_inline_depth() const; + int meet_inline_depth(int depth) const; + #ifndef PRODUCT + void dump_inline_depth(outputStream *st) const; + #endif // Do not allow interface-vs.-noninterface joins to collapse to top. virtual const Type *filter_helper(const Type *kills, bool include_speculative) const; public:
*** 905,915 **** static const TypeOopPtr* make_from_constant(ciObject* o, bool require_constant = false, bool not_null_elements = false); // Make a generic (unclassed) pointer to an oop. ! static const TypeOopPtr* make(PTR ptr, int offset, int instance_id, const TypeOopPtr* speculative); ciObject* const_oop() const { return _const_oop; } virtual ciKlass* klass() const { return _klass; } bool klass_is_exact() const { return _klass_is_exact; } --- 926,936 ---- static const TypeOopPtr* make_from_constant(ciObject* o, bool require_constant = false, bool not_null_elements = false); // Make a generic (unclassed) pointer to an oop. ! static const TypeOopPtr* make(PTR ptr, int offset, int instance_id, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom); ciObject* const_oop() const { return _const_oop; } virtual ciKlass* klass() const { return _klass; } bool klass_is_exact() const { return _klass_is_exact; }
*** 919,929 **** bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; } bool is_ptr_to_boxed_value() const { return _is_ptr_to_boxed_value; } bool is_known_instance() const { return _instance_id > 0; } int instance_id() const { return _instance_id; } bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; } ! const TypeOopPtr* speculative() const { return _speculative; } virtual intptr_t get_con() const; virtual const Type *cast_to_ptr_type(PTR ptr) const; --- 940,950 ---- bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; } bool is_ptr_to_boxed_value() const { return _is_ptr_to_boxed_value; } bool is_known_instance() const { return _instance_id > 0; } int instance_id() const { return _instance_id; } bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; } ! virtual const TypeOopPtr* speculative() const { return _speculative; } virtual intptr_t get_con() const; virtual const Type *cast_to_ptr_type(PTR ptr) const;
*** 957,973 **** return speculative->klass(); } } return NULL; } }; //------------------------------TypeInstPtr------------------------------------ // Class of Java object pointers, pointing either to non-array Java instances // or to a Klass* (including array klasses). class TypeInstPtr : public TypeOopPtr { ! TypeInstPtr(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id, const TypeOopPtr* speculative); virtual bool eq( const Type *t ) const; virtual int hash() const; // Type specific hashing ciSymbol* _name; // class name --- 978,998 ---- return speculative->klass(); } } return NULL; } + virtual const TypeOopPtr* with_inline_depth(int depth) const; + virtual int inline_depth() const { + return _inline_depth; + } }; //------------------------------TypeInstPtr------------------------------------ // Class of Java object pointers, pointing either to non-array Java instances // or to a Klass* (including array klasses). class TypeInstPtr : public TypeOopPtr { ! TypeInstPtr(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id, const TypeOopPtr* speculative, int inline_depth); virtual bool eq( const Type *t ) const; virtual int hash() const; // Type specific hashing ciSymbol* _name; // class name
*** 999,1009 **** static const TypeInstPtr *make(PTR ptr, ciKlass* klass, int offset) { return make(ptr, klass, false, NULL, offset, InstanceBot); } // Make a pointer to an oop. ! static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL); /** Create constant type for a constant boxed value */ const Type* get_const_boxed_value() const; // If this is a java.lang.Class constant, return the type for it or NULL. --- 1024,1034 ---- static const TypeInstPtr *make(PTR ptr, ciKlass* klass, int offset) { return make(ptr, klass, false, NULL, offset, InstanceBot); } // Make a pointer to an oop. ! static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom); /** Create constant type for a constant boxed value */ const Type* get_const_boxed_value() const; // If this is a java.lang.Class constant, return the type for it or NULL.
*** 1018,1027 **** --- 1043,1053 ---- virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; virtual const TypePtr *add_offset( intptr_t offset ) const; // Return same type without a speculative part virtual const Type* remove_speculative() const; + virtual const TypeOopPtr* with_inline_depth(int depth) const; // the core of the computation of the meet of 2 types virtual const Type *xmeet_helper(const Type *t) const; virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const; virtual const Type *xdual() const; // Compute dual right now.
*** 1039,1050 **** //------------------------------TypeAryPtr------------------------------------- // Class of Java array pointers class TypeAryPtr : public TypeOopPtr { TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, ! int offset, int instance_id, bool is_autobox_cache, const TypeOopPtr* speculative) ! : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id, speculative), _ary(ary), _is_autobox_cache(is_autobox_cache) { #ifdef ASSERT if (k != NULL) { --- 1065,1076 ---- //------------------------------TypeAryPtr------------------------------------- // Class of Java array pointers class TypeAryPtr : public TypeOopPtr { TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, ! int offset, int instance_id, bool is_autobox_cache, const TypeOopPtr* speculative, int inline_depth) ! : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id, speculative, inline_depth), _ary(ary), _is_autobox_cache(is_autobox_cache) { #ifdef ASSERT if (k != NULL) {
*** 1078,1090 **** const TypeInt* size() const { return _ary->_size; } bool is_stable() const { return _ary->_stable; } bool is_autobox_cache() const { return _is_autobox_cache; } ! static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL); // Constant pointer to array ! static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, bool is_autobox_cache = false); // Return a 'ptr' version of this type virtual const Type *cast_to_ptr_type(PTR ptr) const; virtual const Type *cast_to_exactness(bool klass_is_exact) const; --- 1104,1116 ---- const TypeInt* size() const { return _ary->_size; } bool is_stable() const { return _ary->_stable; } bool is_autobox_cache() const { return _is_autobox_cache; } ! static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom); // Constant pointer to array ! static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, const TypeOopPtr* speculative = NULL, int inline_depth = InlineDepthBottom, bool is_autobox_cache= false); // Return a 'ptr' version of this type virtual const Type *cast_to_ptr_type(PTR ptr) const; virtual const Type *cast_to_exactness(bool klass_is_exact) const;
*** 1096,1105 **** --- 1122,1132 ---- virtual bool empty(void) const; // TRUE if type is vacuous virtual const TypePtr *add_offset( intptr_t offset ) const; // Return same type without a speculative part virtual const Type* remove_speculative() const; + virtual const TypeOopPtr* with_inline_depth(int depth) const; // the core of the computation of the meet of 2 types virtual const Type *xmeet_helper(const Type *t) const; virtual const Type *xdual() const; // Compute dual right now.
src/share/vm/opto/type.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File