Mercurial > hg > truffle
comparison src/share/vm/opto/type.hpp @ 12190:edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
Reviewed-by: rbackman, twisti, kvn
Contributed-by: john.r.rose@oracle.com, vladimir.x.ivanov@oracle.com
author | vlivanov |
---|---|
date | Tue, 10 Sep 2013 14:51:48 -0700 |
parents | 9758d9f36299 |
children | c9ccd7b85f20 |
comparison
equal
deleted
inserted
replaced
12188:cd16d587b0fa | 12190:edb5ab0f3fe5 |
---|---|
370 relocInfo::relocType reloc() const { return _type_info[_base].reloc; } | 370 relocInfo::relocType reloc() const { return _type_info[_base].reloc; } |
371 | 371 |
372 // Mapping from CI type system to compiler type: | 372 // Mapping from CI type system to compiler type: |
373 static const Type* get_typeflow_type(ciType* type); | 373 static const Type* get_typeflow_type(ciType* type); |
374 | 374 |
375 static const Type* make_from_constant(ciConstant constant, | |
376 bool require_constant = false, | |
377 bool is_autobox_cache = false); | |
378 | |
375 private: | 379 private: |
376 // support arrays | 380 // support arrays |
377 static const BasicType _basic_type[]; | 381 static const BasicType _basic_type[]; |
378 static const Type* _zero_type[T_CONFLICT+1]; | 382 static const Type* _zero_type[T_CONFLICT+1]; |
379 static const Type* _const_basic_type[T_CONFLICT+1]; | 383 static const Type* _const_basic_type[T_CONFLICT+1]; |
586 }; | 590 }; |
587 | 591 |
588 //------------------------------TypeAry---------------------------------------- | 592 //------------------------------TypeAry---------------------------------------- |
589 // Class of Array Types | 593 // Class of Array Types |
590 class TypeAry : public Type { | 594 class TypeAry : public Type { |
591 TypeAry( const Type *elem, const TypeInt *size) : Type(Array), | 595 TypeAry(const Type* elem, const TypeInt* size, bool stable) : Type(Array), |
592 _elem(elem), _size(size) {} | 596 _elem(elem), _size(size), _stable(stable) {} |
593 public: | 597 public: |
594 virtual bool eq( const Type *t ) const; | 598 virtual bool eq( const Type *t ) const; |
595 virtual int hash() const; // Type specific hashing | 599 virtual int hash() const; // Type specific hashing |
596 virtual bool singleton(void) const; // TRUE if type is a singleton | 600 virtual bool singleton(void) const; // TRUE if type is a singleton |
597 virtual bool empty(void) const; // TRUE if type is vacuous | 601 virtual bool empty(void) const; // TRUE if type is vacuous |
598 | 602 |
599 private: | 603 private: |
600 const Type *_elem; // Element type of array | 604 const Type *_elem; // Element type of array |
601 const TypeInt *_size; // Elements in array | 605 const TypeInt *_size; // Elements in array |
606 const bool _stable; // Are elements @Stable? | |
602 friend class TypeAryPtr; | 607 friend class TypeAryPtr; |
603 | 608 |
604 public: | 609 public: |
605 static const TypeAry *make( const Type *elem, const TypeInt *size); | 610 static const TypeAry* make(const Type* elem, const TypeInt* size, bool stable = false); |
606 | 611 |
607 virtual const Type *xmeet( const Type *t ) const; | 612 virtual const Type *xmeet( const Type *t ) const; |
608 virtual const Type *xdual() const; // Compute dual right now. | 613 virtual const Type *xdual() const; // Compute dual right now. |
609 bool ary_must_be_exact() const; // true if arrays of such are never generic | 614 bool ary_must_be_exact() const; // true if arrays of such are never generic |
610 #ifdef ASSERT | 615 #ifdef ASSERT |
986 // Accessors | 991 // Accessors |
987 ciKlass* klass() const; | 992 ciKlass* klass() const; |
988 const TypeAry* ary() const { return _ary; } | 993 const TypeAry* ary() const { return _ary; } |
989 const Type* elem() const { return _ary->_elem; } | 994 const Type* elem() const { return _ary->_elem; } |
990 const TypeInt* size() const { return _ary->_size; } | 995 const TypeInt* size() const { return _ary->_size; } |
996 bool is_stable() const { return _ary->_stable; } | |
991 | 997 |
992 bool is_autobox_cache() const { return _is_autobox_cache; } | 998 bool is_autobox_cache() const { return _is_autobox_cache; } |
993 | 999 |
994 static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); | 1000 static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); |
995 // Constant pointer to array | 1001 // Constant pointer to array |
1008 virtual bool empty(void) const; // TRUE if type is vacuous | 1014 virtual bool empty(void) const; // TRUE if type is vacuous |
1009 virtual const TypePtr *add_offset( intptr_t offset ) const; | 1015 virtual const TypePtr *add_offset( intptr_t offset ) const; |
1010 | 1016 |
1011 virtual const Type *xmeet( const Type *t ) const; | 1017 virtual const Type *xmeet( const Type *t ) const; |
1012 virtual const Type *xdual() const; // Compute dual right now. | 1018 virtual const Type *xdual() const; // Compute dual right now. |
1019 | |
1020 const TypeAryPtr* cast_to_stable(bool stable, int stable_dimension = 1) const; | |
1021 int stable_dimension() const; | |
1013 | 1022 |
1014 // Convenience common pre-built types. | 1023 // Convenience common pre-built types. |
1015 static const TypeAryPtr *RANGE; | 1024 static const TypeAryPtr *RANGE; |
1016 static const TypeAryPtr *OOPS; | 1025 static const TypeAryPtr *OOPS; |
1017 static const TypeAryPtr *NARROWOOPS; | 1026 static const TypeAryPtr *NARROWOOPS; |