src/share/vm/opto/type.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6880053 Sdiff src/share/vm/opto

src/share/vm/opto/type.cpp

Print this page




 279   TypePtr::BOTTOM  = TypePtr::make( AnyPtr, TypePtr::BotPTR, OffsetBot );
 280 
 281   TypeRawPtr::BOTTOM = TypeRawPtr::make( TypePtr::BotPTR );
 282   TypeRawPtr::NOTNULL= TypeRawPtr::make( TypePtr::NotNull );
 283 
 284   const Type **fmembar = TypeTuple::fields(0);
 285   TypeTuple::MEMBAR = TypeTuple::make(TypeFunc::Parms+0, fmembar);
 286 
 287   const Type **fsc = (const Type**)shared_type_arena->Amalloc_4(2*sizeof(Type*));
 288   fsc[0] = TypeInt::CC;
 289   fsc[1] = Type::MEMORY;
 290   TypeTuple::STORECONDITIONAL = TypeTuple::make(2, fsc);
 291 
 292   TypeInstPtr::NOTNULL = TypeInstPtr::make(TypePtr::NotNull, current->env()->Object_klass());
 293   TypeInstPtr::BOTTOM  = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass());
 294   TypeInstPtr::MIRROR  = TypeInstPtr::make(TypePtr::NotNull, current->env()->Class_klass());
 295   TypeInstPtr::MARK    = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass(),
 296                                            false, 0, oopDesc::mark_offset_in_bytes());
 297   TypeInstPtr::KLASS   = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass(),
 298                                            false, 0, oopDesc::klass_offset_in_bytes());

 299   TypeOopPtr::BOTTOM  = TypeOopPtr::make(TypePtr::BotPTR, OffsetBot);


 300 
 301   TypeNarrowOop::NULL_PTR = TypeNarrowOop::make( TypePtr::NULL_PTR );
 302   TypeNarrowOop::BOTTOM   = TypeNarrowOop::make( TypeInstPtr::BOTTOM );
 303 
 304   mreg2type[Op_Node] = Type::BOTTOM;
 305   mreg2type[Op_Set ] = 0;
 306   mreg2type[Op_RegN] = TypeNarrowOop::BOTTOM;
 307   mreg2type[Op_RegI] = TypeInt::INT;
 308   mreg2type[Op_RegP] = TypePtr::BOTTOM;
 309   mreg2type[Op_RegF] = Type::FLOAT;
 310   mreg2type[Op_RegD] = Type::DOUBLE;
 311   mreg2type[Op_RegL] = TypeLong::LONG;
 312   mreg2type[Op_RegFlags] = TypeInt::CC;
 313 
 314   TypeAryPtr::RANGE   = TypeAryPtr::make( TypePtr::BotPTR, TypeAry::make(Type::BOTTOM,TypeInt::POS), current->env()->Object_klass(), false, arrayOopDesc::length_offset_in_bytes());
 315 
 316   TypeAryPtr::NARROWOOPS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeNarrowOop::BOTTOM, TypeInt::POS), NULL /*ciArrayKlass::make(o)*/,  false,  Type::OffsetBot);
 317 
 318 #ifdef _LP64
 319   if (UseCompressedOops) {


2154 }
2155 
2156 //------------------------------hash-------------------------------------------
2157 // Type-specific hashing function.
2158 int TypeRawPtr::hash(void) const {
2159   return (intptr_t)_bits + TypePtr::hash();
2160 }
2161 
2162 //------------------------------dump2------------------------------------------
2163 #ifndef PRODUCT
2164 void TypeRawPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
2165   if( _ptr == Constant )
2166     st->print(INTPTR_FORMAT, _bits);
2167   else
2168     st->print("rawptr:%s", ptr_msg[_ptr]);
2169 }
2170 #endif
2171 
2172 //=============================================================================
2173 // Convenience common pre-built type.

