Mercurial > hg > truffle
comparison src/share/vm/opto/type.hpp @ 10408:836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 19 Jun 2013 10:45:56 +0200 |
parents | 6f3fd5150b67 |
children | 9758d9f36299 |
comparison
equal
deleted
inserted
replaced
10086:e0fb8a213650 | 10408:836a62f43af9 |
---|---|
231 | 231 |
232 // Returns true if this pointer points at memory which contains a | 232 // Returns true if this pointer points at memory which contains a |
233 // compressed oop references. | 233 // compressed oop references. |
234 bool is_ptr_to_narrowoop() const; | 234 bool is_ptr_to_narrowoop() const; |
235 bool is_ptr_to_narrowklass() const; | 235 bool is_ptr_to_narrowklass() const; |
236 | |
237 bool is_ptr_to_boxing_obj() const; | |
238 | |
236 | 239 |
237 // Convenience access | 240 // Convenience access |
238 float getf() const; | 241 float getf() const; |
239 double getd() const; | 242 double getd() const; |
240 | 243 |
792 ciKlass* _klass; // Klass object | 795 ciKlass* _klass; // Klass object |
793 // Does the type exclude subclasses of the klass? (Inexact == polymorphic.) | 796 // Does the type exclude subclasses of the klass? (Inexact == polymorphic.) |
794 bool _klass_is_exact; | 797 bool _klass_is_exact; |
795 bool _is_ptr_to_narrowoop; | 798 bool _is_ptr_to_narrowoop; |
796 bool _is_ptr_to_narrowklass; | 799 bool _is_ptr_to_narrowklass; |
800 bool _is_ptr_to_boxed_value; | |
797 | 801 |
798 // If not InstanceTop or InstanceBot, indicates that this is | 802 // If not InstanceTop or InstanceBot, indicates that this is |
799 // a particular instance of this type which is distinct. | 803 // a particular instance of this type which is distinct. |
800 // This is the the node index of the allocation node creating this instance. | 804 // This is the the node index of the allocation node creating this instance. |
801 int _instance_id; | 805 int _instance_id; |
824 } | 828 } |
825 // Creates a singleton type given an object. | 829 // Creates a singleton type given an object. |
826 // If the object cannot be rendered as a constant, | 830 // If the object cannot be rendered as a constant, |
827 // may return a non-singleton type. | 831 // may return a non-singleton type. |
828 // If require_constant, produce a NULL if a singleton is not possible. | 832 // If require_constant, produce a NULL if a singleton is not possible. |
829 static const TypeOopPtr* make_from_constant(ciObject* o, bool require_constant = false); | 833 static const TypeOopPtr* make_from_constant(ciObject* o, |
834 bool require_constant = false, | |
835 bool not_null_elements = false); | |
830 | 836 |
831 // Make a generic (unclassed) pointer to an oop. | 837 // Make a generic (unclassed) pointer to an oop. |
832 static const TypeOopPtr* make(PTR ptr, int offset, int instance_id); | 838 static const TypeOopPtr* make(PTR ptr, int offset, int instance_id); |
833 | 839 |
834 ciObject* const_oop() const { return _const_oop; } | 840 ciObject* const_oop() const { return _const_oop; } |
837 | 843 |
838 // Returns true if this pointer points at memory which contains a | 844 // Returns true if this pointer points at memory which contains a |
839 // compressed oop references. | 845 // compressed oop references. |
840 bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; } | 846 bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; } |
841 bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; } | 847 bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; } |
842 | 848 bool is_ptr_to_boxed_value() const { return _is_ptr_to_boxed_value; } |
843 bool is_known_instance() const { return _instance_id > 0; } | 849 bool is_known_instance() const { return _instance_id > 0; } |
844 int instance_id() const { return _instance_id; } | 850 int instance_id() const { return _instance_id; } |
845 bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; } | 851 bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; } |
846 | 852 |
847 virtual intptr_t get_con() const; | 853 virtual intptr_t get_con() const; |
910 } | 916 } |
911 | 917 |
912 // Make a pointer to an oop. | 918 // Make a pointer to an oop. |
913 static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot ); | 919 static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot ); |
914 | 920 |
921 /** Create constant type for a constant boxed value */ | |
922 const Type* get_const_boxed_value() const; | |
923 | |
915 // If this is a java.lang.Class constant, return the type for it or NULL. | 924 // If this is a java.lang.Class constant, return the type for it or NULL. |
916 // Pass to Type::get_const_type to turn it to a type, which will usually | 925 // Pass to Type::get_const_type to turn it to a type, which will usually |
917 // be a TypeInstPtr, but may also be a TypeInt::INT for int.class, etc. | 926 // be a TypeInstPtr, but may also be a TypeInt::INT for int.class, etc. |
918 ciType* java_mirror_type() const; | 927 ciType* java_mirror_type() const; |
919 | 928 |
941 }; | 950 }; |
942 | 951 |
943 //------------------------------TypeAryPtr------------------------------------- | 952 //------------------------------TypeAryPtr------------------------------------- |
944 // Class of Java array pointers | 953 // Class of Java array pointers |
945 class TypeAryPtr : public TypeOopPtr { | 954 class TypeAryPtr : public TypeOopPtr { |
946 TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id ) : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id), _ary(ary) { | 955 TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, |
956 int offset, int instance_id, bool is_autobox_cache ) | |
957 : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id), | |
958 _ary(ary), | |
959 _is_autobox_cache(is_autobox_cache) | |
960 { | |
947 #ifdef ASSERT | 961 #ifdef ASSERT |
948 if (k != NULL) { | 962 if (k != NULL) { |
949 // Verify that specified klass and TypeAryPtr::klass() follow the same rules. | 963 // Verify that specified klass and TypeAryPtr::klass() follow the same rules. |
950 ciKlass* ck = compute_klass(true); | 964 ciKlass* ck = compute_klass(true); |
951 if (k != ck) { | 965 if (k != ck) { |
962 #endif | 976 #endif |
963 } | 977 } |
964 virtual bool eq( const Type *t ) const; | 978 virtual bool eq( const Type *t ) const; |
965 virtual int hash() const; // Type specific hashing | 979 virtual int hash() const; // Type specific hashing |
966 const TypeAry *_ary; // Array we point into | 980 const TypeAry *_ary; // Array we point into |
981 const bool _is_autobox_cache; | |
967 | 982 |
968 ciKlass* compute_klass(DEBUG_ONLY(bool verify = false)) const; | 983 ciKlass* compute_klass(DEBUG_ONLY(bool verify = false)) const; |
969 | 984 |
970 public: | 985 public: |
971 // Accessors | 986 // Accessors |
972 ciKlass* klass() const; | 987 ciKlass* klass() const; |
973 const TypeAry* ary() const { return _ary; } | 988 const TypeAry* ary() const { return _ary; } |
974 const Type* elem() const { return _ary->_elem; } | 989 const Type* elem() const { return _ary->_elem; } |
975 const TypeInt* size() const { return _ary->_size; } | 990 const TypeInt* size() const { return _ary->_size; } |
976 | 991 |
992 bool is_autobox_cache() const { return _is_autobox_cache; } | |
993 | |
977 static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); | 994 static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); |
978 // Constant pointer to array | 995 // Constant pointer to array |
979 static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); | 996 static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, bool is_autobox_cache = false); |
980 | 997 |
981 // Return a 'ptr' version of this type | 998 // Return a 'ptr' version of this type |
982 virtual const Type *cast_to_ptr_type(PTR ptr) const; | 999 virtual const Type *cast_to_ptr_type(PTR ptr) const; |
983 | 1000 |
984 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | 1001 virtual const Type *cast_to_exactness(bool klass_is_exact) const; |
1500 inline bool Type::is_floatingpoint() const { | 1517 inline bool Type::is_floatingpoint() const { |
1501 if( (_base == FloatCon) || (_base == FloatBot) || | 1518 if( (_base == FloatCon) || (_base == FloatBot) || |
1502 (_base == DoubleCon) || (_base == DoubleBot) ) | 1519 (_base == DoubleCon) || (_base == DoubleBot) ) |
1503 return true; | 1520 return true; |
1504 return false; | 1521 return false; |
1522 } | |
1523 | |
1524 inline bool Type::is_ptr_to_boxing_obj() const { | |
1525 const TypeInstPtr* tp = isa_instptr(); | |
1526 return (tp != NULL) && (tp->offset() == 0) && | |
1527 tp->klass()->is_instance_klass() && | |
1528 tp->klass()->as_instance_klass()->is_box_klass(); | |
1505 } | 1529 } |
1506 | 1530 |
1507 | 1531 |
1508 // =============================================================== | 1532 // =============================================================== |
1509 // Things that need to be 64-bits in the 64-bit build but | 1533 // Things that need to be 64-bits in the 64-bit build but |