src/share/vm/opto/type.hpp

changeset 5110
6f3fd5150b67
parent 4313
beebba0acc11
child 5614
9758d9f36299
     1.1 --- a/src/share/vm/opto/type.hpp	Mon May 06 19:49:23 2013 -0700
     1.2 +++ b/src/share/vm/opto/type.hpp	Wed May 08 15:08:01 2013 -0700
     1.3 @@ -234,6 +234,9 @@
     1.4    bool is_ptr_to_narrowoop() const;
     1.5    bool is_ptr_to_narrowklass() const;
     1.6  
     1.7 +  bool is_ptr_to_boxing_obj() const;
     1.8 +
     1.9 +
    1.10    // Convenience access
    1.11    float getf() const;
    1.12    double getd() const;
    1.13 @@ -794,6 +797,7 @@
    1.14    bool          _klass_is_exact;
    1.15    bool          _is_ptr_to_narrowoop;
    1.16    bool          _is_ptr_to_narrowklass;
    1.17 +  bool          _is_ptr_to_boxed_value;
    1.18  
    1.19    // If not InstanceTop or InstanceBot, indicates that this is
    1.20    // a particular instance of this type which is distinct.
    1.21 @@ -826,7 +830,9 @@
    1.22    // If the object cannot be rendered as a constant,
    1.23    // may return a non-singleton type.
    1.24    // If require_constant, produce a NULL if a singleton is not possible.
    1.25 -  static const TypeOopPtr* make_from_constant(ciObject* o, bool require_constant = false);
    1.26 +  static const TypeOopPtr* make_from_constant(ciObject* o,
    1.27 +                                              bool require_constant = false,
    1.28 +                                              bool not_null_elements = false);
    1.29  
    1.30    // Make a generic (unclassed) pointer to an oop.
    1.31    static const TypeOopPtr* make(PTR ptr, int offset, int instance_id);
    1.32 @@ -839,7 +845,7 @@
    1.33    // compressed oop references.
    1.34    bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; }
    1.35    bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; }
    1.36 -
    1.37 +  bool is_ptr_to_boxed_value()   const { return _is_ptr_to_boxed_value; }
    1.38    bool is_known_instance()       const { return _instance_id > 0; }
    1.39    int  instance_id()             const { return _instance_id; }
    1.40    bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; }
    1.41 @@ -912,6 +918,9 @@
    1.42    // Make a pointer to an oop.
    1.43    static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot );
    1.44  
    1.45 +  /** Create constant type for a constant boxed value */
    1.46 +  const Type* get_const_boxed_value() const;
    1.47 +
    1.48    // If this is a java.lang.Class constant, return the type for it or NULL.
    1.49    // Pass to Type::get_const_type to turn it to a type, which will usually
    1.50    // be a TypeInstPtr, but may also be a TypeInt::INT for int.class, etc.
    1.51 @@ -943,7 +952,12 @@
    1.52  //------------------------------TypeAryPtr-------------------------------------
    1.53  // Class of Java array pointers
    1.54  class TypeAryPtr : public TypeOopPtr {
    1.55 -  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) {
    1.56 +  TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk,
    1.57 +              int offset, int instance_id, bool is_autobox_cache )
    1.58 +  : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id),
    1.59 +    _ary(ary),
    1.60 +    _is_autobox_cache(is_autobox_cache)
    1.61 + {
    1.62  #ifdef ASSERT
    1.63      if (k != NULL) {
    1.64        // Verify that specified klass and TypeAryPtr::klass() follow the same rules.
    1.65 @@ -964,6 +978,7 @@
    1.66    virtual bool eq( const Type *t ) const;
    1.67    virtual int hash() const;     // Type specific hashing
    1.68    const TypeAry *_ary;          // Array we point into
    1.69 +  const bool     _is_autobox_cache;
    1.70  
    1.71    ciKlass* compute_klass(DEBUG_ONLY(bool verify = false)) const;
    1.72  
    1.73 @@ -974,9 +989,11 @@
    1.74    const Type*    elem() const { return _ary->_elem; }
    1.75    const TypeInt* size() const { return _ary->_size; }
    1.76  
    1.77 +  bool is_autobox_cache() const { return _is_autobox_cache; }
    1.78 +
    1.79    static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot);
    1.80    // Constant pointer to array
    1.81 -  static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot);
    1.82 +  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);
    1.83  
    1.84    // Return a 'ptr' version of this type
    1.85    virtual const Type *cast_to_ptr_type(PTR ptr) const;
    1.86 @@ -1504,6 +1521,13 @@
    1.87    return false;
    1.88  }
    1.89  
    1.90 +inline bool Type::is_ptr_to_boxing_obj() const {
    1.91 +  const TypeInstPtr* tp = isa_instptr();
    1.92 +  return (tp != NULL) && (tp->offset() == 0) &&
    1.93 +         tp->klass()->is_instance_klass()  &&
    1.94 +         tp->klass()->as_instance_klass()->is_box_klass();
    1.95 +}
    1.96 +
    1.97  
    1.98  // ===============================================================
    1.99  // Things that need to be 64-bits in the 64-bit build but

mercurial