2174 const TypeOopPtr *TypeOopPtr::BOTTOM;
2175 
2176 //------------------------------TypeOopPtr-------------------------------------
2177 TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id )
2178   : TypePtr(t, ptr, offset),
2179     _const_oop(o), _klass(k),
2180     _klass_is_exact(xk),
2181     _is_ptr_to_narrowoop(false),
2182     _instance_id(instance_id) {
2183 #ifdef _LP64
2184   if (UseCompressedOops && _offset != 0) {
2185     if (klass() == NULL) {
2186       assert(this->isa_aryptr(), "only arrays without klass");
2187       _is_ptr_to_narrowoop = true;
2188     } else if (_offset == oopDesc::klass_offset_in_bytes()) {
2189       _is_ptr_to_narrowoop = true;
2190     } else if (this->isa_aryptr()) {
2191       _is_ptr_to_narrowoop = (klass()->is_obj_array_klass() &&
2192                              _offset != arrayOopDesc::length_offset_in_bytes());
2193     } else if (klass() == ciEnv::current()->Class_klass() &&


2219           BasicType basic_elem_type = field->layout_type();
2220           _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT ||
2221                                   basic_elem_type == T_ARRAY);
2222         } else if (klass()->equals(ciEnv::current()->Object_klass())) {
2223           // Compile::find_alias_type() cast exactness on all types to verify
2224           // that it does not affect alias type.
2225           _is_ptr_to_narrowoop = true;
2226         } else {
2227           // Type for the copy start in LibraryCallKit::inline_native_clone().
2228           assert(!klass_is_exact(), "only non-exact klass");
2229           _is_ptr_to_narrowoop = true;
2230         }
2231       }
2232     }
2233   }
2234 #endif
2235 }
2236 
2237 //------------------------------make-------------------------------------------
2238 const TypeOopPtr *TypeOopPtr::make(PTR ptr,
2239                                    int offset) {
2240   assert(ptr != Constant, "no constant generic pointers");
2241   ciKlass*  k = ciKlassKlass::make();
2242   bool      xk = false;
2243   ciObject* o = NULL;
2244   return (TypeOopPtr*)(new TypeOopPtr(OopPtr, ptr, k, xk, o, offset, InstanceBot))->hashcons();
2245 }
2246 
2247 
2248 //------------------------------cast_to_ptr_type-------------------------------
2249 const Type *TypeOopPtr::cast_to_ptr_type(PTR ptr) const {
2250   assert(_base == OopPtr, "subclass must override cast_to_ptr_type");
2251   if( ptr == _ptr ) return this;
2252   return make(ptr, _offset);
2253 }
2254 
2255 //-----------------------------cast_to_instance_id----------------------------
2256 const TypeOopPtr *TypeOopPtr::cast_to_instance_id(int instance_id) const {
2257   // There are no instances of a general oop.
2258   // Return self unchanged.
2259   return this;
2260 }
2261 
2262 //-----------------------------cast_to_exactness-------------------------------
2263 const Type *TypeOopPtr::cast_to_exactness(bool klass_is_exact) const {
2264   // There is no such thing as an exact general oop.


2313     // Found an AnyPtr type vs self-OopPtr type
2314     const TypePtr *tp = t->is_ptr();
2315     int offset = meet_offset(tp->offset());
2316     PTR ptr = meet_ptr(tp->ptr());
2317     switch (tp->ptr()) {
2318     case Null:
2319       if (ptr == Null)  return TypePtr::make(AnyPtr, ptr, offset);
2320       // else fall through:
2321     case TopPTR:
2322     case AnyNull:
2323       return make(ptr, offset);
2324     case BotPTR:
2325     case NotNull:
2326       return TypePtr::make(AnyPtr, ptr, offset);
2327     default: typerr(t);
2328     }
2329   }
2330 
2331   case OopPtr: {                 // Meeting to other OopPtrs
2332     const TypeOopPtr *tp = t->is_oopptr();
2333     return make( meet_ptr(tp->ptr()), meet_offset(tp->offset()) );

2334   }
2335 
2336   case InstPtr:                  // For these, flip the call around to cut down
2337   case KlassPtr:                 // on the cases I have to handle.
2338   case AryPtr:
2339     return t->xmeet(this);      // Call in reverse direction
2340 
2341   } // End of switch
2342   return this;                  // Return the double constant
2343 }
2344 
2345 
2346 //------------------------------xdual------------------------------------------
2347 // Dual of a pure heap pointer.  No relevant klass or oop information.
2348 const Type *TypeOopPtr::xdual() const {
2349   assert(klass() == ciKlassKlass::make(), "no klasses here");
2350   assert(const_oop() == NULL,             "no constants here");
2351   return new TypeOopPtr(_base, dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id()  );
2352 }
2353 


