ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not already defined.

2007-12-06  David Daney  <ddaney@avtrex.com>

	* include/ffi.h.in (FFI_SIZEOF_JAVA_RAW): Define if not	already
	defined.
	(ffi_java_raw): New typedef.
	(ffi_java_raw_call, ffi_java_ptrarray_to_raw,
	ffi_java_raw_to_ptrarray): Change parameter types from ffi_raw to
	ffi_java_raw.
	(ffi_java_raw_closure) : Same.
	(ffi_prep_java_raw_closure, ffi_prep_java_raw_closure_loc): Change
	parameter types.
	* src/java_raw_api.c (ffi_java_raw_size):  Replace FFI_SIZEOF_ARG with
	FFI_SIZEOF_JAVA_RAW.
	(ffi_java_raw_to_ptrarray): Change type of raw to ffi_java_raw.
	Replace FFI_SIZEOF_ARG with FFI_SIZEOF_JAVA_RAW. Use
	sizeof(ffi_java_raw) for alignment calculations.
	(ffi_java_ptrarray_to_raw): Same.
	(ffi_java_rvalue_to_raw): Add special handling for FFI_TYPE_POINTER
        if FFI_SIZEOF_JAVA_RAW == 4.
	(ffi_java_raw_to_rvalue): Same.
	(ffi_java_raw_call): Change type of raw to ffi_java_raw.
	(ffi_java_translate_args): Same.
	(ffi_prep_java_raw_closure_loc, ffi_prep_java_raw_closure): Change
	parameter types.
	* src/mips/ffitarget.h (FFI_SIZEOF_JAVA_RAW): Define for N32 ABI.

2007-12-06  David Daney  <ddaney@avtrex.com>

	* interpret.cc: Replace ffi_raw with INTERP_FFI_RAW_TYPE throughout.
	(ncode_closure, ffi_closure_fun): Define versions for
	non-FFI_NATIVE_RAW_API case.
	* include/java-interp.h (INTERP_FFI_RAW_TYPE): Define and use to
	replace	ffi_raw throughout.
	* jni.cc, interpret-run.cc: Replace ffi_raw with INTERP_FFI_RAW_TYPE
	throughout.

From-SVN: r130660
This commit is contained in:
David Daney 2007-12-06 22:02:22 +00:00 committed by David Daney
parent 6af5d898a5
commit 4c42b3d84f
9 changed files with 170 additions and 64 deletions

View file

@ -2293,7 +2293,8 @@ _Jv_LookupJNIMethod (jclass klass, _Jv_Utf8Const *name,
// This function is the stub which is used to turn an ordinary (CNI)
// method call into a JNI call.
void
_Jv_JNIMethod::call (ffi_cif *, void *ret, ffi_raw *args, void *__this)
_Jv_JNIMethod::call (ffi_cif *, void *ret, INTERP_FFI_RAW_TYPE *args,
void *__this)
{
_Jv_JNIMethod* _this = (_Jv_JNIMethod *) __this;
@ -2325,8 +2326,9 @@ _Jv_JNIMethod::call (ffi_cif *, void *ret, ffi_raw *args, void *__this)
}
}
JvAssert (_this->args_raw_size % sizeof (ffi_raw) == 0);
ffi_raw real_args[2 + _this->args_raw_size / sizeof (ffi_raw)];
JvAssert (_this->args_raw_size % sizeof (INTERP_FFI_RAW_TYPE) == 0);
INTERP_FFI_RAW_TYPE
real_args[2 + _this->args_raw_size / sizeof (INTERP_FFI_RAW_TYPE)];
int offset = 0;
// First argument is always the environment pointer.