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> 2002-02-27 Adam Megacz <adam@xwt.org>
* java/net/natInetAddress.cc: Changed USE_WINSOCK to WIN32, added * java/net/natInetAddress.cc: Changed USE_WINSOCK to WIN32, added

View File

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