1.1 --- a/src/share/vm/opto/type.hpp Mon Jun 23 18:21:18 2008 -0700 1.2 +++ b/src/share/vm/opto/type.hpp Tue Jun 24 10:43:29 2008 -0700 1.3 @@ -225,6 +225,12 @@ 1.4 virtual bool is_finite() const; // Has a finite value 1.5 virtual bool is_nan() const; // Is not a number (NaN) 1.6 1.7 + // Returns this ptr type or the equivalent ptr type for this compressed pointer. 1.8 + const TypePtr* make_ptr() const; 1.9 + // Returns this compressed pointer or the equivalent compressed version 1.10 + // of this pointer type. 1.11 + const TypeNarrowOop* make_narrowoop() const; 1.12 + 1.13 // Special test for register pressure heuristic 1.14 bool is_floatingpoint() const; // True if Float or Double base type 1.15 1.16 @@ -718,9 +724,6 @@ 1.17 1.18 virtual const TypePtr *add_offset( int offset ) const; 1.19 1.20 - // returns the equivalent compressed version of this pointer type 1.21 - virtual const TypeNarrowOop* make_narrowoop() const; 1.22 - 1.23 virtual const Type *xmeet( const Type *t ) const; 1.24 virtual const Type *xdual() const; // Compute dual right now. 1.25 1.26 @@ -911,7 +914,7 @@ 1.27 // between the normal and the compressed form. 1.28 class TypeNarrowOop : public Type { 1.29 protected: 1.30 - const TypePtr* _ooptype; 1.31 + const TypePtr* _ooptype; // Could be TypePtr::NULL_PTR 1.32 1.33 TypeNarrowOop( const TypePtr* ooptype): Type(NarrowOop), 1.34 _ooptype(ooptype) { 1.35 @@ -940,8 +943,8 @@ 1.36 return make(TypeOopPtr::make_from_constant(con)); 1.37 } 1.38 1.39 - // returns the equivalent oopptr type for this compressed pointer 1.40 - virtual const TypePtr *make_oopptr() const { 1.41 + // returns the equivalent ptr type for this compressed pointer 1.42 + const TypePtr *make_oopptr() const { 1.43 return _ooptype; 1.44 } 1.45 1.46 @@ -1128,6 +1131,16 @@ 1.47 return (TypeKlassPtr*)this; 1.48 } 1.49 1.50 +inline const TypePtr* Type::make_ptr() const { 1.51 + return (_base == NarrowOop) ? is_narrowoop()->make_oopptr() : 1.52 + (isa_ptr() ? is_ptr() : NULL); 1.53 +} 1.54 + 1.55 +inline const TypeNarrowOop* Type::make_narrowoop() const { 1.56 + return (_base == NarrowOop) ? is_narrowoop() : 1.57 + (isa_ptr() ? TypeNarrowOop::make(is_ptr()) : NULL); 1.58 +} 1.59 + 1.60 inline bool Type::is_floatingpoint() const { 1.61 if( (_base == FloatCon) || (_base == FloatBot) || 1.62 (_base == DoubleCon) || (_base == DoubleBot) )