2784       if( above_centerline(_ptr) ) { // if( _ptr == TopPTR || _ptr == AnyNull )
2785         // If 'this' (InstPtr) is above the centerline and it is Object class
2786         // then we can subclass in the Java class hierarchy.
2787         if (klass()->equals(ciEnv::current()->Object_klass())) {
2788           // that is, tp's array type is a subtype of my klass
2789           return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id);
2790         }
2791       }
2792       // The other case cannot happen, since I cannot be a subtype of an array.
2793       // The meet falls down to Object class below centerline.
2794       if( ptr == Constant )
2795          ptr = NotNull;
2796       instance_id = InstanceBot;
2797       return make( ptr, ciEnv::current()->Object_klass(), false, NULL, offset, instance_id );
2798     default: typerr(t);
2799     }
2800   }
2801 
2802   case OopPtr: {                // Meeting to OopPtrs
2803     // Found a OopPtr type vs self-InstPtr type
2804     const TypePtr *tp = t->is_oopptr();
2805     int offset = meet_offset(tp->offset());
2806     PTR ptr = meet_ptr(tp->ptr());
2807     switch (tp->ptr()) {
2808     case TopPTR:
2809     case AnyNull: {
2810       int instance_id = meet_instance_id(InstanceTop);
2811       return make(ptr, klass(), klass_is_exact(),
2812                   (ptr == Constant ? const_oop() : NULL), offset, instance_id);
2813     }
2814     case NotNull:
2815     case BotPTR:
2816       return TypeOopPtr::make(ptr, offset);


2817     default: typerr(t);
2818     }
2819   }
2820 
2821   case AnyPtr: {                // Meeting to AnyPtrs
2822     // Found an AnyPtr type vs self-InstPtr type
2823     const TypePtr *tp = t->is_ptr();
2824     int offset = meet_offset(tp->offset());
2825     PTR ptr = meet_ptr(tp->ptr());
2826     switch (tp->ptr()) {
2827     case Null:
2828       if( ptr == Null ) return TypePtr::make( AnyPtr, ptr, offset );
2829       // else fall through to AnyNull
2830     case TopPTR:
2831     case AnyNull: {
2832       int instance_id = meet_instance_id(InstanceTop);
2833       return make( ptr, klass(), klass_is_exact(),
2834                    (ptr == Constant ? const_oop() : NULL), offset, instance_id);
2835     }
2836     case NotNull:


3242   // Mixing ints & oops happens when javac reuses local variables
3243   case Int:
3244   case Long:
3245   case FloatTop:
3246   case FloatCon:
3247   case FloatBot:
3248   case DoubleTop:
3249   case DoubleCon:
3250   case DoubleBot:
3251   case NarrowOop:
3252   case Bottom:                  // Ye Olde Default
3253     return Type::BOTTOM;
3254   case Top:
3255     return this;
3256 
3257   default:                      // All else is a mistake
3258     typerr(t);
3259 
3260   case OopPtr: {                // Meeting to OopPtrs
3261     // Found a OopPtr type vs self-AryPtr type
3262     const TypePtr *tp = t->is_oopptr();
3263     int offset = meet_offset(tp->offset());
3264     PTR ptr = meet_ptr(tp->ptr());
3265     switch (tp->ptr()) {
3266     case TopPTR:
3267     case AnyNull: {
3268       int instance_id = meet_instance_id(InstanceTop);
3269       return make(ptr, (ptr == Constant ? const_oop() : NULL),
3270                   _ary, _klass, _klass_is_exact, offset, instance_id);
3271     }
3272     case BotPTR:
3273     case NotNull:
3274       return TypeOopPtr::make(ptr, offset);


3275     default: ShouldNotReachHere();
3276     }
3277   }
3278 
3279   case AnyPtr: {                // Meeting two AnyPtrs
3280     // Found an AnyPtr type vs self-AryPtr type
3281     const TypePtr *tp = t->is_ptr();
3282     int offset = meet_offset(tp->offset());
3283     PTR ptr = meet_ptr(tp->ptr());
3284     switch (tp->ptr()) {
3285     case TopPTR:
3286       return this;
3287     case BotPTR:
3288     case NotNull:
3289       return TypePtr::make(AnyPtr, ptr, offset);
3290     case Null:
3291       if( ptr == Null ) return TypePtr::make(AnyPtr, ptr, offset);
3292       // else fall through to AnyNull
3293     case AnyNull: {
3294       int instance_id = meet_instance_id(InstanceTop);




 279   TypePtr::BOTTOM  = TypePtr::make( AnyPtr, TypePtr::BotPTR, OffsetBot );
 280 
 281   TypeRawPtr::BOTTOM = TypeRawPtr::make( TypePtr::BotPTR );
 282   TypeRawPtr::NOTNULL= TypeRawPtr::make( TypePtr::NotNull );
 283 
 284   const Type **fmembar = TypeTuple::fields(0);
 285   TypeTuple::MEMBAR = TypeTuple::make(TypeFunc::Parms+0, fmembar);
 286 
 287   const Type **fsc = (const Type**)shared_type_arena->Amalloc_4(2*sizeof(Type*));
 288   fsc[0] = TypeInt::CC;
 289   fsc[1] = Type::MEMORY;
 290   TypeTuple::STORECONDITIONAL = TypeTuple::make(2, fsc);
 291 
 292   TypeInstPtr::NOTNULL = TypeInstPtr::make(TypePtr::NotNull, current->env()->Object_klass());
 293   TypeInstPtr::BOTTOM  = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass());
 294   TypeInstPtr::MIRROR  = TypeInstPtr::make(TypePtr::NotNull, current->env()->Class_klass());
 295   TypeInstPtr::MARK    = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass(),
 296                                            false, 0, oopDesc::mark_offset_in_bytes());
 297   TypeInstPtr::KLASS   = TypeInstPtr::make(TypePtr::BotPTR,  current->env()->Object_klass(),
 298                                            false, 0, oopDesc::klass_offset_in_bytes());
 299 
 300   TypeOopPtr::BOTTOM  = TypeOopPtr::make(TypePtr::BotPTR, OffsetBot);
 301   // Type used for new CheckCastPP node in Object.clone() intrinsic.
 302   TypeOopPtr::NOTNULL = TypeOopPtr::make(TypePtr::NotNull, 0);
 303 
 304   TypeNarrowOop::NULL_PTR = TypeNarrowOop::make( TypePtr::NULL_PTR );
 305   TypeNarrowOop::BOTTOM   = TypeNarrowOop::make( TypeInstPtr::BOTTOM );
 306 
 307   mreg2type[Op_Node] = Type::BOTTOM;
 308   mreg2type[Op_Set ] = 0;
 309   mreg2type[Op_RegN] = TypeNarrowOop::BOTTOM;
 310   mreg2type[Op_RegI] = TypeInt::INT;
 311   mreg2type[Op_RegP] = TypePtr::BOTTOM;
 312   mreg2type[Op_RegF] = Type::FLOAT;
 313   mreg2type[Op_RegD] = Type::DOUBLE;
 314   mreg2type[Op_RegL] = TypeLong::LONG;
 315   mreg2type[Op_RegFlags] = TypeInt::CC;
 316 
 317   TypeAryPtr::RANGE   = TypeAryPtr::make( TypePtr::BotPTR, TypeAry::make(Type::BOTTOM,TypeInt::POS), current->env()->Object_klass(), false, arrayOopDesc::length_offset_in_bytes());
 318 
 319   TypeAryPtr::NARROWOOPS = TypeAryPtr::make(TypePtr::BotPTR, TypeAry::make(TypeNarrowOop::BOTTOM, TypeInt::POS), NULL /*ciArrayKlass::make(o)*/,  false,  Type::OffsetBot);
 320 
 321 #ifdef _LP64
 322   if (UseCompressedOops) {


2157 }
2158 
2159 //------------------------------hash-------------------------------------------
2160 // Type-specific hashing function.
2161 int TypeRawPtr::hash(void) const {
2162   return (intptr_t)_bits + TypePtr::hash();
2163 }
2164 
2165 //------------------------------dump2------------------------------------------
2166 #ifndef PRODUCT
2167 void TypeRawPtr::dump2( Dict &d, uint depth, outputStream *st ) const {
2168   if( _ptr == Constant )
2169     st->print(INTPTR_FORMAT, _bits);
2170   else
2171     st->print("rawptr:%s", ptr_msg[_ptr]);
2172 }
2173 #endif
2174 
2175 //=============================================================================
2176 // Convenience common pre-built type.
2177 const TypeOopPtr *TypeOopPtr::NOTNULL;
2178 const TypeOopPtr *TypeOopPtr::BOTTOM;
2179 
2180 //------------------------------TypeOopPtr-------------------------------------
2181 TypeOopPtr::TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id )
2182   : TypePtr(t, ptr, offset),
2183     _const_oop(o), _klass(k),
2184     _klass_is_exact(xk),
2185     _is_ptr_to_narrowoop(false),
2186     _instance_id(instance_id) {
2187 #ifdef _LP64
2188   if (UseCompressedOops && _offset != 0) {
2189     if (klass() == NULL) {
2190       assert(this->isa_aryptr(), "only arrays without klass");
2191       _is_ptr_to_narrowoop = true;
2192     } else if (_offset == oopDesc::klass_offset_in_bytes()) {
2193       _is_ptr_to_narrowoop = true;
2194     } else if (this->isa_aryptr()) {
2195       _is_ptr_to_narrowoop = (klass()->is_obj_array_klass() &&
2196                              _offset != arrayOopDesc::length_offset_in_bytes());
2197     } else if (klass() == ciEnv::current()->Class_klass() &&


2223           BasicType basic_elem_type = field->layout_type();
2224           _is_ptr_to_narrowoop = (basic_elem_type == T_OBJECT ||
2225                                   basic_elem_type == T_ARRAY);
2226         } else if (klass()->equals(ciEnv::current()->Object_klass())) {
2227           // Compile::find_alias_type() cast exactness on all types to verify
2228           // that it does not affect alias type.
2229           _is_ptr_to_narrowoop = true;
2230         } else {
2231           // Type for the copy start in LibraryCallKit::inline_native_clone().
2232           assert(!klass_is_exact(), "only non-exact klass");
2233           _is_ptr_to_narrowoop = true;
2234         }
2235       }
2236     }
2237   }
2238 #endif
2239 }
2240 
2241 //------------------------------make-------------------------------------------
2242 const TypeOopPtr *TypeOopPtr::make(PTR ptr,
2243                                    int offset, int instance_id) {
2244   assert(ptr != Constant, "no constant generic pointers");
2245   ciKlass*  k = ciKlassKlass::make();
2246   bool      xk = false;
2247   ciObject* o = NULL;
2248   return (TypeOopPtr*)(new TypeOopPtr(OopPtr, ptr, k, xk, o, offset, instance_id))->hashcons();
2249 }
2250 
2251 
2252 //------------------------------cast_to_ptr_type-------------------------------
2253 const Type *TypeOopPtr::cast_to_ptr_type(PTR ptr) const {
2254   assert(_base == OopPtr, "subclass must override cast_to_ptr_type");
2255   if( ptr == _ptr ) return this;
2256   return make(ptr, _offset);
2257 }
2258 
2259 //-----------------------------cast_to_instance_id----------------------------
2260 const TypeOopPtr *TypeOopPtr::cast_to_instance_id(int instance_id) const {
2261   // There are no instances of a general oop.
2262   // Return self unchanged.
2263   return this;
2264 }
2265 
2266 //-----------------------------cast_to_exactness-------------------------------
2267 const Type *TypeOopPtr::cast_to_exactness(bool klass_is_exact) const {
2268   // There is no such thing as an exact general oop.


2317     // Found an AnyPtr type vs self-OopPtr type
2318     const TypePtr *tp = t->is_ptr();
2319     int offset = meet_offset(tp->offset());
2320     PTR ptr = meet_ptr(tp->ptr());
2321     switch (tp->ptr()) {
2322     case Null:
2323       if (ptr == Null)  return TypePtr::make(AnyPtr, ptr, offset);
2324       // else fall through:
2325     case TopPTR:
2326     case AnyNull:
2327       return make(ptr, offset);
2328     case BotPTR:
2329     case NotNull:
2330       return TypePtr::make(AnyPtr, ptr, offset);
2331     default: typerr(t);
2332     }
2333   }
2334 
2335   case OopPtr: {                 // Meeting to other OopPtrs
2336     const TypeOopPtr *tp = t->is_oopptr();
2337     int instance_id = meet_instance_id(tp->instance_id());
2338     return make( meet_ptr(tp->ptr()), meet_offset(tp->offset()), instance_id );
2339   }
2340 
2341   case InstPtr:                  // For these, flip the call around to cut down
2342   case KlassPtr:                 // on the cases I have to handle.
2343   case AryPtr:
2344     return t->xmeet(this);      // Call in reverse direction
2345 
2346   } // End of switch
2347   return this;                  // Return the double constant
2348 }
2349 
2350 
2351 //------------------------------xdual------------------------------------------
2352 // Dual of a pure heap pointer.  No relevant klass or oop information.
2353 const Type *TypeOopPtr::xdual() const {
2354   assert(klass() == ciKlassKlass::make(), "no klasses here");
2355   assert(const_oop() == NULL,             "no constants here");
2356   return new TypeOopPtr(_base, dual_ptr(), klass(), klass_is_exact(), const_oop(), dual_offset(), dual_instance_id()  );
2357 }
2358 


