re PR libgcj/21906 (hang when invoking abstract method)
gcc/java/: PR libgcj/21906: * class.c (make_method_value): Use soft_abstractmethod_node for abstract method. * java-tree.h (soft_abstractmethod_node): New define. (JTI_SOFT_ABSTRACTMETHOD_NODE): New enum constant. * decl.c (java_init_decl_processing): Initialize soft_abstractmethod_node. libjava/: PR libgcj/21906: * defineclass.cc (handleMethodsEnd): Set ncode for abstract methods. * include/jvm.h (_Jv_ThrowAbstractMethodError): Declare. * link.cc (_Jv_ThrowAbstractMethodError): Renamed. No longer static. (append_partial_itable): Use it. (set_vtable_entries): Likewise. From-SVN: r100992
This commit is contained in:
parent
92b5fbc5ae
commit
fbb4c46b2d
8 changed files with 46 additions and 6 deletions
|
@ -1,3 +1,14 @@
|
|||
2005-06-15 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
PR libgcj/21906:
|
||||
* defineclass.cc (handleMethodsEnd): Set ncode for abstract
|
||||
methods.
|
||||
* include/jvm.h (_Jv_ThrowAbstractMethodError): Declare.
|
||||
* link.cc (_Jv_ThrowAbstractMethodError): Renamed. No longer
|
||||
static.
|
||||
(append_partial_itable): Use it.
|
||||
(set_vtable_entries): Likewise.
|
||||
|
||||
2005-06-15 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* gnu/gcj/runtime/SystemClassLoader.java (init): Clear
|
||||
|
|
|
@ -1288,7 +1288,7 @@ void _Jv_ClassReader::handleMethod
|
|||
throw_class_format_error ("erroneous method access flags");
|
||||
|
||||
// FIXME: JVM spec S4.6: if ABSTRACT modifier is set, verify other
|
||||
// flags are not set. Verify flags for interface methods. Verifiy
|
||||
// flags are not set. Verify flags for interface methods. Verify
|
||||
// modifiers for initializers.
|
||||
}
|
||||
}
|
||||
|
@ -1378,6 +1378,7 @@ void _Jv_ClassReader::handleMethodsEnd ()
|
|||
{
|
||||
if (def_interp->interpreted_methods[i] != 0)
|
||||
throw_class_format_error ("code provided for abstract method");
|
||||
method->ncode = (void *) &_Jv_ThrowAbstractMethodError;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -482,6 +482,8 @@ extern void _Jv_CallAnyMethodA (jobject obj,
|
|||
extern jobject _Jv_NewMultiArray (jclass, jint ndims, jint* dims)
|
||||
__attribute__((__malloc__));
|
||||
|
||||
extern "C" void _Jv_ThrowAbstractMethodError () __attribute__((__noreturn__));
|
||||
|
||||
/* Checked divide subroutines. */
|
||||
extern "C"
|
||||
{
|
||||
|
|
|
@ -714,8 +714,8 @@ _Jv_ThrowNoSuchMethodError ()
|
|||
}
|
||||
|
||||
// This is put in empty vtable slots.
|
||||
static void
|
||||
_Jv_abstractMethodError (void)
|
||||
void
|
||||
_Jv_ThrowAbstractMethodError ()
|
||||
{
|
||||
throw new java::lang::AbstractMethodError();
|
||||
}
|
||||
|
@ -767,7 +767,7 @@ _Jv_Linker::append_partial_itable (jclass klass, jclass iface,
|
|||
(_Jv_GetMethodString (klass, meth));
|
||||
|
||||
if ((meth->accflags & Modifier::ABSTRACT) != 0)
|
||||
itable[pos] = (void *) &_Jv_abstractMethodError;
|
||||
itable[pos] = (void *) &_Jv_ThrowAbstractMethodError;
|
||||
else
|
||||
itable[pos] = meth->ncode;
|
||||
}
|
||||
|
@ -1228,7 +1228,8 @@ _Jv_Linker::set_vtable_entries (jclass klass, _Jv_VTable *vtable)
|
|||
if ((meth->accflags & Modifier::ABSTRACT))
|
||||
// FIXME: it might be nice to have a libffi trampoline here,
|
||||
// so we could pass in the method name and other information.
|
||||
vtable->set_method(meth->index, (void *) &_Jv_abstractMethodError);
|
||||
vtable->set_method(meth->index,
|
||||
(void *) &_Jv_ThrowAbstractMethodError);
|
||||
else
|
||||
vtable->set_method(meth->index, meth->ncode);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue