< prev index next >

src/hotspot/share/opto/type.cpp

Print this page




 249     assert(type == ciTypeFlow::StateVector::null_type(), "");
 250     return TypePtr::NULL_PTR;
 251 
 252   case ciTypeFlow::StateVector::T_LONG2:
 253     // The ciTypeFlow pass pushes a long, then the half.
 254     // We do the same.
 255     assert(type == ciTypeFlow::StateVector::long2_type(), "");
 256     return TypeInt::TOP;
 257 
 258   case ciTypeFlow::StateVector::T_DOUBLE2:
 259     // The ciTypeFlow pass pushes double, then the half.
 260     // Our convention is the same.
 261     assert(type == ciTypeFlow::StateVector::double2_type(), "");
 262     return Type::TOP;
 263 
 264   case T_ADDRESS:
 265     assert(type->is_return_address(), "");
 266     return TypeRawPtr::make((address)(intptr_t)type->as_return_address()->bci());
 267 
 268   case T_VALUETYPE:

 269     return TypeValueType::make(type->as_value_klass());




 270 
 271   default:
 272     // make sure we did not mix up the cases:
 273     assert(type != ciTypeFlow::StateVector::bottom_type(), "");
 274     assert(type != ciTypeFlow::StateVector::top_type(), "");
 275     assert(type != ciTypeFlow::StateVector::null_type(), "");
 276     assert(type != ciTypeFlow::StateVector::long2_type(), "");
 277     assert(type != ciTypeFlow::StateVector::double2_type(), "");
 278     assert(!type->is_return_address(), "");
 279 
 280     return Type::get_const_type(type);
 281   }
 282 }
 283 
 284 
 285 //-----------------------make_from_constant------------------------------------
 286 const Type* Type::make_from_constant(ciConstant constant, bool require_constant,
 287                                      int stable_dimension, bool is_narrow_oop,
 288                                      bool is_autobox_cache) {
 289   switch (constant.basic_type()) {




 249     assert(type == ciTypeFlow::StateVector::null_type(), "");
 250     return TypePtr::NULL_PTR;
 251 
 252   case ciTypeFlow::StateVector::T_LONG2:
 253     // The ciTypeFlow pass pushes a long, then the half.
 254     // We do the same.
 255     assert(type == ciTypeFlow::StateVector::long2_type(), "");
 256     return TypeInt::TOP;
 257 
 258   case ciTypeFlow::StateVector::T_DOUBLE2:
 259     // The ciTypeFlow pass pushes double, then the half.
 260     // Our convention is the same.
 261     assert(type == ciTypeFlow::StateVector::double2_type(), "");
 262     return Type::TOP;
 263 
 264   case T_ADDRESS:
 265     assert(type->is_return_address(), "");
 266     return TypeRawPtr::make((address)(intptr_t)type->as_return_address()->bci());
 267 
 268   case T_VALUETYPE:
 269     if (type->as_value_klass()->is_scalarizable()) {
 270       return TypeValueType::make(type->as_value_klass());
 271     } else {
 272       // Value types cannot be null
 273       return TypeOopPtr::make_from_klass(type->as_klass())->join_speculative(TypePtr::NOTNULL);
 274     }
 275 
 276   default:
 277     // make sure we did not mix up the cases:
 278     assert(type != ciTypeFlow::StateVector::bottom_type(), "");
 279     assert(type != ciTypeFlow::StateVector::top_type(), "");
 280     assert(type != ciTypeFlow::StateVector::null_type(), "");
 281     assert(type != ciTypeFlow::StateVector::long2_type(), "");
 282     assert(type != ciTypeFlow::StateVector::double2_type(), "");
 283     assert(!type->is_return_address(), "");
 284 
 285     return Type::get_const_type(type);
 286   }
 287 }
 288 
 289 
 290 //-----------------------make_from_constant------------------------------------
 291 const Type* Type::make_from_constant(ciConstant constant, bool require_constant,
 292                                      int stable_dimension, bool is_narrow_oop,
 293                                      bool is_autobox_cache) {
 294   switch (constant.basic_type()) {


< prev index next >