Class.h (_Jv_GetMethodString): Updated declaration.
* java/lang/Class.h (_Jv_GetMethodString): Updated declaration. * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Updated. * java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Updated. * link.cc (_Jv_GetMethodString): Added 'derived' argument. Changed type of second argument. Rewrote. (make_vtable): Use it. (append_partial_itable): Updated. (layout_vtable_methods): Updated. From-SVN: r95181
This commit is contained in:
parent
51615fd6cd
commit
2a2c6e55e7
5 changed files with 42 additions and 25 deletions
|
@ -1,3 +1,14 @@
|
||||||
|
2005-02-17 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* java/lang/Class.h (_Jv_GetMethodString): Updated declaration.
|
||||||
|
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Updated.
|
||||||
|
* java/lang/natClass.cc (_Jv_LookupInterfaceMethod): Updated.
|
||||||
|
* link.cc (_Jv_GetMethodString): Added 'derived' argument.
|
||||||
|
Changed type of second argument. Rewrote.
|
||||||
|
(make_vtable): Use it.
|
||||||
|
(append_partial_itable): Updated.
|
||||||
|
(layout_vtable_methods): Updated.
|
||||||
|
|
||||||
2005-02-17 Michael Koch <konqueror@gmx.de>
|
2005-02-17 Michael Koch <konqueror@gmx.de>
|
||||||
|
|
||||||
* gnu/java/net/PlainSocketImpl.java
|
* gnu/java/net/PlainSocketImpl.java
|
||||||
|
|
|
@ -228,7 +228,7 @@ void _Jv_InitNewClassFields (jclass klass);
|
||||||
|
|
||||||
// Friend functions and classes in prims.cc
|
// Friend functions and classes in prims.cc
|
||||||
void _Jv_InitPrimClass (jclass, char *, char, int);
|
void _Jv_InitPrimClass (jclass, char *, char, int);
|
||||||
jstring _Jv_GetMethodString (jclass, _Jv_Utf8Const *);
|
jstring _Jv_GetMethodString (jclass, _Jv_Method *, jclass = NULL);
|
||||||
|
|
||||||
jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass,
|
jboolean _Jv_CheckAccess (jclass self_klass, jclass other_klass,
|
||||||
jint flags);
|
jint flags);
|
||||||
|
@ -454,7 +454,7 @@ private:
|
||||||
// in prims.cc
|
// in prims.cc
|
||||||
friend void ::_Jv_InitPrimClass (jclass, char *, char, int);
|
friend void ::_Jv_InitPrimClass (jclass, char *, char, int);
|
||||||
|
|
||||||
friend jstring (::_Jv_GetMethodString) (jclass, _Jv_Utf8Const *);
|
friend jstring (::_Jv_GetMethodString) (jclass, _Jv_Method *, jclass);
|
||||||
|
|
||||||
friend jboolean (::_Jv_CheckAccess) (jclass self_klass, jclass other_klass,
|
friend jboolean (::_Jv_CheckAccess) (jclass self_klass, jclass other_klass,
|
||||||
jint flags);
|
jint flags);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// natClass.cc - Implementation of java.lang.Class native methods.
|
// natClass.cc - Implementation of java.lang.Class native methods.
|
||||||
|
|
||||||
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||||
Free Software Foundation
|
Free Software Foundation
|
||||||
|
|
||||||
This file is part of libgcj.
|
This file is part of libgcj.
|
||||||
|
@ -973,13 +973,13 @@ _Jv_LookupInterfaceMethod (jclass klass, _Jv_Utf8Const *name,
|
||||||
|
|
||||||
if (Modifier::isStatic(meth->accflags))
|
if (Modifier::isStatic(meth->accflags))
|
||||||
throw new java::lang::IncompatibleClassChangeError
|
throw new java::lang::IncompatibleClassChangeError
|
||||||
(_Jv_GetMethodString (klass, meth->name));
|
(_Jv_GetMethodString (klass, meth));
|
||||||
if (Modifier::isAbstract(meth->accflags))
|
if (Modifier::isAbstract(meth->accflags))
|
||||||
throw new java::lang::AbstractMethodError
|
throw new java::lang::AbstractMethodError
|
||||||
(_Jv_GetMethodString (klass, meth->name));
|
(_Jv_GetMethodString (klass, meth));
|
||||||
if (! Modifier::isPublic(meth->accflags))
|
if (! Modifier::isPublic(meth->accflags))
|
||||||
throw new java::lang::IllegalAccessError
|
throw new java::lang::IllegalAccessError
|
||||||
(_Jv_GetMethodString (klass, meth->name));
|
(_Jv_GetMethodString (klass, meth));
|
||||||
|
|
||||||
_Jv_AddMethodToCache (klass, meth);
|
_Jv_AddMethodToCache (klass, meth);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// natMethod.cc - Native code for Method class.
|
// natMethod.cc - Native code for Method class.
|
||||||
|
|
||||||
/* Copyright (C) 1998, 1999, 2000, 2001 , 2002, 2003, 2004 Free Software Foundation
|
/* Copyright (C) 1998, 1999, 2000, 2001 , 2002, 2003, 2004, 2005 Free Software Foundation
|
||||||
|
|
||||||
This file is part of libgcj.
|
This file is part of libgcj.
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ _Jv_CallAnyMethodA (jobject obj,
|
||||||
|| concrete_meth->ncode == NULL
|
|| concrete_meth->ncode == NULL
|
||||||
|| Modifier::isAbstract(concrete_meth->accflags))
|
|| Modifier::isAbstract(concrete_meth->accflags))
|
||||||
throw new java::lang::IncompatibleClassChangeError
|
throw new java::lang::IncompatibleClassChangeError
|
||||||
(_Jv_GetMethodString (vtable->clas, meth->name));
|
(_Jv_GetMethodString (vtable->clas, meth));
|
||||||
ncode = concrete_meth->ncode;
|
ncode = concrete_meth->ncode;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -665,12 +665,21 @@ _Jv_Linker::generate_itable (jclass klass, _Jv_ifaces *ifaces,
|
||||||
|
|
||||||
// Format method name for use in error messages.
|
// Format method name for use in error messages.
|
||||||
jstring
|
jstring
|
||||||
_Jv_GetMethodString (jclass klass, _Jv_Utf8Const *name)
|
_Jv_GetMethodString (jclass klass, _Jv_Method *meth,
|
||||||
|
jclass derived)
|
||||||
{
|
{
|
||||||
jstring r = klass->name->toString();
|
using namespace java::lang;
|
||||||
r = r->concat (JvNewStringUTF ("."));
|
StringBuffer *buf = new StringBuffer (klass->name->toString());
|
||||||
r = r->concat (name->toString());
|
buf->append (jchar ('.'));
|
||||||
return r;
|
buf->append (meth->name->toString());
|
||||||
|
buf->append ((jchar) ' ');
|
||||||
|
buf->append (meth->signature->toString());
|
||||||
|
if (derived)
|
||||||
|
{
|
||||||
|
buf->append(JvNewStringLatin1(" in "));
|
||||||
|
buf->append(derived->name->toString());
|
||||||
|
}
|
||||||
|
return buf->toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -720,13 +729,13 @@ _Jv_Linker::append_partial_itable (jclass klass, jclass iface,
|
||||||
{
|
{
|
||||||
if ((meth->accflags & Modifier::STATIC) != 0)
|
if ((meth->accflags & Modifier::STATIC) != 0)
|
||||||
throw new java::lang::IncompatibleClassChangeError
|
throw new java::lang::IncompatibleClassChangeError
|
||||||
(_Jv_GetMethodString (klass, meth->name));
|
(_Jv_GetMethodString (klass, meth));
|
||||||
if ((meth->accflags & Modifier::ABSTRACT) != 0)
|
if ((meth->accflags & Modifier::ABSTRACT) != 0)
|
||||||
throw new java::lang::AbstractMethodError
|
throw new java::lang::AbstractMethodError
|
||||||
(_Jv_GetMethodString (klass, meth->name));
|
(_Jv_GetMethodString (klass, meth));
|
||||||
if ((meth->accflags & Modifier::PUBLIC) == 0)
|
if ((meth->accflags & Modifier::PUBLIC) == 0)
|
||||||
throw new java::lang::IllegalAccessError
|
throw new java::lang::IllegalAccessError
|
||||||
(_Jv_GetMethodString (klass, meth->name));
|
(_Jv_GetMethodString (klass, meth));
|
||||||
|
|
||||||
itable[pos] = meth->ncode;
|
itable[pos] = meth->ncode;
|
||||||
}
|
}
|
||||||
|
@ -1161,9 +1170,9 @@ _Jv_Linker::layout_vtable_methods (jclass klass)
|
||||||
using namespace java::lang;
|
using namespace java::lang;
|
||||||
StringBuffer *sb = new StringBuffer();
|
StringBuffer *sb = new StringBuffer();
|
||||||
sb->append(JvNewStringLatin1("method "));
|
sb->append(JvNewStringLatin1("method "));
|
||||||
sb->append(_Jv_GetMethodString(klass, meth->name));
|
sb->append(_Jv_GetMethodString(klass, meth));
|
||||||
sb->append(JvNewStringLatin1(" overrides final method "));
|
sb->append(JvNewStringLatin1(" overrides final method "));
|
||||||
sb->append(_Jv_GetMethodString(declarer, super_meth->name));
|
sb->append(_Jv_GetMethodString(declarer, super_meth));
|
||||||
throw new VerifyError(sb->toString());
|
throw new VerifyError(sb->toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1245,18 +1254,15 @@ _Jv_Linker::make_vtable (jclass klass)
|
||||||
if (vtable->get_method(i) == (void *) &_Jv_abstractMethodError)
|
if (vtable->get_method(i) == (void *) &_Jv_abstractMethodError)
|
||||||
{
|
{
|
||||||
using namespace java::lang;
|
using namespace java::lang;
|
||||||
|
jclass orig = klass;
|
||||||
while (klass != NULL)
|
while (klass != NULL)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < klass->method_count; ++j)
|
for (int j = 0; j < klass->method_count; ++j)
|
||||||
{
|
{
|
||||||
if (klass->methods[j].index == i)
|
if (klass->methods[j].index == i)
|
||||||
{
|
throw new AbstractMethodError(_Jv_GetMethodString(klass,
|
||||||
StringBuffer *buf = new StringBuffer ();
|
&klass->methods[j],
|
||||||
buf->append (_Jv_NewStringUtf8Const (klass->methods[j].name));
|
orig));
|
||||||
buf->append ((jchar) ' ');
|
|
||||||
buf->append (_Jv_NewStringUtf8Const (klass->methods[j].signature));
|
|
||||||
throw new AbstractMethodError (buf->toString ());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
klass = klass->getSuperclass ();
|
klass = klass->getSuperclass ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue