- // Create new array class.
- array_class = _Jv_NewClass (array_name, &ObjectClass, element->loader);
-
- // Note that `vtable_method_count' doesn't include the initial
- // NULL slot.
- int dm_count = ObjectClass.vtable_method_count + 1;
-
- // Create a new vtable by copying Object's vtable (except the
- // class pointer, of course). Note that we allocate this as
- // unscanned memory -- the vtables are handled specially by the
- // GC.
- int size = (sizeof (_Jv_VTable) +
- ((dm_count - 1) * sizeof (void *)));
- _Jv_VTable *vtable = (_Jv_VTable *) _Jv_AllocBytes (size);
- vtable->clas = array_class;
- memcpy (vtable->method, ObjectClass.vtable->method,
- dm_count * sizeof (void *));
- array_class->vtable = vtable;
- array_class->vtable_method_count = ObjectClass.vtable_method_count;
-
- // Stash the pointer to the element type.
- array_class->methods = (_Jv_Method *) element;
-
- // Register our interfaces.
- // FIXME: for JDK 1.2 we need Serializable.
- static jclass interfaces[] = { &CloneableClass };
- array_class->interfaces = interfaces;
- array_class->interface_count = 1;
-
- // as per vmspec 5.3.3.2
- array_class->accflags = element->accflags;
-
- // FIXME: initialize other Class instance variables,
- // e.g. `fields'.
-
- // say this class is initialized and ready to go!
- array_class->state = JV_STATE_DONE;
-
- // vmspec, section 5.3.3 describes this
- if (element->loader != loader)
- _Jv_RegisterInitiatingLoader (array_class, loader);
+ _Jv_Linker::wait_for_state(array_class, JV_STATE_PREPARED);
+ array_idt = array_class->idt;
+ array_depth = array_class->depth;
+ array_ancestors = array_class->ancestors;
+ }
+ else
+ {
+ array_class->idt = array_idt;
+ array_class->depth = array_depth;
+ array_class->ancestors = array_ancestors;