8484// Known objects
8585Klass* Universe::_typeArrayKlassObjs[T_LONG+1 ] = { NULL /* , NULL...*/ };
8686Klass* Universe::_objectArrayKlassObj = NULL ;
87+ Klass* Universe::_fillerArrayKlassObj = NULL ;
8788OopHandle Universe::_mirrors[T_VOID+1 ];
8889
8990OopHandle Universe::_main_thread_group;
@@ -200,13 +201,19 @@ void Universe::basic_type_classes_do(KlassClosure *closure) {
200201 for (int i = T_BOOLEAN; i < T_LONG+1 ; i++) {
201202 closure->do_klass (_typeArrayKlassObjs[i]);
202203 }
204+ // We don't do the following because it will confuse JVMTI.
205+ // _fillerArrayKlassObj is used only by GC, which doesn't need to see
206+ // this klass from basic_type_classes_do().
207+ //
208+ // closure->do_klass(_fillerArrayKlassObj);
203209}
204210
205211void LatestMethodCache::metaspace_pointers_do (MetaspaceClosure* it) {
206212 it->push (&_klass);
207213}
208214
209215void Universe::metaspace_pointers_do (MetaspaceClosure* it) {
216+ it->push (&_fillerArrayKlassObj);
210217 for (int i = 0 ; i < T_LONG+1 ; i++) {
211218 it->push (&_typeArrayKlassObjs[i]);
212219 }
@@ -255,6 +262,7 @@ void Universe::serialize(SerializeClosure* f) {
255262 }
256263#endif
257264
265+ f->do_ptr ((void **)&_fillerArrayKlassObj);
258266 for (int i = 0 ; i < T_LONG+1 ; i++) {
259267 f->do_ptr ((void **)&_typeArrayKlassObjs[i]);
260268 }
@@ -314,6 +322,10 @@ void Universe::genesis(TRAPS) {
314322 compute_base_vtable_size ();
315323
316324 if (!UseSharedSpaces) {
325+ // Initialization of the fillerArrayKlass must come before regular
326+ // int-TypeArrayKlass so that the int-Array mirror points to the
327+ // int-TypeArrayKlass.
328+ _fillerArrayKlassObj = TypeArrayKlass::create_klass (T_INT, " Ljava/internal/vm/FillerArray;" , CHECK);
317329 for (int i = T_BOOLEAN; i < T_LONG+1 ; i++) {
318330 _typeArrayKlassObjs[i] = TypeArrayKlass::create_klass ((BasicType)i, CHECK);
319331 }
@@ -355,6 +367,8 @@ void Universe::genesis(TRAPS) {
355367 _the_array_interfaces_array->at_put (1 , vmClasses::Serializable_klass ());
356368 }
357369
370+ initialize_basic_type_klass (_fillerArrayKlassObj, CHECK);
371+
358372 initialize_basic_type_klass (boolArrayKlassObj (), CHECK);
359373 initialize_basic_type_klass (charArrayKlassObj (), CHECK);
360374 initialize_basic_type_klass (floatArrayKlassObj (), CHECK);
@@ -363,6 +377,9 @@ void Universe::genesis(TRAPS) {
363377 initialize_basic_type_klass (shortArrayKlassObj (), CHECK);
364378 initialize_basic_type_klass (intArrayKlassObj (), CHECK);
365379 initialize_basic_type_klass (longArrayKlassObj (), CHECK);
380+
381+ assert (_fillerArrayKlassObj != intArrayKlassObj (),
382+ " Internal filler array klass should be different to int array Klass" );
366383 } // end of core bootstrapping
367384
368385 {
0 commit comments