88 set_vtable_length(Universe::base_vtable_size());
89 set_name(name);
90 set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
91 set_layout_helper(Klass::_lh_neutral_value);
92 set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
93 TRACE_INIT_KLASS_ID(this);
94 }
95
96
97 // Initialization of vtables and mirror object is done separatly from base_create_array_klass,
98 // since a GC can happen. At this point all instance variables of the ArrayKlass must be setup.
99 void ArrayKlass::complete_create_array_klass(ArrayKlass* k, KlassHandle super_klass, ModuleEntry* module_entry, TRAPS) {
100 ResourceMark rm(THREAD);
101 k->initialize_supers(super_klass(), CHECK);
102 k->vtable()->initialize_vtable(false, CHECK);
103
104 // During bootstrapping, before java.base is defined, the module_entry may not be present yet.
105 // These classes will be put on a fixup list and their module fields will be patched once
106 // java.base is defined.
107 assert((module_entry != NULL) || ((module_entry == NULL) && !ModuleEntryTable::javabase_defined()),
108 "module entry not available post java.base definition");
109 oop module = (module_entry != NULL) ? JNIHandles::resolve(module_entry->module()) : (oop)NULL;
110 java_lang_Class::create_mirror(k, Handle(THREAD, k->class_loader()), Handle(THREAD, module), Handle(NULL), CHECK);
111 }
112
113 GrowableArray<Klass*>* ArrayKlass::compute_secondary_supers(int num_extra_slots) {
114 // interfaces = { cloneable_klass, serializable_klass };
115 assert(num_extra_slots == 0, "sanity of primitive array type");
116 // Must share this for correct bootstrapping!
117 set_secondary_supers(Universe::the_array_interfaces_array());
118 return NULL;
119 }
120
121 bool ArrayKlass::compute_is_subtype_of(Klass* k) {
122 // An array is a subtype of Serializable, Clonable, and Object
123 return k == SystemDictionary::Object_klass()
124 || k == SystemDictionary::Cloneable_klass()
125 || k == SystemDictionary::Serializable_klass();
126 }
127
128 objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) {
|
88 set_vtable_length(Universe::base_vtable_size());
89 set_name(name);
90 set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
91 set_layout_helper(Klass::_lh_neutral_value);
92 set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
93 TRACE_INIT_KLASS_ID(this);
94 }
95
96
97 // Initialization of vtables and mirror object is done separatly from base_create_array_klass,
98 // since a GC can happen. At this point all instance variables of the ArrayKlass must be setup.
99 void ArrayKlass::complete_create_array_klass(ArrayKlass* k, KlassHandle super_klass, ModuleEntry* module_entry, TRAPS) {
100 ResourceMark rm(THREAD);
101 k->initialize_supers(super_klass(), CHECK);
102 k->vtable()->initialize_vtable(false, CHECK);
103
104 // During bootstrapping, before java.base is defined, the module_entry may not be present yet.
105 // These classes will be put on a fixup list and their module fields will be patched once
106 // java.base is defined.
107 assert((module_entry != NULL) || ((module_entry == NULL) && !ModuleEntryTable::javabase_defined()),
108 "module entry not available post " JAVA_BASE_NAME " definition");
109 oop module = (module_entry != NULL) ? JNIHandles::resolve(module_entry->module()) : (oop)NULL;
110 java_lang_Class::create_mirror(k, Handle(THREAD, k->class_loader()), Handle(THREAD, module), Handle(NULL), CHECK);
111 }
112
113 GrowableArray<Klass*>* ArrayKlass::compute_secondary_supers(int num_extra_slots) {
114 // interfaces = { cloneable_klass, serializable_klass };
115 assert(num_extra_slots == 0, "sanity of primitive array type");
116 // Must share this for correct bootstrapping!
117 set_secondary_supers(Universe::the_array_interfaces_array());
118 return NULL;
119 }
120
121 bool ArrayKlass::compute_is_subtype_of(Klass* k) {
122 // An array is a subtype of Serializable, Clonable, and Object
123 return k == SystemDictionary::Object_klass()
124 || k == SystemDictionary::Cloneable_klass()
125 || k == SystemDictionary::Serializable_klass();
126 }
127
128 objArrayOop ArrayKlass::allocate_arrayArray(int n, int length, TRAPS) {
|