Add pointer support to the reflection code.

From-SVN: r50180
This commit is contained in:
Anthony Green 2002-03-01 05:36:31 +00:00 committed by Anthony Green
parent cc36a670f7
commit 562ff1637f
2 changed files with 49 additions and 29 deletions

View File

@ -1,3 +1,16 @@
2002-02-28 Anthony Green <green@redhat.com>
* java/lang/reflect/natMethod.cc (result): Add void* element.
(_Jv_CallAnyMethodA): Handle FFI_TYPE_POINTER arguments. Move
constructor test.
2002-02-17 Anthony Green <green@redhat.com>
* configure.host (FILE): New macro for specifing File
implementation.
* configure: Rebuilt.
* configure.in: Use FILE. Define HAVE_TIME for newlib targets.
2002-02-27 Adam Megacz <adam@xwt.org>
* java/net/natInetAddress.cc: Changed USE_WINSOCK to WIN32, added

View File

@ -426,6 +426,7 @@ _Jv_CallAnyMethodA (jobject obj,
union
{
ffi_arg i;
jobject o;
jlong l;
jfloat f;
jdouble d;
@ -448,37 +449,43 @@ _Jv_CallAnyMethodA (jobject obj,
// a narrowing conversion for jbyte, jchar, etc. results.
// Note that boolean is handled either by the FFI_TYPE_SINT8 or
// FFI_TYPE_SINT32 case.
switch (rtype->type)
{
case FFI_TYPE_VOID:
break;
case FFI_TYPE_SINT8:
result->b = (jbyte)ffi_result.i;
break;
case FFI_TYPE_SINT16:
result->s = (jshort)ffi_result.i;
break;
case FFI_TYPE_UINT16:
result->c = (jchar)ffi_result.i;
break;
case FFI_TYPE_SINT32:
result->i = (jint)ffi_result.i;
break;
case FFI_TYPE_SINT64:
result->j = (jlong)ffi_result.l;
break;
case FFI_TYPE_FLOAT:
result->f = (jfloat)ffi_result.f;
break;
case FFI_TYPE_DOUBLE:
result->d = (jdouble)ffi_result.d;
break;
default:
JvFail ("Unknown ffi_call return type");
break;
}
if (is_constructor)
result->l = obj;
else
{
switch (rtype->type)
{
case FFI_TYPE_VOID:
break;
case FFI_TYPE_SINT8:
result->b = (jbyte)ffi_result.i;
break;
case FFI_TYPE_SINT16:
result->s = (jshort)ffi_result.i;
break;
case FFI_TYPE_UINT16:
result->c = (jchar)ffi_result.i;
break;
case FFI_TYPE_SINT32:
result->i = (jint)ffi_result.i;
break;
case FFI_TYPE_SINT64:
result->j = (jlong)ffi_result.l;
break;
case FFI_TYPE_FLOAT:
result->f = (jfloat)ffi_result.f;
break;
case FFI_TYPE_DOUBLE:
result->d = (jdouble)ffi_result.d;
break;
case FFI_TYPE_POINTER:
result->l = (jobject)ffi_result.o;
break;
default:
JvFail ("Unknown ffi_call return type");
break;
}
}
return ex;
#else