2789       if( above_centerline(_ptr) ) { // if( _ptr == TopPTR || _ptr == AnyNull )
2790         // If 'this' (InstPtr) is above the centerline and it is Object class
2791         // then we can subclass in the Java class hierarchy.
2792         if (klass()->equals(ciEnv::current()->Object_klass())) {
2793           // that is, tp's array type is a subtype of my klass
2794           return TypeAryPtr::make(ptr, tp->ary(), tp->klass(), tp->klass_is_exact(), offset, instance_id);
2795         }
2796       }
2797       // The other case cannot happen, since I cannot be a subtype of an array.
2798       // The meet falls down to Object class below centerline.
2799       if( ptr == Constant )
2800          ptr = NotNull;
2801       instance_id = InstanceBot;
2802       return make( ptr, ciEnv::current()->Object_klass(), false, NULL, offset, instance_id );
2803     default: typerr(t);
2804     }
2805   }
2806 
2807   case OopPtr: {                // Meeting to OopPtrs
2808     // Found a OopPtr type vs self-InstPtr type
2809     const TypeOopPtr *tp = t->is_oopptr();
2810     int offset = meet_offset(tp->offset());
2811     PTR ptr = meet_ptr(tp->ptr());
2812     switch (tp->ptr()) {
2813     case TopPTR:
2814     case AnyNull: {
2815       int instance_id = meet_instance_id(InstanceTop);
2816       return make(ptr, klass(), klass_is_exact(),
2817                   (ptr == Constant ? const_oop() : NULL), offset, instance_id);
2818     }
2819     case NotNull:
2820     case BotPTR: {
2821       int instance_id = meet_instance_id(tp->instance_id());
2822       return TypeOopPtr::make(ptr, offset, instance_id);
2823     }
2824     default: typerr(t);
2825     }
2826   }
2827 
2828   case AnyPtr: {                // Meeting to AnyPtrs
2829     // Found an AnyPtr type vs self-InstPtr type
2830     const TypePtr *tp = t->is_ptr();
2831     int offset = meet_offset(tp->offset());
2832     PTR ptr = meet_ptr(tp->ptr());
2833     switch (tp->ptr()) {
2834     case Null:
2835       if( ptr == Null ) return TypePtr::make( AnyPtr, ptr, offset );
2836       // else fall through to AnyNull
2837     case TopPTR:
2838     case AnyNull: {
2839       int instance_id = meet_instance_id(InstanceTop);
2840       return make( ptr, klass(), klass_is_exact(),
2841                    (ptr == Constant ? const_oop() : NULL), offset, instance_id);
2842     }
2843     case NotNull:


3249   // Mixing ints & oops happens when javac reuses local variables
3250   case Int:
3251   case Long:
3252   case FloatTop:
3253   case FloatCon:
3254   case FloatBot:
3255   case DoubleTop:
3256   case DoubleCon:
3257   case DoubleBot:
3258   case NarrowOop:
3259   case Bottom:                  // Ye Olde Default
3260     return Type::BOTTOM;
3261   case Top:
3262     return this;
3263 
3264   default:                      // All else is a mistake
3265     typerr(t);
3266 
3267   case OopPtr: {                // Meeting to OopPtrs
3268     // Found a OopPtr type vs self-AryPtr type
3269     const TypeOopPtr *tp = t->is_oopptr();
3270     int offset = meet_offset(tp->offset());
3271     PTR ptr = meet_ptr(tp->ptr());
3272     switch (tp->ptr()) {
3273     case TopPTR:
3274     case AnyNull: {
3275       int instance_id = meet_instance_id(InstanceTop);
3276       return make(ptr, (ptr == Constant ? const_oop() : NULL),
3277                   _ary, _klass, _klass_is_exact, offset, instance_id);
3278     }
3279     case BotPTR:
3280     case NotNull: {
3281       int instance_id = meet_instance_id(tp->instance_id());
3282       return TypeOopPtr::make(ptr, offset, instance_id);
3283     }
3284     default: ShouldNotReachHere();
3285     }
3286   }
3287 
3288   case AnyPtr: {                // Meeting two AnyPtrs
3289     // Found an AnyPtr type vs self-AryPtr type
3290     const TypePtr *tp = t->is_ptr();
3291     int offset = meet_offset(tp->offset());
3292     PTR ptr = meet_ptr(tp->ptr());
3293     switch (tp->ptr()) {
3294     case TopPTR:
3295       return this;
3296     case BotPTR:
3297     case NotNull:
3298       return TypePtr::make(AnyPtr, ptr, offset);
3299     case Null:
3300       if( ptr == Null ) return TypePtr::make(AnyPtr, ptr, offset);
3301       // else fall through to AnyNull
3302     case AnyNull: {
3303       int instance_id = meet_instance_id(InstanceTop);


src/share/vm/opto/type.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File