Commit 562ff163 by Anthony Green Committed by Anthony Green

Add pointer support to the reflection code.

From-SVN: r50180
parent cc36a670
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
......
...@@ -426,6 +426,7 @@ _Jv_CallAnyMethodA (jobject obj, ...@@ -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,37 +449,43 @@ _Jv_CallAnyMethodA (jobject obj, ...@@ -448,37 +449,43 @@ _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.
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) if (is_constructor)
result->l = obj; 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; return ex;
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment