Changes:
- $Id: asmpart.c 4164 2006-01-12 21:38:11Z twisti $
+ $Id: asmpart.c 4329 2006-01-20 13:40:25Z twisti $
*/
/* true on success, false on exception */
-static bool asm_calljavafunction_intern(methodinfo *m, void *arg1, void *arg2,
- void *arg3, void *arg4)
+static bool intrp_asm_calljavafunction_intern(methodinfo *m,
+ void *arg1, void *arg2,
+ void *arg3, void *arg4)
{
java_objectheader *retval;
Cell *sp = global_sp;
void *arg1, void *arg2,
void *arg3, void *arg4)
{
- if (asm_calljavafunction_intern(m, arg1, arg2, arg3, arg4)) {
+ if (intrp_asm_calljavafunction_intern(m, arg1, arg2, arg3, arg4)) {
if (m->parseddesc->returntype.type == TYPE_ADR)
return (java_objectheader *)(*global_sp++);
else {
{
assert(m->parseddesc->returntype.type == TYPE_INT);
- if (asm_calljavafunction_intern(m, arg1, arg2, arg3, arg4))
+ if (intrp_asm_calljavafunction_intern(m, arg1, arg2, arg3, arg4))
return (s4) (*global_sp++);
else
return 0;
Changes: Christian Thalinger
Anton Ertl
- $Id: codegen.c 4307 2006-01-19 20:56:03Z twisti $
+ $Id: codegen.c 4329 2006-01-20 13:40:25Z twisti $
*/
}
+#if defined(WITH_FFI)
+static ffi_type *cacaotype2ffitype(s4 cacaotype)
+{
+ switch (cacaotype) {
+ case TYPE_INT:
+ return &ffi_type_slong;
+ case TYPE_LNG:
+ return &ffi_type_sint64;
+ case TYPE_FLT:
+ return &ffi_type_float;
+ case TYPE_DBL:
+ return &ffi_type_double;
+ case TYPE_ADR:
+ return &ffi_type_pointer;
+ case TYPE_VOID:
+ return &ffi_type_void;
+ default:
+ assert(false);
+ }
+}
+#endif
+
+
/* native stub:
+---------+
|NATIVECALL|
}
-#if defined(WITH_FFI)
-ffi_type *cacaotype2ffitype(s4 cacaotype)
-{
- switch (cacaotype) {
- case TYPE_INT:
- return &ffi_type_slong;
- case TYPE_LNG:
- return &ffi_type_sint64;
- case TYPE_FLT:
- return &ffi_type_float;
- case TYPE_DBL:
- return &ffi_type_double;
- case TYPE_ADR:
- return &ffi_type_pointer;
- case TYPE_VOID:
- return &ffi_type_void;
- default:
- assert(false);
- }
-}
-#endif
-
-
/* call jni function */
Cell *nativecall(functionptr f, methodinfo *m, Cell *sp, Inst *ra, Cell *fp, u1 *addrcif)
{
break;
case TYPE_FLT:
endsp = sp - 1 + md->paramslots;
-#if WORDS_BIGENDIAN == 1 && SIZEOF_VOID_P == 8 && 0
- av_start_float(alist, f, ((float *) endsp) + 1);
-#else
av_start_float(alist, f, endsp);
-#endif
break;
case TYPE_DBL:
endsp = sp - 2 + md->paramslots;
break;
case TYPE_FLT:
p -= 1;
-#if WORDS_BIGENDIAN == 1 && SIZEOF_VOID_P == 8 && 0
- av_float(alist, *(((float *) p) + 1));
-#else
av_float(alist, *((float *) p));
-#endif
break;
case TYPE_DBL:
p -= 2;
/* for static methods, pass class pointer */
- if (m->flags & ACC_STATIC) {
+ if (m->flags & ACC_STATIC)
*pvalues++ = &m->class;
- }
/* pass parameter to native function */
else
p--;
-#if WORDS_BIGENDIAN == 1 && SIZEOF_VOID_P == 8 && 0
- if (md->paramtypes[i].type == TYPE_FLT)
- *pvalues++ = (void *)(((float *)p)+1);
- else
-#endif
- *pvalues++ = p;
+ *pvalues++ = p;
}
/* calculate position of return value */
codegen_start_native_call((u1 *) (&s + sizeof(s)), m->entrypoint,
(u1 *) fp, (u1 *) ra);
-#if WORDS_BIGENDIAN == 1 && SIZEOF_VOID_P == 8 && 0
- if (md->returntype.type == TYPE_FLT)
- ffi_call(pcif, FFI_FN(f), ((float *) endsp) + 1, values);
- else
-#endif
- ffi_call(pcif, FFI_FN(f), endsp, values);
+ ffi_call(pcif, FFI_FN(f), endsp, values);
codegen_finish_native_call((u1 *) (&s + sizeof(s)));