From: David Daney <ddaney@avtrex.com>
To: Java Patches <java-patches@gcc.gnu.org>
Cc: Andrew Haley <aph@redhat.com>,
gcc-patches <gcc-patches@gcc.gnu.org>,
rsandifo@nildram.co.uk
Subject: Re: [Patch] libffi: Fixes for MIPS n32 ABI.
Date: Thu, 06 Dec 2007 22:39:00 -0000 [thread overview]
Message-ID: <47587A13.6000009@avtrex.com> (raw)
In-Reply-To: <18260.22038.699236.865964@zebedee.pink>
[-- Attachment #1: Type: text/plain, Size: 3485 bytes --]
Andrew Haley wrote:
> David Daney writes:
>
> >
> > 2007-12-3 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-3 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.
>
> OK.
>
>
This is the version I actually committed. The original patch used the
wrong test for n32 ABI and had a couple of code formatting issues.
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.
[-- Attachment #2: ffi-1.diff --]
[-- Type: text/x-patch, Size: 16717 bytes --]
Index: libffi/include/ffi.h.in
===================================================================
--- libffi/include/ffi.h.in (revision 130154)
+++ libffi/include/ffi.h.in (working copy)
@@ -193,6 +193,10 @@ typedef struct {
# endif
#endif
+#ifndef FFI_SIZEOF_JAVA_RAW
+# define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG
+#endif
+
typedef union {
ffi_sarg sint;
ffi_arg uint;
@@ -201,6 +205,21 @@ typedef union {
void* ptr;
} ffi_raw;
+#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8
+/* This is a special case for mips64/n32 ABI (and perhaps others) where
+ sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8. */
+typedef union {
+ signed int sint;
+ unsigned int uint;
+ float flt;
+ char data[FFI_SIZEOF_JAVA_RAW];
+ void* ptr;
+} ffi_java_raw;
+#else
+typedef ffi_raw ffi_java_raw;
+#endif
+
+
void ffi_raw_call (ffi_cif *cif,
void (*fn)(),
void *rvalue,
@@ -217,10 +236,10 @@ size_t ffi_raw_size (ffi_cif *cif);
void ffi_java_raw_call (ffi_cif *cif,
void (*fn)(),
void *rvalue,
- ffi_raw *avalue);
+ ffi_java_raw *avalue);
-void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
-void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
+void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
+void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args);
size_t ffi_java_raw_size (ffi_cif *cif);
/* ---- Definitions for closures ----------------------------------------- */
@@ -271,6 +290,27 @@ typedef struct {
} ffi_raw_closure;
+typedef struct {
+ char tramp[FFI_TRAMPOLINE_SIZE];
+
+ ffi_cif *cif;
+
+#if !FFI_NATIVE_RAW_API
+
+ /* if this is enabled, then a raw closure has the same layout
+ as a regular closure. We use this to install an intermediate
+ handler to do the transaltion, void** -> ffi_raw*. */
+
+ void (*translate_args)(ffi_cif*,void*,void**,void*);
+ void *this_closure;
+
+#endif
+
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*);
+ void *user_data;
+
+} ffi_java_raw_closure;
+
ffi_status
ffi_prep_raw_closure (ffi_raw_closure*,
ffi_cif *cif,
@@ -285,15 +325,15 @@ ffi_prep_raw_closure_loc (ffi_raw_closur
void *codeloc);
ffi_status
-ffi_prep_java_raw_closure (ffi_raw_closure*,
+ffi_prep_java_raw_closure (ffi_java_raw_closure*,
ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
void *user_data);
ffi_status
-ffi_prep_java_raw_closure_loc (ffi_raw_closure*,
+ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
void *user_data,
void *codeloc);
Index: libffi/src/java_raw_api.c
===================================================================
--- libffi/src/java_raw_api.c (revision 130154)
+++ libffi/src/java_raw_api.c (working copy)
@@ -54,13 +54,13 @@ ffi_java_raw_size (ffi_cif *cif)
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
case FFI_TYPE_DOUBLE:
- result += 2 * FFI_SIZEOF_ARG;
+ result += 2 * FFI_SIZEOF_JAVA_RAW;
break;
case FFI_TYPE_STRUCT:
/* No structure parameters in Java. */
abort();
default:
- result += FFI_SIZEOF_ARG;
+ result += FFI_SIZEOF_JAVA_RAW;
}
}
@@ -69,7 +69,7 @@ ffi_java_raw_size (ffi_cif *cif)
void
-ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args)
+ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args)
{
unsigned i;
ffi_type **tp = cif->arg_types;
@@ -90,7 +90,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif,
*args = (void*) ((char*)(raw++) + 2);
break;
-#if FFI_SIZEOF_ARG == 8
+#if FFI_SIZEOF_JAVA_RAW == 8
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
case FFI_TYPE_DOUBLE:
@@ -105,7 +105,8 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif,
default:
*args = raw;
- raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+ raw +=
+ ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
}
}
@@ -116,7 +117,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif,
/* then assume little endian */
for (i = 0; i < cif->nargs; i++, tp++, args++)
{
-#if FFI_SIZEOF_ARG == 8
+#if FFI_SIZEOF_JAVA_RAW == 8
switch((*tp)->type) {
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
@@ -127,10 +128,11 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif,
default:
*args = (void*) raw++;
}
-#else /* FFI_SIZEOF_ARG != 8 */
+#else /* FFI_SIZEOF_JAVA_RAW != 8 */
*args = (void*) raw;
- raw += ALIGN ((*tp)->size, sizeof (void*)) / sizeof (void*);
-#endif /* FFI_SIZEOF_ARG == 8 */
+ raw +=
+ ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
+#endif /* FFI_SIZEOF_JAVA_RAW == 8 */
}
#else
@@ -141,7 +143,7 @@ ffi_java_raw_to_ptrarray (ffi_cif *cif,
}
void
-ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw)
+ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw)
{
unsigned i;
ffi_type **tp = cif->arg_types;
@@ -202,7 +204,7 @@ ffi_java_ptrarray_to_raw (ffi_cif *cif,
(raw++)->flt = *(FLOAT32*) (*args);
break;
-#if FFI_SIZEOF_ARG == 8
+#if FFI_SIZEOF_JAVA_RAW == 8
case FFI_TYPE_UINT64:
case FFI_TYPE_SINT64:
case FFI_TYPE_DOUBLE:
@@ -216,11 +218,12 @@ ffi_java_ptrarray_to_raw (ffi_cif *cif,
break;
default:
-#if FFI_SIZEOF_ARG == 8
+#if FFI_SIZEOF_JAVA_RAW == 8
FFI_ASSERT(0); /* Should have covered all cases */
#else
memcpy ((void*) raw->data, (void*)*args, (*tp)->size);
- raw += ALIGN ((*tp)->size, FFI_SIZEOF_ARG) / FFI_SIZEOF_ARG;
+ raw +=
+ ALIGN ((*tp)->size, sizeof(ffi_java_raw)) / sizeof(ffi_java_raw);
#endif
}
}
@@ -244,6 +247,9 @@ ffi_java_rvalue_to_raw (ffi_cif *cif, vo
case FFI_TYPE_SINT16:
case FFI_TYPE_SINT32:
case FFI_TYPE_INT:
+#if FFI_SIZEOF_JAVA_RAW == 4
+ case FFI_TYPE_POINTER:
+#endif
*(SINT64 *)rvalue <<= 32;
break;
@@ -269,6 +275,9 @@ ffi_java_raw_to_rvalue (ffi_cif *cif, vo
case FFI_TYPE_SINT16:
case FFI_TYPE_SINT32:
case FFI_TYPE_INT:
+#if FFI_SIZEOF_JAVA_RAW == 4
+ case FFI_TYPE_POINTER:
+#endif
*(SINT64 *)rvalue >>= 32;
break;
@@ -285,7 +294,8 @@ ffi_java_raw_to_rvalue (ffi_cif *cif, vo
* these following couple of functions will handle the translation forth
* and back automatically. */
-void ffi_java_raw_call (ffi_cif *cif, void (*fn)(), void *rvalue, ffi_raw *raw)
+void ffi_java_raw_call (ffi_cif *cif, void (*fn)(), void *rvalue,
+ ffi_java_raw *raw)
{
void **avalue = (void**) alloca (cif->nargs * sizeof (void*));
ffi_java_raw_to_ptrarray (cif, raw, avalue);
@@ -299,7 +309,7 @@ static void
ffi_java_translate_args (ffi_cif *cif, void *rvalue,
void **avalue, void *user_data)
{
- ffi_raw *raw = (ffi_raw*)alloca (ffi_java_raw_size (cif));
+ ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
ffi_raw_closure *cl = (ffi_raw_closure*)user_data;
ffi_java_ptrarray_to_raw (cif, avalue, raw);
@@ -308,9 +318,9 @@ ffi_java_translate_args (ffi_cif *cif, v
}
ffi_status
-ffi_prep_java_raw_closure_loc (ffi_raw_closure* cl,
+ffi_prep_java_raw_closure_loc (ffi_java_raw_closure* cl,
ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
void *user_data,
void *codeloc)
{
@@ -335,9 +345,9 @@ ffi_prep_java_raw_closure_loc (ffi_raw_c
* the pointer-array format, to the raw format */
ffi_status
-ffi_prep_java_raw_closure (ffi_raw_closure* cl,
+ffi_prep_java_raw_closure (ffi_java_raw_closure* cl,
ffi_cif *cif,
- void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
+ void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
void *user_data)
{
return ffi_prep_java_raw_closure_loc (cl, cif, fun, user_data, cl);
Index: libffi/src/mips/ffitarget.h
===================================================================
--- libffi/src/mips/ffitarget.h (revision 130154)
+++ libffi/src/mips/ffitarget.h (working copy)
@@ -42,10 +42,13 @@
#ifdef FFI_MIPS_O32
/* O32 stack frames have 32bit integer args */
-#define FFI_SIZEOF_ARG 4
+# define FFI_SIZEOF_ARG 4
#else
/* N32 and N64 frames have 64bit integer args */
-#define FFI_SIZEOF_ARG 8
+# define FFI_SIZEOF_ARG 8
+# if _MIPS_SIM == _ABIN32
+# define FFI_SIZEOF_JAVA_RAW 4
+# endif
#endif
#define FFI_FLAG_BITS 2
Index: libjava/interpret.cc
===================================================================
--- libjava/interpret.cc (revision 130154)
+++ libjava/interpret.cc (working copy)
@@ -346,7 +346,7 @@ get4 (unsigned char* loc)
void
_Jv_InterpMethod::run_normal (ffi_cif *,
void *ret,
- ffi_raw *args,
+ INTERP_FFI_RAW_TYPE *args,
void *__this)
{
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
@@ -356,7 +356,7 @@ _Jv_InterpMethod::run_normal (ffi_cif *,
void
_Jv_InterpMethod::run_normal_debug (ffi_cif *,
void *ret,
- ffi_raw *args,
+ INTERP_FFI_RAW_TYPE *args,
void *__this)
{
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
@@ -366,7 +366,7 @@ _Jv_InterpMethod::run_normal_debug (ffi_
void
_Jv_InterpMethod::run_synch_object (ffi_cif *,
void *ret,
- ffi_raw *args,
+ INTERP_FFI_RAW_TYPE *args,
void *__this)
{
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
@@ -380,7 +380,7 @@ _Jv_InterpMethod::run_synch_object (ffi_
void
_Jv_InterpMethod::run_synch_object_debug (ffi_cif *,
void *ret,
- ffi_raw *args,
+ INTERP_FFI_RAW_TYPE *args,
void *__this)
{
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
@@ -394,7 +394,7 @@ _Jv_InterpMethod::run_synch_object_debug
void
_Jv_InterpMethod::run_class (ffi_cif *,
void *ret,
- ffi_raw *args,
+ INTERP_FFI_RAW_TYPE *args,
void *__this)
{
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
@@ -405,7 +405,7 @@ _Jv_InterpMethod::run_class (ffi_cif *,
void
_Jv_InterpMethod::run_class_debug (ffi_cif *,
void *ret,
- ffi_raw *args,
+ INTERP_FFI_RAW_TYPE *args,
void *__this)
{
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
@@ -416,7 +416,7 @@ _Jv_InterpMethod::run_class_debug (ffi_c
void
_Jv_InterpMethod::run_synch_class (ffi_cif *,
void *ret,
- ffi_raw *args,
+ INTERP_FFI_RAW_TYPE *args,
void *__this)
{
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
@@ -431,7 +431,7 @@ _Jv_InterpMethod::run_synch_class (ffi_c
void
_Jv_InterpMethod::run_synch_class_debug (ffi_cif *,
void *ret,
- ffi_raw *args,
+ INTERP_FFI_RAW_TYPE *args,
void *__this)
{
_Jv_InterpMethod *_this = (_Jv_InterpMethod *) __this;
@@ -975,7 +975,8 @@ _Jv_InterpMethod::compile (const void *
/* Run the given method.
When args is NULL, don't run anything -- just compile it. */
void
-_Jv_InterpMethod::run (void *retp, ffi_raw *args, _Jv_InterpMethod *meth)
+_Jv_InterpMethod::run (void *retp, INTERP_FFI_RAW_TYPE *args,
+ _Jv_InterpMethod *meth)
{
#undef DEBUG
#undef DEBUG_LOCALS_INSN
@@ -985,7 +986,8 @@ _Jv_InterpMethod::run (void *retp, ffi_r
}
void
-_Jv_InterpMethod::run_debug (void *retp, ffi_raw *args, _Jv_InterpMethod *meth)
+_Jv_InterpMethod::run_debug (void *retp, INTERP_FFI_RAW_TYPE *args,
+ _Jv_InterpMethod *meth)
{
#define DEBUG
#undef DEBUG_LOCALS_INSN
@@ -1306,27 +1308,32 @@ _Jv_init_cif (_Jv_Utf8Const* signature,
return item_count;
}
-#if FFI_NATIVE_RAW_API
-# define FFI_PREP_RAW_CLOSURE ffi_prep_raw_closure_loc
-# define FFI_RAW_SIZE ffi_raw_size
-#else
-# define FFI_PREP_RAW_CLOSURE ffi_prep_java_raw_closure_loc
-# define FFI_RAW_SIZE ffi_java_raw_size
-#endif
-
/* we put this one here, and not in interpret.cc because it
* calls the utility routines _Jv_count_arguments
* which are static to this module. The following struct defines the
* layout we use for the stubs, it's only used in the ncode method. */
+#if FFI_NATIVE_RAW_API
+# define FFI_PREP_RAW_CLOSURE ffi_prep_raw_closure_loc
+# define FFI_RAW_SIZE ffi_raw_size
typedef struct {
ffi_raw_closure closure;
_Jv_ClosureList list;
ffi_cif cif;
ffi_type *arg_types[0];
} ncode_closure;
-
-typedef void (*ffi_closure_fun) (ffi_cif*,void*,ffi_raw*,void*);
+typedef void (*ffi_closure_fun) (ffi_cif*,void*,INTERP_FFI_RAW_TYPE*,void*);
+#else
+# define FFI_PREP_RAW_CLOSURE ffi_prep_java_raw_closure_loc
+# define FFI_RAW_SIZE ffi_java_raw_size
+typedef struct {
+ ffi_java_raw_closure closure;
+ _Jv_ClosureList list;
+ ffi_cif cif;
+ ffi_type *arg_types[0];
+} ncode_closure;
+typedef void (*ffi_closure_fun) (ffi_cif*,void*,ffi_java_raw*,void*);
+#endif
void *
_Jv_InterpMethod::ncode (jclass klass)
Index: libjava/include/java-interp.h
===================================================================
--- libjava/include/java-interp.h (revision 130154)
+++ libjava/include/java-interp.h (working copy)
@@ -222,18 +222,26 @@ class _Jv_InterpMethod : public _Jv_Meth
void *ncode (jclass);
void compile (const void * const *);
- static void run_normal (ffi_cif*, void*, ffi_raw*, void*);
- static void run_synch_object (ffi_cif*, void*, ffi_raw*, void*);
- static void run_class (ffi_cif*, void*, ffi_raw*, void*);
- static void run_synch_class (ffi_cif*, void*, ffi_raw*, void*);
-
- static void run_normal_debug (ffi_cif*, void*, ffi_raw*, void*);
- static void run_synch_object_debug (ffi_cif*, void*, ffi_raw*, void*);
- static void run_class_debug (ffi_cif*, void*, ffi_raw*, void*);
- static void run_synch_class_debug (ffi_cif*, void*, ffi_raw*, void*);
+#if FFI_NATIVE_RAW_API
+# define INTERP_FFI_RAW_TYPE ffi_raw
+#else
+# define INTERP_FFI_RAW_TYPE ffi_java_raw
+#endif
+
+ static void run_normal (ffi_cif*, void*, INTERP_FFI_RAW_TYPE*, void*);
+ static void run_synch_object (ffi_cif*, void*, INTERP_FFI_RAW_TYPE*, void*);
+ static void run_class (ffi_cif*, void*, INTERP_FFI_RAW_TYPE*, void*);
+ static void run_synch_class (ffi_cif*, void*, INTERP_FFI_RAW_TYPE*, void*);
+
+ static void run_normal_debug (ffi_cif*, void*, INTERP_FFI_RAW_TYPE*, void*);
+ static void run_synch_object_debug (ffi_cif*, void*, INTERP_FFI_RAW_TYPE*,
+ void*);
+ static void run_class_debug (ffi_cif*, void*, INTERP_FFI_RAW_TYPE*, void*);
+ static void run_synch_class_debug (ffi_cif*, void*, INTERP_FFI_RAW_TYPE*,
+ void*);
- static void run (void *, ffi_raw *, _Jv_InterpMethod *);
- static void run_debug (void *, ffi_raw *, _Jv_InterpMethod *);
+ static void run (void *, INTERP_FFI_RAW_TYPE *, _Jv_InterpMethod *);
+ static void run_debug (void *, INTERP_FFI_RAW_TYPE *, _Jv_InterpMethod *);
@@ -361,7 +369,7 @@ class _Jv_JNIMethod : public _Jv_MethodB
ffi_type **jni_arg_types;
// This function is used when making a JNI call from the interpreter.
- static void call (ffi_cif *, void *, ffi_raw *, void *);
+ static void call (ffi_cif *, void *, INTERP_FFI_RAW_TYPE *, void *);
void *ncode (jclass);
Index: libjava/jni.cc
===================================================================
--- libjava/jni.cc (revision 130154)
+++ libjava/jni.cc (working copy)
@@ -2293,7 +2293,8 @@ _Jv_LookupJNIMethod (jclass klass, _Jv_U
// 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 *re
}
}
- 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.
Index: libjava/interpret-run.cc
===================================================================
--- libjava/interpret-run.cc (revision 130154)
+++ libjava/interpret-run.cc (working copy)
@@ -576,7 +576,7 @@ details. */
{
/* here goes the magic again... */
ffi_cif *cif = &rmeth->cif;
- ffi_raw *raw = (ffi_raw*) sp;
+ INTERP_FFI_RAW_TYPE *raw = (INTERP_FFI_RAW_TYPE *) sp;
_Jv_value rvalue;
prev parent reply other threads:[~2007-12-06 22:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 7:09 David Daney
2007-12-01 12:08 ` Richard Sandiford
2007-12-01 18:43 ` David Daney
2007-12-01 19:14 ` Richard Sandiford
2007-12-03 18:56 ` David Daney
2007-12-03 19:16 ` Andrew Haley
2007-12-06 22:39 ` David Daney [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47587A13.6000009@avtrex.com \
--to=ddaney@avtrex.com \
--cc=aph@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=java-patches@gcc.gnu.org \
--cc=rsandifo@nildram.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).