src/hotspot/share/oops/arrayKlass.cpp
changeset 51329 9c68699bebe5
parent 51096 695dff91a997
child 52033 d6aa9ea2405d
equal deleted inserted replaced
51328:fad2334b2906 51329:9c68699bebe5
    47   int size = header_size + vtable_len;
    47   int size = header_size + vtable_len;
    48   return align_metadata_size(size);
    48   return align_metadata_size(size);
    49 }
    49 }
    50 
    50 
    51 
    51 
    52 Klass* ArrayKlass::java_super() const {
    52 InstanceKlass* ArrayKlass::java_super() const {
    53   if (super() == NULL)  return NULL;  // bootstrap case
    53   if (super() == NULL)  return NULL;  // bootstrap case
    54   // Array klasses have primary supertypes which are not reported to Java.
    54   // Array klasses have primary supertypes which are not reported to Java.
    55   // Example super chain:  String[][] -> Object[][] -> Object[] -> Object
    55   // Example super chain:  String[][] -> Object[][] -> Object[] -> Object
    56   return SystemDictionary::Object_klass();
    56   return SystemDictionary::Object_klass();
    57 }
    57 }
    88   _lower_dimension(NULL) {
    88   _lower_dimension(NULL) {
    89     // Arrays don't add any new methods, so their vtable is the same size as
    89     // Arrays don't add any new methods, so their vtable is the same size as
    90     // the vtable of klass Object.
    90     // the vtable of klass Object.
    91     set_vtable_length(Universe::base_vtable_size());
    91     set_vtable_length(Universe::base_vtable_size());
    92     set_name(name);
    92     set_name(name);
    93     set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
    93     set_super(Universe::is_bootstrapping() ? NULL : SystemDictionary::Object_klass());
    94     set_layout_helper(Klass::_lh_neutral_value);
    94     set_layout_helper(Klass::_lh_neutral_value);
    95     set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
    95     set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
    96     JFR_ONLY(INIT_ID(this);)
    96     JFR_ONLY(INIT_ID(this);)
    97 }
    97 }
    98 
    98 
   111   oop module = (module_entry != NULL) ? module_entry->module() : (oop)NULL;
   111   oop module = (module_entry != NULL) ? module_entry->module() : (oop)NULL;
   112   java_lang_Class::create_mirror(k, Handle(THREAD, k->class_loader()), Handle(THREAD, module), Handle(), CHECK);
   112   java_lang_Class::create_mirror(k, Handle(THREAD, k->class_loader()), Handle(THREAD, module), Handle(), CHECK);
   113 }
   113 }
   114 
   114 
   115 GrowableArray<Klass*>* ArrayKlass::compute_secondary_supers(int num_extra_slots,
   115 GrowableArray<Klass*>* ArrayKlass::compute_secondary_supers(int num_extra_slots,
   116                                                             Array<Klass*>* transitive_interfaces) {
   116                                                             Array<InstanceKlass*>* transitive_interfaces) {
   117   // interfaces = { cloneable_klass, serializable_klass };
   117   // interfaces = { cloneable_klass, serializable_klass };
   118   assert(num_extra_slots == 0, "sanity of primitive array type");
   118   assert(num_extra_slots == 0, "sanity of primitive array type");
   119   assert(transitive_interfaces == NULL, "sanity");
   119   assert(transitive_interfaces == NULL, "sanity");
   120   // Must share this for correct bootstrapping!
   120   // Must share this for correct bootstrapping!
   121   set_secondary_supers(Universe::the_array_interfaces_array());
   121   set_secondary_supers(Universe::the_array_interfaces_array());