< prev index next >

src/hotspot/share/oops/arrayKlass.cpp

Print this page




  79   assert(super(), "super klass must be present");
  80   // Always ignore overpass methods in superclasses, although technically the
  81   // super klass of an array, (j.l.Object) should not have
  82   // any overpass methods present.
  83   return super()->uncached_lookup_method(name, signature, Klass::skip_overpass, private_mode);
  84 }
  85 
  86 ArrayKlass::ArrayKlass(Symbol* name, KlassID id) :
  87   Klass(id),
  88   _dimension(1),
  89   _higher_dimension(NULL),
  90   _lower_dimension(NULL) {
  91     // Arrays don't add any new methods, so their vtable is the same size as
  92     // the vtable of klass Object.
  93     set_vtable_length(Universe::base_vtable_size());
  94     set_name(name);
  95     set_super(Universe::is_bootstrapping() ? NULL : SystemDictionary::Object_klass());
  96     set_layout_helper(Klass::_lh_neutral_value);
  97     set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
  98     JFR_ONLY(INIT_ID(this);)
  99     assert(!ptr_is_value_type(this), "ArrayKlass encoded as value type");
 100 }
 101 
 102 Symbol* ArrayKlass::create_element_klass_array_name(Klass* element_klass, TRAPS) {
 103   Symbol* name = NULL;
 104   if (!element_klass->is_instance_klass() ||
 105       (name = InstanceKlass::cast(element_klass)->array_name()) == NULL) {
 106 
 107     ResourceMark rm(THREAD);
 108     char *name_str = element_klass->name()->as_C_string();
 109     int len = element_klass->name()->utf8_length();
 110     char *new_str = NEW_RESOURCE_ARRAY(char, len + 4);
 111     int idx = 0;
 112     new_str[idx++] = '[';
 113     if (element_klass->is_instance_klass()) { // it could be an array or simple type
 114       // Temporary hack, for arrays of value types, this code should be removed
 115       // once value types have their own array types
 116       new_str[idx++] = 'L';
 117     }
 118     memcpy(&new_str[idx], name_str, len * sizeof(char));
 119     idx += len;




  79   assert(super(), "super klass must be present");
  80   // Always ignore overpass methods in superclasses, although technically the
  81   // super klass of an array, (j.l.Object) should not have
  82   // any overpass methods present.
  83   return super()->uncached_lookup_method(name, signature, Klass::skip_overpass, private_mode);
  84 }
  85 
  86 ArrayKlass::ArrayKlass(Symbol* name, KlassID id) :
  87   Klass(id),
  88   _dimension(1),
  89   _higher_dimension(NULL),
  90   _lower_dimension(NULL) {
  91     // Arrays don't add any new methods, so their vtable is the same size as
  92     // the vtable of klass Object.
  93     set_vtable_length(Universe::base_vtable_size());
  94     set_name(name);
  95     set_super(Universe::is_bootstrapping() ? NULL : SystemDictionary::Object_klass());
  96     set_layout_helper(Klass::_lh_neutral_value);
  97     set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
  98     JFR_ONLY(INIT_ID(this);)

  99 }
 100 
 101 Symbol* ArrayKlass::create_element_klass_array_name(Klass* element_klass, TRAPS) {
 102   Symbol* name = NULL;
 103   if (!element_klass->is_instance_klass() ||
 104       (name = InstanceKlass::cast(element_klass)->array_name()) == NULL) {
 105 
 106     ResourceMark rm(THREAD);
 107     char *name_str = element_klass->name()->as_C_string();
 108     int len = element_klass->name()->utf8_length();
 109     char *new_str = NEW_RESOURCE_ARRAY(char, len + 4);
 110     int idx = 0;
 111     new_str[idx++] = '[';
 112     if (element_klass->is_instance_klass()) { // it could be an array or simple type
 113       // Temporary hack, for arrays of value types, this code should be removed
 114       // once value types have their own array types
 115       new_str[idx++] = 'L';
 116     }
 117     memcpy(&new_str[idx], name_str, len * sizeof(char));
 118     idx += len;


< prev index next >