natVMProxy.cc (ncode_closure): Add method_index.

2007-04-18  Andrew Haley  <aph@redhat.com>

        * java/lang/reflect/natVMProxy.cc (ncode_closure): Add
        method_index.
        (generateProxyClass): Add field $Proxy0.m.  Store methods array in
        it.
        (run_proxy): Retrieve the method to invoke from in $Proxy0.m.
        * java/lang/Class.h: Remove _Jv_LookupProxyMethod.
        * java/lang/natClass.cc: Likewise.
        * headers.txt: Likewise.

From-SVN: r123953
This commit is contained in:
Andrew Haley 2007-04-18 17:10:32 +00:00 committed by Andrew Haley
parent 431f60c0eb
commit 0df38d45e1
5 changed files with 50 additions and 52 deletions

View file

@ -1653,39 +1653,6 @@ _Jv_LookupDeclaredMethod (jclass klass, _Jv_Utf8Const *name,
return NULL;
}
// The rules for finding proxy methods are different: first we search
// the interfaces implemented by a proxy, then the methods declared in
// class Proxy.
java::lang::reflect::Method *
_Jv_LookupProxyMethod (jclass proxyClass, _Jv_Utf8Const *name,
_Jv_Utf8Const *signature)
{
using namespace java::lang::reflect;
jclass declaringClass;
_Jv_Method * m;
for (int i = 0; i < proxyClass->interface_count; i++)
{
declaringClass = proxyClass->interfaces[i];
m = _Jv_GetMethodLocal (declaringClass, name, signature);
if (m)
break;
}
if (!m)
m = _Jv_LookupDeclaredMethod (&Proxy::class$,
name,
signature,
&declaringClass);
Method *rmethod = new Method ();
rmethod->offset = (char*) m - (char*) declaringClass->methods;
rmethod->declaringClass = declaringClass;
return rmethod;
}
java::lang::reflect::Method *
_Jv_GetReflectedMethod (jclass klass, _Jv_Utf8Const *name,
_Jv_Utf8Const *signature)