< prev index next >

src/hotspot/share/ci/ciType.cpp

Print this page




  47 
  48 ciType::ciType(Klass* k) : ciMetadata(k) {
  49   _basic_type = k->is_array_klass() ? T_ARRAY : (k->is_value() ? T_VALUETYPE : T_OBJECT);
  50 }
  51 
  52 
  53 // ------------------------------------------------------------------
  54 // ciType::is_subtype_of
  55 //
  56 bool ciType::is_subtype_of(ciType* type) {
  57   if (this == type)  return true;
  58   if (is_klass() && type->is_klass())
  59     return this->as_klass()->is_subtype_of(type->as_klass());
  60   return false;
  61 }
  62 
  63 // ------------------------------------------------------------------
  64 // ciType::is__Value
  65 //
  66 bool ciType::is__Value() const {
  67   return (this == ciEnv::____Value_klass);
  68 }
  69 
  70 // ------------------------------------------------------------------
  71 // ciType::name
  72 //
  73 // Return the name of this type
  74 const char* ciType::name() {
  75   if (is_primitive_type()) {
  76     return type2name(basic_type());
  77   } else {
  78     assert(is_klass(), "must be");
  79     return as_klass()->name()->as_utf8();
  80   }
  81 }
  82 
  83 // ------------------------------------------------------------------
  84 // ciType::print_impl
  85 //
  86 // Implementation of the print method.
  87 void ciType::print_impl(outputStream* st) {




  47 
  48 ciType::ciType(Klass* k) : ciMetadata(k) {
  49   _basic_type = k->is_array_klass() ? T_ARRAY : (k->is_value() ? T_VALUETYPE : T_OBJECT);
  50 }
  51 
  52 
  53 // ------------------------------------------------------------------
  54 // ciType::is_subtype_of
  55 //
  56 bool ciType::is_subtype_of(ciType* type) {
  57   if (this == type)  return true;
  58   if (is_klass() && type->is_klass())
  59     return this->as_klass()->is_subtype_of(type->as_klass());
  60   return false;
  61 }
  62 
  63 // ------------------------------------------------------------------
  64 // ciType::is__Value
  65 //
  66 bool ciType::is__Value() const {
  67   return false;
  68 }
  69 
  70 // ------------------------------------------------------------------
  71 // ciType::name
  72 //
  73 // Return the name of this type
  74 const char* ciType::name() {
  75   if (is_primitive_type()) {
  76     return type2name(basic_type());
  77   } else {
  78     assert(is_klass(), "must be");
  79     return as_klass()->name()->as_utf8();
  80   }
  81 }
  82 
  83 // ------------------------------------------------------------------
  84 // ciType::print_impl
  85 //
  86 // Implementation of the print method.
  87 void ciType::print_impl(outputStream* st) {


< prev index next >