83
84 ArrayKlass::ArrayKlass(Symbol* name, KlassID id) :
85 Klass(id),
86 _dimension(1),
87 _higher_dimension(NULL),
88 _lower_dimension(NULL) {
89 // Arrays don't add any new methods, so their vtable is the same size as
90 // the vtable of klass Object.
91 set_vtable_length(Universe::base_vtable_size());
92 set_name(name);
93 set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
94 set_layout_helper(Klass::_lh_neutral_value);
95 set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
96 JFR_ONLY(INIT_ID(this);)
97 }
98
99
100 // Initialization of vtables and mirror object is done separatly from base_create_array_klass,
101 // since a GC can happen. At this point all instance variables of the ArrayKlass must be setup.
102 void ArrayKlass::complete_create_array_klass(ArrayKlass* k, Klass* super_klass, ModuleEntry* module_entry, TRAPS) {
103 ResourceMark rm(THREAD);
104 k->initialize_supers(super_klass, NULL, CHECK);
105 k->vtable().initialize_vtable(false, CHECK);
106
107 // During bootstrapping, before java.base is defined, the module_entry may not be present yet.
108 // These classes will be put on a fixup list and their module fields will be patched once
109 // java.base is defined.
110 assert((module_entry != NULL) || ((module_entry == NULL) && !ModuleEntryTable::javabase_defined()),
111 "module entry not available post " JAVA_BASE_NAME " definition");
112 oop module = (module_entry != NULL) ? module_entry->module() : (oop)NULL;
113 java_lang_Class::create_mirror(k, Handle(THREAD, k->class_loader()), Handle(THREAD, module), Handle(), CHECK);
114 }
115
116 GrowableArray<Klass*>* ArrayKlass::compute_secondary_supers(int num_extra_slots,
117 Array<Klass*>* transitive_interfaces) {
118 // interfaces = { cloneable_klass, serializable_klass };
119 assert(num_extra_slots == 0, "sanity of primitive array type");
120 assert(transitive_interfaces == NULL, "sanity");
121 // Must share this for correct bootstrapping!
122 set_secondary_supers(Universe::the_array_interfaces_array());
123 return NULL;
|
83
84 ArrayKlass::ArrayKlass(Symbol* name, KlassID id) :
85 Klass(id),
86 _dimension(1),
87 _higher_dimension(NULL),
88 _lower_dimension(NULL) {
89 // Arrays don't add any new methods, so their vtable is the same size as
90 // the vtable of klass Object.
91 set_vtable_length(Universe::base_vtable_size());
92 set_name(name);
93 set_super(Universe::is_bootstrapping() ? (Klass*)NULL : SystemDictionary::Object_klass());
94 set_layout_helper(Klass::_lh_neutral_value);
95 set_is_cloneable(); // All arrays are considered to be cloneable (See JLS 20.1.5)
96 JFR_ONLY(INIT_ID(this);)
97 }
98
99
100 // Initialization of vtables and mirror object is done separatly from base_create_array_klass,
101 // since a GC can happen. At this point all instance variables of the ArrayKlass must be setup.
102 void ArrayKlass::complete_create_array_klass(ArrayKlass* k, Klass* super_klass, ModuleEntry* module_entry, TRAPS) {
103 k->initialize_supers(super_klass, NULL, CHECK);
104 k->vtable().initialize_vtable(false, CHECK);
105
106 // During bootstrapping, before java.base is defined, the module_entry may not be present yet.
107 // These classes will be put on a fixup list and their module fields will be patched once
108 // java.base is defined.
109 assert((module_entry != NULL) || ((module_entry == NULL) && !ModuleEntryTable::javabase_defined()),
110 "module entry not available post " JAVA_BASE_NAME " definition");
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);
113 }
114
115 GrowableArray<Klass*>* ArrayKlass::compute_secondary_supers(int num_extra_slots,
116 Array<Klass*>* transitive_interfaces) {
117 // interfaces = { cloneable_klass, serializable_klass };
118 assert(num_extra_slots == 0, "sanity of primitive array type");
119 assert(transitive_interfaces == NULL, "sanity");
120 // Must share this for correct bootstrapping!
121 set_secondary_supers(Universe::the_array_interfaces_array());
122 return NULL;
|