comparison src/share/vm/opto/type.hpp @ 306:af945ba2e739

6741738: TypePtr::add_offset() set incorrect offset when the add overflows Summary: Set offset to OffsetBot when the add overflows in TypePtr::add_offset() Reviewed-by: jrose, never
author kvn
date Wed, 27 Aug 2008 14:47:32 -0700
parents 9c2ecc2ffb12
children 8261ee795323
comparison
equal deleted inserted replaced
305:ab075d07f1ba 306:af945ba2e739
579 // Return a 'ptr' version of this type 579 // Return a 'ptr' version of this type
580 virtual const Type *cast_to_ptr_type(PTR ptr) const; 580 virtual const Type *cast_to_ptr_type(PTR ptr) const;
581 581
582 virtual intptr_t get_con() const; 582 virtual intptr_t get_con() const;
583 583
584 virtual const TypePtr *add_offset( int offset ) const; 584 int xadd_offset( intptr_t offset ) const;
585 virtual const TypePtr *add_offset( intptr_t offset ) const;
585 586
586 virtual bool singleton(void) const; // TRUE if type is a singleton 587 virtual bool singleton(void) const; // TRUE if type is a singleton
587 virtual bool empty(void) const; // TRUE if type is vacuous 588 virtual bool empty(void) const; // TRUE if type is vacuous
588 virtual const Type *xmeet( const Type *t ) const; 589 virtual const Type *xmeet( const Type *t ) const;
589 int meet_offset( int offset ) const; 590 int meet_offset( int offset ) const;
630 // Return a 'ptr' version of this type 631 // Return a 'ptr' version of this type
631 virtual const Type *cast_to_ptr_type(PTR ptr) const; 632 virtual const Type *cast_to_ptr_type(PTR ptr) const;
632 633
633 virtual intptr_t get_con() const; 634 virtual intptr_t get_con() const;
634 635
635 virtual const TypePtr *add_offset( int offset ) const; 636 virtual const TypePtr *add_offset( intptr_t offset ) const;
636 637
637 virtual const Type *xmeet( const Type *t ) const; 638 virtual const Type *xmeet( const Type *t ) const;
638 virtual const Type *xdual() const; // Compute dual right now. 639 virtual const Type *xdual() const; // Compute dual right now.
639 // Convenience common pre-built types. 640 // Convenience common pre-built types.
640 static const TypeRawPtr *BOTTOM; 641 static const TypeRawPtr *BOTTOM;
657 InstanceTop = -1, // undefined instance 658 InstanceTop = -1, // undefined instance
658 InstanceBot = 0 // any possible instance 659 InstanceBot = 0 // any possible instance
659 }; 660 };
660 protected: 661 protected:
661 662
662 int xadd_offset( int offset ) const;
663 // Oop is NULL, unless this is a constant oop. 663 // Oop is NULL, unless this is a constant oop.
664 ciObject* _const_oop; // Constant oop 664 ciObject* _const_oop; // Constant oop
665 // If _klass is NULL, then so is _sig. This is an unloaded klass. 665 // If _klass is NULL, then so is _sig. This is an unloaded klass.
666 ciKlass* _klass; // Klass object 666 ciKlass* _klass; // Klass object
667 // Does the type exclude subclasses of the klass? (Inexact == polymorphic.) 667 // Does the type exclude subclasses of the klass? (Inexact == polymorphic.)
722 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; 722 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
723 723
724 // corresponding pointer to klass, for a given instance 724 // corresponding pointer to klass, for a given instance
725 const TypeKlassPtr* as_klass_type() const; 725 const TypeKlassPtr* as_klass_type() const;
726 726
727 virtual const TypePtr *add_offset( int offset ) const; 727 virtual const TypePtr *add_offset( intptr_t offset ) const;
728 728
729 virtual const Type *xmeet( const Type *t ) const; 729 virtual const Type *xmeet( const Type *t ) const;
730 virtual const Type *xdual() const; // Compute dual right now. 730 virtual const Type *xdual() const; // Compute dual right now.
731 731
732 // Do not allow interface-vs.-noninterface joins to collapse to top. 732 // Do not allow interface-vs.-noninterface joins to collapse to top.
791 791
792 virtual const Type *cast_to_exactness(bool klass_is_exact) const; 792 virtual const Type *cast_to_exactness(bool klass_is_exact) const;
793 793
794 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; 794 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
795 795
796 virtual const TypePtr *add_offset( int offset ) const; 796 virtual const TypePtr *add_offset( intptr_t offset ) const;
797 797
798 virtual const Type *xmeet( const Type *t ) const; 798 virtual const Type *xmeet( const Type *t ) const;
799 virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const; 799 virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const;
800 virtual const Type *xdual() const; // Compute dual right now. 800 virtual const Type *xdual() const; // Compute dual right now.
801 801
840 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; 840 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const;
841 841
842 virtual const TypeAryPtr* cast_to_size(const TypeInt* size) const; 842 virtual const TypeAryPtr* cast_to_size(const TypeInt* size) const;
843 843
844 virtual bool empty(void) const; // TRUE if type is vacuous 844 virtual bool empty(void) const; // TRUE if type is vacuous
845 virtual const TypePtr *add_offset( int offset ) const; 845 virtual const TypePtr *add_offset( intptr_t offset ) const;
846 846
847 virtual const Type *xmeet( const Type *t ) const; 847 virtual const Type *xmeet( const Type *t ) const;
848 virtual const Type *xdual() const; // Compute dual right now. 848 virtual const Type *xdual() const; // Compute dual right now.
849 849
850 // Convenience common pre-built types. 850 // Convenience common pre-built types.
894 virtual const Type *cast_to_exactness(bool klass_is_exact) const; 894 virtual const Type *cast_to_exactness(bool klass_is_exact) const;
895 895
896 // corresponding pointer to instance, for a given class 896 // corresponding pointer to instance, for a given class
897 const TypeOopPtr* as_instance_type() const; 897 const TypeOopPtr* as_instance_type() const;
898 898
899 virtual const TypePtr *add_offset( int offset ) const; 899 virtual const TypePtr *add_offset( intptr_t offset ) const;
900 virtual const Type *xmeet( const Type *t ) const; 900 virtual const Type *xmeet( const Type *t ) const;
901 virtual const Type *xdual() const; // Compute dual right now. 901 virtual const Type *xdual() const; // Compute dual right now.
902 902
903 // Convenience common pre-built types. 903 // Convenience common pre-built types.
904 static const TypeKlassPtr* OBJECT; // Not-null object klass or below 904 static const TypeKlassPtr* OBJECT; // Not-null object klass or below