From f5ddf15465053a1e7e764e896405bf6ff6756e89 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 21 Sep 2001 09:59:12 -0700 Subject: jvm.h (_Jv_VTable): Handle function descriptors for ia64... * include/jvm.h (_Jv_VTable): Handle function descriptors for ia64; add get_method, set_method, vtable_elt_size, new_vtable. (_Jv_ArrayVTable): Derive from _Jv_VTable. * resolve.cc (_Jv_PrepareClass): Use new _Jv_VTable methods. * interpret.cc (_Jv_InterpMethod::continue1): Likewise. * java/lang/natClassLoader.cc (_Jv_NewArrayClass): Likewise. From-SVN: r45734 --- libjava/java/lang/natClassLoader.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'libjava/java/lang/natClassLoader.cc') diff --git a/libjava/java/lang/natClassLoader.cc b/libjava/java/lang/natClassLoader.cc index 70dea6d..004b9d1 100644 --- a/libjava/java/lang/natClassLoader.cc +++ b/libjava/java/lang/natClassLoader.cc @@ -626,20 +626,17 @@ _Jv_NewArrayClass (jclass element, java::lang::ClassLoader *loader, JvAssert (ObjectClass.vtable_method_count == NUM_OBJECT_METHODS); int dm_count = ObjectClass.vtable_method_count; - // 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 *))); + // Create a new vtable by copying Object's vtable. _Jv_VTable *vtable; if (array_vtable) vtable = array_vtable; else - vtable = (_Jv_VTable *) _Jv_AllocBytes (size); + vtable = _Jv_VTable::new_vtable (dm_count); vtable->clas = array_class; - memcpy (vtable->method, ObjectClass.vtable->method, - dm_count * sizeof (void *)); vtable->gc_descr = ObjectClass.vtable->gc_descr; + for (int i = 0; i < dm_count; ++i) + vtable->set_method (i, ObjectClass.vtable->get_method (i)); + array_class->vtable = vtable; array_class->vtable_method_count = ObjectClass.vtable_method_count; -- cgit v1.1