(vm_vmargs_from_valist): Added.
(vm_vmargs_from_jvalue): Likewise.
(vm_call_method): New function.
(vm_call_method_valist): Likewise.
(vm_call_method_jvalue): Likewise.
(vm_call_method_vmarg): Likewise.
(vm_call_method_int): Likewise.
(vm_call_method_int_valist): Likewise.
(vm_call_method_int_jvalue): Likewise.
(vm_call_method_int_vmarg): Likewise.
(vm_call_method_long): Likewise.
(vm_call_method_long_valist): Likewise.
(vm_call_method_long_jvalue): Likewise.
(vm_call_method_long_vmarg): Likewise.
(vm_call_method_float): Likewise.
(vm_call_method_float_valist): Likewise.
(vm_call_method_float_jvalue): Likewise.
(vm_call_method_float_vmarg): Likewise.
(vm_call_method_double): Likewise.
(vm_call_method_double_valist): Likewise.
(vm_call_method_double_jvalue): Likewise.
(vm_call_method_double_vmarg): Likewise.
* src/vm/vm.h: Likewise.
* src/native/jni.c (_Jv_jni_fill_vmargs_from_vargs): Removed.
(_Jv_jni_vmargs_from_args): Likewise.
(_Jv_jni_CallObjectMethodA): New function.
(_Jv_jni_CallObjectMethod): Use vm_call_method.
(_Jv_jni_CallIntMethod): Likewise.
(_Jv_jni_CallLongMethod): Likewise.
(_Jv_jni_CallFloatMethod): Likewise.
(_Jv_jni_CallDoubleMethod): Likewise.
(_Jv_jni_CallVoidMethod): Likewise.
(_Jv_jni_CallVoidMethodA): Likewise.
(_Jv_jni_invokeNative): Likewise.
(CallObjectMethodA): Implemented.
* src/vm/loader.c (load_class_from_sysloader): Replaced
vm_call_method_intern by vm_call_method.
(load_class_from_classloader): Likewise.
* src/vm/finalizer.c (finalizer_run): Likewise.
* src/vm/initialize.c (initialize_class_intern): Likewise.
* src/vm/jit/stacktrace.c (stacktrace_inline_fillInStackTrace):
Likewise.
* src/vm/exceptions.c (throw_exception_exit_intern): Likewise.
(new_arrayindexoutofboundsexception): Likewise.
* src/vm/properties.c (properties_system_add): Likewise.
* src/cacao/cacao.c (setup_debugger_process): Likewise.
(getmainclassnamefromjar): Likewise.
(main): Likewise.
* src/native/vm/VMClassLoader.c (nativeGetResources): Likewise.
* src/native/native.c (native_new_and_init): Likewise.
(native_new_and_init_string): Likewise.
(native_new_and_init_int): Likewise.
(native_new_and_init_throwable): Likewise.
* src/threads/native/threads.c (threads_init): Likewise.
(threads_startup_thread): Likewise.
* src/cacaoh/headers.c: Likewise.
* src/vm/jit/x86_64/asmpart.S (asm_calljavafunction): Removed.
(asm_calljavafunction2): Renamed to asm_vm_call_method.
* src/vm/jit/intrp/asmpart.c: Likewise.
* src/vm/jit/asmpart.h: Likewise.
Philipp Tomsich
Christian Thalinger
- $Id: cacao.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: cacao.c 4559 2006-03-05 23:24:50Z twisti $
*/
if (!m)
throw_main_exception_exit();
- (void) vm_call_method_intern(m, o, NULL, NULL, NULL);
+ (void) vm_call_method(m, o);
/* configure(transport,NULL) */
m = class_resolveclassmethod(
s = javastring_new_char(transport);
- (void) vm_call_method_intern(m, o, s, NULL, NULL);
+ (void) vm_call_method(m, o, s);
if (!m)
throw_main_exception_exit();
if (!m)
throw_main_exception_exit();
- (void) vm_call_method_intern(m, o, NULL, NULL, NULL);
+ (void) vm_call_method(m, o);
}
#endif
s = javastring_new_char(mainstring);
- (void) vm_call_method_intern(m, o, s, NULL, NULL);
+ (void) vm_call_method(m, o, s);
if (*exceptionptr)
throw_main_exception_exit();
if (!m)
throw_main_exception_exit();
- o = vm_call_method_intern(m, o, NULL, NULL, NULL);
+ o = vm_call_method(m, o);
if (o == NULL) {
fprintf(stderr, "Could not get manifest from %s (invalid or corrupt jarfile?)\n", mainstring);
if (!m)
throw_main_exception_exit();
- o = vm_call_method_intern(m, o, NULL, NULL, NULL);
+ o = vm_call_method(m, o);
if (o == NULL) {
fprintf(stderr, "Could not get main attributes from %s (invalid or corrupt jarfile?)\n", mainstring);
s = javastring_new_char("Main-Class");
- o = vm_call_method_intern(m, o, s, NULL, NULL);
+ o = vm_call_method(m, o, s);
if (!o)
throw_main_exception_exit();
#endif
/* here we go... */
- (void) vm_call_method_intern(m, oa, NULL, NULL, NULL);
+ (void) vm_call_method(m, NULL, oa);
/* exception occurred? */
Philipp Tomsich
Christian Thalinger
- $Id: headers.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: headers.c 4559 2006-03-05 23:24:50Z twisti $
*/
java_objectheader *native_new_and_init_throwable(classinfo *c, java_lang_Throwable *t) { return NULL; }
-java_objectheader *vm_call_method_intern(methodinfo *m, void *a0, void *a1,
- void *a2, void *a3)
+java_objectheader *vm_call_method(methodinfo *m, java_objectheader *o, ...)
{ return NULL; }
Christian Thalinger
Edwin Steiner
- $Id: jni.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: jni.c 4559 2006-03-05 23:24:50Z twisti $
*/
}
-/* _Jv_jni_fill_vmargs_from_vargs **********************************************
-
- XXX
-
-*******************************************************************************/
-
-static void _Jv_jni_vmargs_from_vargs(java_objectheader *o, methoddesc *descr,
- vm_arg *vmargs, va_list ap)
-{
- typedesc *paramtypes;
- s4 i;
-
- paramtypes = descr->paramtypes;
-
- /* if method is non-static fill first block and skip `this' pointer */
-
- i = 0;
-
- if (o != NULL) {
- /* the `this' pointer */
- vmargs[0].type = TYPE_ADR;
- vmargs[0].data = (u8) (ptrint) o;
-
- paramtypes++;
- i++;
- }
-
- for (; i < descr->paramcount; i++, paramtypes++) {
- switch (paramtypes->decltype) {
- /* primitive types */
- case PRIMITIVETYPE_BYTE:
- case PRIMITIVETYPE_CHAR:
- case PRIMITIVETYPE_SHORT:
- case PRIMITIVETYPE_BOOLEAN:
- case PRIMITIVETYPE_INT:
- vmargs[i].type = TYPE_INT;
- vmargs[i].data = (s8) va_arg(ap, s4);
- break;
-
- case PRIMITIVETYPE_LONG:
- vmargs[i].type = TYPE_LNG;
- vmargs[i].data = (s8) va_arg(ap, s8);
- break;
-
- case PRIMITIVETYPE_FLOAT:
- vmargs[i].type = TYPE_FLT;
-#if defined(__ALPHA__)
- /* this keeps the assembler function much simpler */
-
- *((jdouble *) (&vmargs[i].data)) = (jdouble) va_arg(ap, jdouble);
-#else
- *((jfloat *) (&vmargs[i].data)) = (jfloat) va_arg(ap, jdouble);
-#endif
- break;
-
- case PRIMITIVETYPE_DOUBLE:
- vmargs[i].type = TYPE_DBL;
- *((jdouble *) (&vmargs[i].data)) = (jdouble) va_arg(ap, jdouble);
- break;
-
- case TYPE_ADR:
- vmargs[i].type = TYPE_ADR;
- vmargs[i].data = (u8) (ptrint) va_arg(ap, void*);
- break;
- }
- }
-}
-
-
/* _Jv_jni_vmargs_from_objectarray *********************************************
XXX
}
-/* _Jv_jni_vmargs_from_objectarray *********************************************
+/* _Jv_jni_CallObjectMethod ****************************************************
- XXX
+ Internal function to call Java Object methods.
*******************************************************************************/
-static void _Jv_jni_vmargs_from_args(java_objectheader *o, methoddesc *descr,
- vm_arg *vmargs, jvalue *args)
+static java_objectheader *_Jv_jni_CallObjectMethod(java_objectheader *o,
+ vftbl_t *vftbl,
+ methodinfo *m, va_list ap)
{
- typedesc *paramtypes;
- s4 i;
- s4 j;
+ methodinfo *resm;
+ java_objectheader *ro;
- paramtypes = descr->paramtypes;
+ STATISTICS(jniinvokation());
- /* if method is non-static fill first block and skip `this' pointer */
+ if (m == NULL) {
+ exceptions_throw_nullpointerexception();
+ return NULL;
+ }
- i = 0;
+ /* Class initialization is done by the JIT compiler. This is ok
+ since a static method always belongs to the declaring class. */
- if (o != NULL) {
- /* the `this' pointer */
- vmargs[0].type = TYPE_ADR;
- vmargs[0].data = (u8) (ptrint) o;
+ if (m->flags & ACC_STATIC) {
+ /* For static methods we reset the object. */
- paramtypes++;
- i++;
- }
+ if (o != NULL)
+ o = NULL;
- for (j = 0; i < descr->paramcount; i++, j++, paramtypes++) {
- switch (paramtypes->decltype) {
- /* primitive types */
- case PRIMITIVETYPE_BOOLEAN:
- case PRIMITIVETYPE_BYTE:
- case PRIMITIVETYPE_CHAR:
- case PRIMITIVETYPE_SHORT:
- case PRIMITIVETYPE_INT:
- vmargs[i].type = TYPE_INT;
- vmargs[i].data = (s8) args[j].i;
- break;
+ /* for convenience */
- case PRIMITIVETYPE_LONG:
- vmargs[i].type = TYPE_LNG;
- vmargs[i].data = (s8) args[j].j;
- break;
+ resm = m;
- case PRIMITIVETYPE_FLOAT:
- vmargs[i].type = TYPE_FLT;
-#if defined(__ALPHA__)
- /* this keeps the assembler function much simpler */
+ } else {
+ /* For instance methods we make a virtual function table lookup. */
- *((jdouble *) (&vmargs[i].data)) = (jdouble) args[j].f;
-#else
- *((jfloat *) (&vmargs[i].data)) = args[j].f;
-#endif
- break;
+ resm = method_vftbl_lookup(vftbl, m);
+ }
- case PRIMITIVETYPE_DOUBLE:
- vmargs[i].type = TYPE_DBL;
- *((jdouble *) (&vmargs[i].data)) = args[j].d;
- break;
+ STATISTICS(jnicallXmethodnvokation());
- case TYPE_ADR:
- vmargs[i].type = TYPE_ADR;
- vmargs[i].data = (u8) (ptrint) args[j].l;
- break;
- }
- }
+ ro = vm_call_method_valist(resm, o, ap);
+
+ return ro;
}
-/* _Jv_jni_CallObjectMethod ****************************************************
+/* _Jv_jni_CallObjectMethodA ***************************************************
Internal function to call Java Object methods.
*******************************************************************************/
-static java_objectheader *_Jv_jni_CallObjectMethod(java_objectheader *o,
- vftbl_t *vftbl,
- methodinfo *m, va_list ap)
+static java_objectheader *_Jv_jni_CallObjectMethodA(java_objectheader *o,
+ vftbl_t *vftbl,
+ methodinfo *m, jvalue *args)
{
methodinfo *resm;
- s4 paramcount;
- vm_arg *vmargs;
- java_objectheader *ret;
- s4 dumpsize;
+ java_objectheader *ro;
STATISTICS(jniinvokation());
resm = method_vftbl_lookup(vftbl, m);
}
- /* mark start of dump memory area */
-
- dumpsize = dump_size();
-
- paramcount = resm->parseddesc->paramcount;
-
- vmargs = DMNEW(vm_arg, paramcount);
-
- _Jv_jni_vmargs_from_vargs(o, resm->parseddesc, vmargs, ap);
-
STATISTICS(jnicallXmethodnvokation());
- ret = vm_call_method(resm, paramcount, vmargs);
-
- /* release dump area */
-
- dump_release(dumpsize);
+ ro = vm_call_method_jvalue(resm, o, args);
- return ret;
+ return ro;
}
*******************************************************************************/
static jint _Jv_jni_CallIntMethod(java_objectheader *o, vftbl_t *vftbl,
- methodinfo *m, va_list ap, s4 type)
+ methodinfo *m, va_list ap)
{
methodinfo *resm;
- s4 paramcount;
- vm_arg *vmargs;
- jint ret;
- s4 dumpsize;
+ jint i;
STATISTICS(jniinvokation());
resm = method_vftbl_lookup(vftbl, m);
}
- /* mark start of dump memory area */
-
- dumpsize = dump_size();
-
- paramcount = resm->parseddesc->paramcount;
-
- vmargs = DMNEW(vm_arg, paramcount);
-
- _Jv_jni_vmargs_from_vargs(o, resm->parseddesc, vmargs, ap);
-
STATISTICS(jnicallXmethodnvokation());
- ret = vm_call_method_int(resm, paramcount, vmargs);
+ i = vm_call_method_int_valist(resm, o, ap);
- /* release dump area */
-
- dump_release(dumpsize);
-
- return ret;
+ return i;
}
methodinfo *m, va_list ap)
{
methodinfo *resm;
- s4 paramcount;
- vm_arg *vmargs;
- jlong ret;
- s4 dumpsize;
+ jlong l;
STATISTICS(jniinvokation());
resm = method_vftbl_lookup(vftbl, m);
}
- /* mark start of dump memory area */
-
- dumpsize = dump_size();
-
- paramcount = resm->parseddesc->paramcount;
-
- vmargs = DMNEW(vm_arg, paramcount);
-
- _Jv_jni_vmargs_from_vargs(o, resm->parseddesc, vmargs, ap);
-
STATISTICS(jnicallXmethodnvokation());
- ret = vm_call_method_long(resm, paramcount, vmargs);
-
- /* release dump area */
+ l = vm_call_method_long_valist(resm, o, ap);
- dump_release(dumpsize);
-
- return ret;
+ return l;
}
methodinfo *m, va_list ap)
{
methodinfo *resm;
- s4 paramcount;
- vm_arg *vmargs;
- jdouble ret;
- s4 dumpsize;
+ jfloat f;
/* Class initialization is done by the JIT compiler. This is ok
since a static method always belongs to the declaring class. */
resm = method_vftbl_lookup(vftbl, m);
}
- /* mark start of dump memory area */
-
- dumpsize = dump_size();
-
- paramcount = resm->parseddesc->paramcount;
-
- vmargs = DMNEW(vm_arg, paramcount);
-
- _Jv_jni_vmargs_from_vargs(o, resm->parseddesc, vmargs, ap);
-
STATISTICS(jnicallXmethodnvokation());
- ret = vm_call_method_float(resm, paramcount, vmargs);
-
- /* release dump area */
-
- dump_release(dumpsize);
+ f = vm_call_method_float_valist(resm, o, ap);
- return ret;
+ return f;
}
methodinfo *m, va_list ap)
{
methodinfo *resm;
- s4 paramcount;
- vm_arg *vmargs;
- jfloat ret;
- s4 dumpsize;
+ jdouble d;
/* Class initialization is done by the JIT compiler. This is ok
since a static method always belongs to the declaring class. */
resm = method_vftbl_lookup(vftbl, m);
}
- /* mark start of dump memory area */
-
- dumpsize = dump_size();
-
- paramcount = resm->parseddesc->paramcount;
-
- vmargs = DMNEW(vm_arg, paramcount);
+ d = vm_call_method_double_valist(resm, o, ap);
- _Jv_jni_vmargs_from_vargs(o, resm->parseddesc, vmargs, ap);
-
- STATISTICS(jnicallXmethodnvokation());
-
- ret = vm_call_method_double(resm, paramcount, vmargs);
-
- /* release dump area */
-
- dump_release(dumpsize);
-
- return ret;
+ return d;
}
methodinfo *m, va_list ap)
{
methodinfo *resm;
- s4 paramcount;
- vm_arg *vmargs;
- s4 dumpsize;
if (m == NULL) {
exceptions_throw_nullpointerexception();
resm = method_vftbl_lookup(vftbl, m);
}
- /* mark start of dump memory area */
-
- dumpsize = dump_size();
-
- paramcount = resm->parseddesc->paramcount;
-
- vmargs = DMNEW(vm_arg, paramcount);
-
- _Jv_jni_vmargs_from_vargs(o, resm->parseddesc, vmargs, ap);
-
STATISTICS(jnicallXmethodnvokation());
- (void) vm_call_method(resm, paramcount, vmargs);
-
- /* release dump area */
-
- dump_release(dumpsize);
+ (void) vm_call_method_valist(resm, o, ap);
}
methodinfo *m, jvalue *args)
{
methodinfo *resm;
- s4 paramcount;
- vm_arg *vmargs;
- s4 dumpsize;
if (m == NULL) {
exceptions_throw_nullpointerexception();
resm = method_vftbl_lookup(vftbl, m);
}
- /* mark start of dump memory area */
-
- dumpsize = dump_size();
-
- paramcount = resm->parseddesc->paramcount;
-
- vmargs = DMNEW(vm_arg, paramcount);
-
- _Jv_jni_vmargs_from_args(o, resm->parseddesc, vmargs, args);
-
STATISTICS(jnicallXmethodnvokation());
- (void) vm_call_method(resm, paramcount, vmargs);
-
- /* release dump area */
-
- dump_release(dumpsize);
+ (void) vm_call_method_jvalue(resm, o, args);
}
switch (resm->parseddesc->returntype.decltype) {
case TYPE_VOID:
- (void) vm_call_method(resm, argcount, vmargs);
+ (void) vm_call_method_vmarg(resm, argcount, vmargs);
ro = NULL;
break;
s4 i;
java_lang_Boolean *bo;
- i = vm_call_method_int(resm, argcount, vmargs);
+ i = vm_call_method_int_vmarg(resm, argcount, vmargs);
ro = builtin_new(class_java_lang_Boolean);
s4 i;
java_lang_Byte *bo;
- i = vm_call_method_int(resm, argcount, vmargs);
+ i = vm_call_method_int_vmarg(resm, argcount, vmargs);
ro = builtin_new(class_java_lang_Byte);
s4 i;
java_lang_Character *co;
- i = vm_call_method_int(resm, argcount, vmargs);
+ i = vm_call_method_int_vmarg(resm, argcount, vmargs);
ro = builtin_new(class_java_lang_Character);
s4 i;
java_lang_Short *so;
- i = vm_call_method_int(resm, argcount, vmargs);
+ i = vm_call_method_int_vmarg(resm, argcount, vmargs);
ro = builtin_new(class_java_lang_Short);
s4 i;
java_lang_Integer *io;
- i = vm_call_method_int(resm, argcount, vmargs);
+ i = vm_call_method_int_vmarg(resm, argcount, vmargs);
ro = builtin_new(class_java_lang_Integer);
s8 l;
java_lang_Long *lo;
- l = vm_call_method_long(resm, argcount, vmargs);
+ l = vm_call_method_long_vmarg(resm, argcount, vmargs);
ro = builtin_new(class_java_lang_Long);
float f;
java_lang_Float *fo;
- f = vm_call_method_float(resm, argcount, vmargs);
+ f = vm_call_method_float_vmarg(resm, argcount, vmargs);
ro = builtin_new(class_java_lang_Float);
double d;
java_lang_Double *_do;
- d = vm_call_method_double(resm, argcount, vmargs);
+ d = vm_call_method_double_vmarg(resm, argcount, vmargs);
ro = builtin_new(class_java_lang_Double);
break;
case TYPE_ADR:
- ro = vm_call_method(resm, argcount, vmargs);
+ ro = vm_call_method_vmarg(resm, argcount, vmargs);
break;
default:
/* print the stacktrace */
- (void) vm_call_method_intern(m, e, NULL, NULL, NULL);
+ (void) vm_call_method(m, e);
}
}
}
-jobject CallObjectMethodA(JNIEnv *env, jobject obj, jmethodID methodID, jvalue * args)
+jobject CallObjectMethodA(JNIEnv *env, jobject obj, jmethodID methodID, jvalue *args)
{
- log_text("JNI-Call: CallObjectMethodA: IMPLEMENT ME!");
+ java_objectheader *o;
+ methodinfo *m;
+ java_objectheader *ret;
- return NewLocalRef(env, NULL);
+ o = (java_objectheader *) obj;
+ m = (methodinfo *) methodID;
+
+ ret = _Jv_jni_CallObjectMethodA(o, o->vftbl, m, args);
+
+ return NewLocalRef(env, ret);
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- b = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap, PRIMITIVETYPE_BOOLEAN);
+ b = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap);
va_end(ap);
return b;
o = (java_objectheader *) obj;
m = (methodinfo *) methodID;
- b = _Jv_jni_CallIntMethod(o, o->vftbl, m, args, PRIMITIVETYPE_BOOLEAN);
+ b = _Jv_jni_CallIntMethod(o, o->vftbl, m, args);
return b;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- b = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap, PRIMITIVETYPE_BYTE);
+ b = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap);
va_end(ap);
return b;
o = (java_objectheader *) obj;
m = (methodinfo *) methodID;
- b = _Jv_jni_CallIntMethod(o, o->vftbl, m, args, PRIMITIVETYPE_BYTE);
+ b = _Jv_jni_CallIntMethod(o, o->vftbl, m, args);
return b;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- c = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap, PRIMITIVETYPE_CHAR);
+ c = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap);
va_end(ap);
return c;
o = (java_objectheader *) obj;
m = (methodinfo *) methodID;
- c = _Jv_jni_CallIntMethod(o, o->vftbl, m, args, PRIMITIVETYPE_CHAR);
+ c = _Jv_jni_CallIntMethod(o, o->vftbl, m, args);
return c;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- s = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap, PRIMITIVETYPE_SHORT);
+ s = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap);
va_end(ap);
return s;
o = (java_objectheader *) obj;
m = (methodinfo *) methodID;
- s = _Jv_jni_CallIntMethod(o, o->vftbl, m, args, PRIMITIVETYPE_SHORT);
+ s = _Jv_jni_CallIntMethod(o, o->vftbl, m, args);
return s;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- i = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap, PRIMITIVETYPE_INT);
+ i = _Jv_jni_CallIntMethod(o, o->vftbl, m, ap);
va_end(ap);
return i;
o = (java_objectheader *) obj;
m = (methodinfo *) methodID;
- i = _Jv_jni_CallIntMethod(o, o->vftbl, m, args, PRIMITIVETYPE_INT);
+ i = _Jv_jni_CallIntMethod(o, o->vftbl, m, args);
return i;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- b = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap, PRIMITIVETYPE_BOOLEAN);
+ b = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap);
va_end(ap);
return b;
c = (classinfo *) clazz;
m = (methodinfo *) methodID;
- b = _Jv_jni_CallIntMethod(o, c->vftbl, m, args, PRIMITIVETYPE_BOOLEAN);
+ b = _Jv_jni_CallIntMethod(o, c->vftbl, m, args);
return b;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- b = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap, PRIMITIVETYPE_BYTE);
+ b = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap);
va_end(ap);
return b;
c = (classinfo *) clazz;
m = (methodinfo *) methodID;
- b = _Jv_jni_CallIntMethod(o, c->vftbl, m, args, PRIMITIVETYPE_BYTE);
+ b = _Jv_jni_CallIntMethod(o, c->vftbl, m, args);
return b;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- ch = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap, PRIMITIVETYPE_CHAR);
+ ch = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap);
va_end(ap);
return ch;
c = (classinfo *) clazz;
m = (methodinfo *) methodID;
- ch = _Jv_jni_CallIntMethod(o, c->vftbl, m, args, PRIMITIVETYPE_CHAR);
+ ch = _Jv_jni_CallIntMethod(o, c->vftbl, m, args);
return ch;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- s = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap, PRIMITIVETYPE_SHORT);
+ s = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap);
va_end(ap);
return s;
c = (classinfo *) clazz;
m = (methodinfo *) methodID;
- s = _Jv_jni_CallIntMethod(o, c->vftbl, m, args, PRIMITIVETYPE_SHORT);
+ s = _Jv_jni_CallIntMethod(o, c->vftbl, m, args);
return s;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- i = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap, PRIMITIVETYPE_INT);
+ i = _Jv_jni_CallIntMethod(o, c->vftbl, m, ap);
va_end(ap);
return i;
c = (classinfo *) clazz;
m = (methodinfo *) methodID;
- i = _Jv_jni_CallIntMethod(o, c->vftbl, m, args, PRIMITIVETYPE_INT);
+ i = _Jv_jni_CallIntMethod(o, c->vftbl, m, args);
return i;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- b = _Jv_jni_CallIntMethod(NULL, NULL, m, ap, PRIMITIVETYPE_BOOLEAN);
+ b = _Jv_jni_CallIntMethod(NULL, NULL, m, ap);
va_end(ap);
return b;
m = (methodinfo *) methodID;
- b = _Jv_jni_CallIntMethod(NULL, NULL, m, args, PRIMITIVETYPE_BOOLEAN);
+ b = _Jv_jni_CallIntMethod(NULL, NULL, m, args);
return b;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- b = _Jv_jni_CallIntMethod(NULL, NULL, m, ap, PRIMITIVETYPE_BYTE);
+ b = _Jv_jni_CallIntMethod(NULL, NULL, m, ap);
va_end(ap);
return b;
m = (methodinfo *) methodID;
- b = _Jv_jni_CallIntMethod(NULL, NULL, m, args, PRIMITIVETYPE_BYTE);
+ b = _Jv_jni_CallIntMethod(NULL, NULL, m, args);
return b;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- c = _Jv_jni_CallIntMethod(NULL, NULL, m, ap, PRIMITIVETYPE_CHAR);
+ c = _Jv_jni_CallIntMethod(NULL, NULL, m, ap);
va_end(ap);
return c;
m = (methodinfo *) methodID;
- c = _Jv_jni_CallIntMethod(NULL, NULL, m, args, PRIMITIVETYPE_CHAR);
+ c = _Jv_jni_CallIntMethod(NULL, NULL, m, args);
return c;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- s = _Jv_jni_CallIntMethod(NULL, NULL, m, ap, PRIMITIVETYPE_SHORT);
+ s = _Jv_jni_CallIntMethod(NULL, NULL, m, ap);
va_end(ap);
return s;
m = (methodinfo *) methodID;
- s = _Jv_jni_CallIntMethod(NULL, NULL, m, args, PRIMITIVETYPE_SHORT);
+ s = _Jv_jni_CallIntMethod(NULL, NULL, m, args);
return s;
}
m = (methodinfo *) methodID;
va_start(ap, methodID);
- i = _Jv_jni_CallIntMethod(NULL, NULL, m, ap, PRIMITIVETYPE_INT);
+ i = _Jv_jni_CallIntMethod(NULL, NULL, m, ap);
va_end(ap);
return i;
m = (methodinfo *) methodID;
- i = _Jv_jni_CallIntMethod(NULL, NULL, m, args, PRIMITIVETYPE_INT);
+ i = _Jv_jni_CallIntMethod(NULL, NULL, m, args);
return i;
}
builtin_monitorenter(*global_ref_table);
#endif
- o = vm_call_method_intern(getmid, *global_ref_table, lobj, NULL, NULL);
+ o = vm_call_method(getmid, *global_ref_table, lobj);
refcount = (java_lang_Integer *) o;
return NULL;
}
- (void) vm_call_method_intern(putmid, *global_ref_table, lobj, newval,
- NULL);
+ (void) vm_call_method(putmid, *global_ref_table, lobj, newval);
} else {
/* we can access the object itself, as we are in a
builtin_monitorenter(*global_ref_table);
#endif
- o = vm_call_method_intern(getmid, *global_ref_table, globalRef, NULL, NULL);
+ o = vm_call_method(getmid, *global_ref_table, globalRef);
refcount = (java_lang_Integer *) o;
val = refcount->value - 1;
if (val == 0) {
- (void) vm_call_method_intern(removemid, *global_ref_table, refcount,
- NULL, NULL);
+ (void) vm_call_method(removemid, *global_ref_table, refcount);
} else {
/* we do not create a new object, but set the new value into
Changes: Christian Thalinger
- $Id: native.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: native.c 4559 2006-03-05 23:24:50Z twisti $
*/
/* call initializer */
- (void) vm_call_method_intern(m, o, NULL, NULL, NULL);
+ (void) vm_call_method(m, o);
return o;
}
/* call initializer */
- (void) vm_call_method_intern(m, o, s, NULL, NULL);
+ (void) vm_call_method(m, o, s);
return o;
}
/* call initializer */
- (void) vm_call_method_intern(m, o, (void *) (ptrint) i, NULL, NULL);
+ (void) vm_call_method(m, o, i);
return o;
}
/* call initializer */
- (void) vm_call_method_intern(m, o, t, NULL, NULL);
+ (void) vm_call_method(m, o, t);
return o;
}
Christian Thalinger
Edwin Steiner
- $Id: VMClassLoader.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: VMClassLoader.c 4559 2006-03-05 23:24:50Z twisti $
*/
/* if a resource was found, add it to the vector */
if (path) {
- ret = vm_call_method_intern_int(m, o, path, NULL, NULL);
+ ret = vm_call_method_int(m, o, path);
if (ret == 0)
return NULL;
Changes: Christian Thalinger
Edwin Steiner
- $Id: threads.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: threads.c 4559 2006-03-05 23:24:50Z twisti $
*/
if (!method)
return false;
- (void) vm_call_method_intern(method, mainthread, mainthreadobj, threadname,
- (void *) 5);
+ (void) vm_call_method(method, (java_objectheader *) mainthread,
+ mainthreadobj, threadname, 5, false);
if (*exceptionptr)
return false;
mainthread->group = threadgroup;
- /* XXX This is a hack because the fourth argument was omitted */
- mainthread->daemon = false;
/* add mainthread to ThreadGroup */
if (!method)
return false;
- (void) vm_call_method_intern(method, threadgroup, mainthread, NULL, NULL);
+ (void) vm_call_method(method, (java_objectheader *) threadgroup,
+ mainthread);
if (*exceptionptr)
return false;
if (!method)
throw_exception();
- (void) vm_call_method_intern(method, thread, NULL, NULL, NULL);
+ (void) vm_call_method(method, (java_objectheader *) thread);
}
else {
Changes: Edwin Steiner
- $Id: exceptions.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: exceptions.c 4559 2006-03-05 23:24:50Z twisti $
*/
/* print the stacktrace */
if (pss) {
- (void) vm_call_method_intern(pss, xptr, NULL, NULL, NULL);
+ (void) vm_call_method(pss, xptr);
/* This normally means, we are EXTREMLY out of memory or have a */
/* serious problem while printStackTrace. But may be another */
if (m == NULL)
return *exceptionptr;
- o = vm_call_method_intern(m, (void *) (ptrint) index, NULL, NULL, NULL);
+ o = vm_call_method(m, NULL, index);
s = (java_lang_String *) o;
Changes:
- $Id: finalizer.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: finalizer.c 4559 2006-03-05 23:24:50Z twisti $
*/
void finalizer_run(void *o, void *p)
{
- java_objectheader *ob = (java_objectheader *) o;
+ java_objectheader *ob;
+
+ ob = (java_objectheader *) o;
/* call the finalizer function */
- vm_call_method_intern(ob->vftbl->class->finalizer, ob, NULL, NULL, NULL);
+ (void) vm_call_method(ob->vftbl->class->finalizer, ob);
/* if we had an exception in the finalizer, ignore it */
Andreas Krall
Christian Thalinger
- $Id: initialize.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: initialize.c 4559 2006-03-05 23:24:50Z twisti $
*/
/* now call the initializer */
- (void) vm_call_method_intern(m, NULL, NULL, NULL, NULL);
+ (void) vm_call_method(m, NULL);
#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
assert(blockInts == 0);
Changes: Christian Thalinger
- $Id: asmpart.h 4553 2006-03-04 17:19:03Z twisti $
+ $Id: asmpart.h 4559 2006-03-05 23:24:50Z twisti $
*/
void asm_call_jit_compiler(void);
-/*
- This function calls a Java-method (which possibly needs compilation)
- with up to 4 parameters. This function calls a Java-method (which
- possibly needs compilation) with up to 4 parameters.
-*/
-
-#if defined(ENABLE_JIT)
-java_objectheader *asm_calljavafunction(methodinfo *m,
- void *arg1, void *arg2,
- void *arg3, void *arg4);
-
-s4 asm_calljavafunction_int(methodinfo *m,
- void *arg1, void *arg2,
- void *arg3, void *arg4);
-#endif
-
-#if defined(ENABLE_INTRP)
-java_objectheader *intrp_asm_calljavafunction(methodinfo *m,
- void *arg1, void *arg2,
- void *arg3, void *arg4);
-
-s4 intrp_asm_calljavafunction_int(methodinfo *m,
- void *arg1, void *arg2,
- void *arg3, void *arg4);
-#endif
-
-
-/*
- This function calls a Java-method (which possibly needs compilation)
- with up to 4 parameters. This function calls a Java-method (which
- possibly needs compilation) with up to 4 parameters.
- also supports a return value
-*/
-
#if defined(ENABLE_JIT)
-java_objectheader *asm_calljavafunction2(methodinfo *m, u4 count,
- vm_arg *vmargs);
+java_objectheader *asm_vm_call_method(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs);
-s4 asm_calljavafunction2int(methodinfo *m, u4 count, vm_arg *vmargs);
-s8 asm_calljavafunction2long(methodinfo *m, u4 count, vm_arg *vmargs);
-float asm_calljavafunction2float(methodinfo *m, u4 count, vm_arg *vmargs);
-double asm_calljavafunction2double(methodinfo *m, u4 count, vm_arg *vmargs);
+s4 asm_vm_call_method_int(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
+s8 asm_vm_call_method_long(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
+float asm_vm_call_method_float(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
+double asm_vm_call_method_double(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
#endif
#if defined(ENABLE_INTRP)
-java_objectheader *intrp_asm_calljavafunction2(methodinfo *m, u4 count,
- vm_arg *vmargs);
-
-s4 intrp_asm_calljavafunction2int(methodinfo *m, u4 count, vm_arg *vmargs);
-s8 intrp_asm_calljavafunction2long(methodinfo *m, u4 count, vm_arg *vmargs);
-float intrp_asm_calljavafunction2float(methodinfo *m, u4 count, vm_arg *vmargs);
-double intrp_asm_calljavafunction2double(methodinfo *m, u4 count, vm_arg *vmargs);
+java_objectheader *intrp_asm_vm_call_method(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs);
+
+s4 intrp_asm_vm_call_method_int(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs);
+s8 intrp_asm_vm_call_method_long(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs);
+float intrp_asm_vm_call_method_float(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs);
+double intrp_asm_vm_call_method_double(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs);
#endif
/* We need these two labels in codegen.inc to add the asm_calljavafunction*'s
into the methodtable */
#if defined(__I386__) || defined(__X86_64__)
-void calljava_xhandler(void);
void calljava_xhandler2(void);
#endif
Changes:
- $Id: asmpart.c 4550 2006-03-01 17:00:33Z twisti $
+ $Id: asmpart.c 4559 2006-03-05 23:24:50Z twisti $
*/
#include "vm/jit/intrp/intrp.h"
-/* true on success, false on exception */
-
-static bool intrp_asm_calljavafunction_intern(methodinfo *m,
- void *arg1, void *arg2,
- void *arg3, void *arg4)
-{
- java_objectheader *retval;
- Cell *sp;
- methoddesc *md;
- u1 *entrypoint;
-
- sp = global_sp;
- md = m->parseddesc;
-
- CLEAR_global_sp;
- assert(sp != NULL);
-
- /* XXX ugly hack: thread's run() needs 5 arguments */
- assert(md->paramcount < 6);
-
- if (md->paramcount > 0)
- *--sp=(Cell)arg1;
- if (md->paramcount > 1)
- *--sp=(Cell)arg2;
- if (md->paramcount > 2)
- *--sp=(Cell)arg3;
- if (md->paramcount > 3)
- *--sp=(Cell)arg4;
- if (md->paramcount > 4)
- *--sp=(Cell) 0;
-
- entrypoint = createcalljavafunction(m);
-
- retval = engine((Inst *) entrypoint, sp, NULL);
-
- /* XXX remove the method from the method table */
-
- if (retval != NULL) {
- (void) builtin_throw_exception(retval);
- return false;
- }
- else
- return true;
-}
-
-
-java_objectheader *intrp_asm_calljavafunction(methodinfo *m,
- void *arg1, void *arg2,
- void *arg3, void *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_VOID);
- return NULL;
- }
- } else
- return NULL;
-}
-
-
-s4 intrp_asm_calljavafunction_int(methodinfo *m, void *arg1, void *arg2,
- void *arg3, void *arg4)
-{
- assert(m->parseddesc->returntype.type == TYPE_INT);
-
- if (intrp_asm_calljavafunction_intern(m, arg1, arg2, arg3, arg4))
- return (s4) (*global_sp++);
- else
- return 0;
-}
-
-
-/* true on success, false on exception */
-static bool jni_invoke_java_intern(methodinfo *m, u4 count, u4 size,
- jni_callblock *callblock)
+static bool intrp_asm_vm_call_method_intern(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs)
{
java_objectheader *retval;
Cell *sp;
assert(sp != NULL);
- for (i = 0; i < count; i++) {
- switch (callblock[i].itemtype) {
+ for (i = 0; i < vmargscount; i++) {
+ switch (vmargs[i].type) {
case TYPE_INT:
case TYPE_FLT:
case TYPE_ADR:
- *(--sp) = callblock[i].item;
+ *(--sp) = vmargs[i].data;
break;
case TYPE_LNG:
case TYPE_DBL:
sp -= 2;
- *((u8 *) sp) = callblock[i].item;
+ *((u8 *) sp) = vmargs[i].data;
break;
}
}
}
-java_objectheader *intrp_asm_calljavafunction2(methodinfo *m, u4 count, u4 size,
- jni_callblock *callblock)
+java_objectheader *intrp_asm_vm_call_method(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs)
{
java_objectheader *retval = NULL;
- if (jni_invoke_java_intern(m, count, size, callblock)) {
+ if (intrp_asm_vm_call_method_intern(m, vmargscount, vmargs)) {
if (m->parseddesc->returntype.type == TYPE_ADR)
retval = (java_objectheader *)*global_sp++;
else
}
-s4 intrp_asm_calljavafunction2int(methodinfo *m, u4 count, u4 size,
- jni_callblock *callblock)
+s4 intrp_asm_vm_call_method_int(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
{
- s4 retval=0;
+ s4 retval = 0;
- if (jni_invoke_java_intern(m, count, size, callblock)) {
+ if (intrp_asm_vm_call_method_intern(m, vmargscount, vmargs)) {
if (m->parseddesc->returntype.type == TYPE_INT)
retval = *global_sp++;
else
}
-s8 intrp_asm_calljavafunction2long(methodinfo *m, u4 count, u4 size,
- jni_callblock *callblock)
+s8 intrp_asm_vm_call_method_long(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
{
s8 retval;
assert(m->parseddesc->returntype.type == TYPE_LNG);
- if (jni_invoke_java_intern(m, count, size, callblock)) {
+ if (intrp_asm_vm_call_method_intern(m, vmargscount, vmargs)) {
retval = *(s8 *)global_sp;
global_sp += 2;
return retval;
}
-float intrp_asm_calljavafunction2float(methodinfo *m, u4 count, u4 size,
- jni_callblock *callblock)
+float intrp_asm_vm_call_method_float(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs)
{
float retval;
assert(m->parseddesc->returntype.type == TYPE_FLT);
- if (jni_invoke_java_intern(m, count, size, callblock)) {
+ if (intrp_asm_vm_call_method_intern(m, vmargscount, vmargs)) {
retval = *(float *)global_sp;
global_sp += 1;
return retval;
}
-double intrp_asm_calljavafunction2double(methodinfo *m, u4 count, u4 size,
- jni_callblock *callblock)
+double intrp_asm_vm_call_method_double(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs)
{
double retval;
assert(m->parseddesc->returntype.type == TYPE_DBL);
- if (jni_invoke_java_intern(m, count, size, callblock)) {
+ if (intrp_asm_vm_call_method_intern(m, vmargscount, vmargs)) {
retval = *(double *)global_sp;
global_sp += 2;
return retval;
Changes: Christian Thalinger
Edwin Steiner
- $Id: stacktrace.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: stacktrace.c 4559 2006-03-05 23:24:50Z twisti $
*/
/* call function */
- (void) vm_call_method_intern(m, o, NULL, NULL, NULL);
+ (void) vm_call_method(m, o);
/* remove stackframeinfo */
Changes:
- $Id: asmpart.S 4552 2006-03-04 17:15:44Z twisti $
+ $Id: asmpart.S 4559 2006-03-05 23:24:50Z twisti $
*/
/* exported functions and variables *******************************************/
- .globl asm_calljavafunction
- .type asm_calljavafunction, @function
-
- .globl asm_calljavafunction_int
-
- .globl asm_calljavafunction2
- .globl asm_calljavafunction2int
- .globl asm_calljavafunction2long
- .globl asm_calljavafunction2float
- .globl asm_calljavafunction2double
+ .globl asm_vm_call_method
+ .globl asm_vm_call_method_int
+ .globl asm_vm_call_method_long
+ .globl asm_vm_call_method_float
+ .globl asm_vm_call_method_double
.globl asm_call_jit_compiler
.globl asm_handle_exception
.globl asm_getclassvalues_atomic
-/********************* function asm_calljavafunction ***************************
-* *
-* This function calls a Java-method (which possibly needs compilation) *
-* with up to 4 address parameters. *
-* *
-* This functions calls the JIT-compiler which eventually translates the *
-* method into machine code. *
-* *
-* C-prototype: *
-* javaobject_header *asm_calljavamethod (methodinfo *m, *
-* void *arg1, void *arg2, void *arg3, void *arg4); *
-* *
-*******************************************************************************/
-
- .align 8
-
- .quad 0 /* catch type all */
- .quad calljava_xhandler /* handler pc */
- .quad calljava_xhandler /* end pc */
- .quad L_asm_calljavafunction /* start pc */
- .long 1 /* extable size */
- .long 0
- .quad 0 /* line number table start */
- .quad 0 /* line number table size */
- .long 0
- .long 0 /* fltsave */
- .long 0 /* intsave */
- .long 0 /* isleaf */
- .long 0 /* IsSync */
- .long 8 /* frame size */
- .quad 0 /* method pointer (pointer to name) */
-
-asm_calljavafunction:
-asm_calljavafunction_int:
-L_asm_calljavafunction: /* required for PIC code */
- sub $(3*8),sp /* keep stack 16-byte aligned */
- mov bp,0*8(sp)
- mov %rbx,1*8(sp) /* %rbx is not a callee saved in CACAO*/
- mov a0,itmp1 /* move function pointer to itmp1 */
- /* compilerstub uses this */
-
- mov a1,a0 /* pass remaining parameters */
- mov a2,a1
- mov a3,a2
- mov a4,a3
-
- lea L_asm_call_jit_compiler(%rip),itmp3
- call *itmp3 /* call JIT compiler */
-
-L_asm_calljavafunction_return:
- mov 0*8(sp),bp
- mov 1*8(sp),%rbx /* %rbx is not a callee saved in CACAO*/
- add $(3*8),sp /* free stack space */
- ret
-
-calljava_xhandler:
- mov xptr,a0 /* pass exception pointer */
- call builtin_throw_exception@PLT
- xor v0,v0 /* return NULL */
- jmp L_asm_calljavafunction_return
-
-
/********************* function asm_calljavafunction ***************************
* *
* This function calls a Java-method (which possibly needs compilation) *
.quad 0 /* catch type all */
.quad calljava_xhandler2 /* handler pc */
.quad calljava_xhandler2 /* end pc */
- .quad L_asm_calljavafunction2 /* start pc */
+ .quad L_asm_vm_call_method /* start pc */
.long 1 /* extable size */
.long 0
.quad 0 /* line number table start */
.long 24 /* frame size */
.quad 0 /* method pointer (pointer to name) */
-asm_calljavafunction2:
-asm_calljavafunction2int:
-asm_calljavafunction2long:
-asm_calljavafunction2float:
-asm_calljavafunction2double:
-L_asm_calljavafunction2: /* required for PIC code */
+asm_vm_call_method:
+asm_vm_call_method_int:
+asm_vm_call_method_long:
+asm_vm_call_method_float:
+asm_vm_call_method_double:
+L_asm_vm_call_method: /* required for PIC code */
sub $(7*8),sp /* keep stack 16-byte aligned */
mov %rbx,0*8(sp) /* %rbx is not a callee saved in cacao*/
mov s0,1*8(sp)
add bp,sp /* remove argument stack frame if any */
-L_asm_calljavafunction2_return:
+L_asm_vm_call_method_return:
mov 0*8(sp),%rbx /* restore callee saved registers */
mov 1*8(sp),s0
mov 2*8(sp),s1
mov xptr,a0 /* pass exception pointer */
call builtin_throw_exception@PLT
xor v0,v0 /* return NULL */
- jmp L_asm_calljavafunction2_return
+ jmp L_asm_vm_call_method_return
jumptable_integer:
Edwin Steiner
Christian Thalinger
- $Id: loader.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: loader.c 4559 2006-03-05 23:24:50Z twisti $
*/
if (!m)
return false;
- cl = vm_call_method_intern(m, NULL, NULL, NULL, NULL);
+ cl = vm_call_method(m, NULL);
if (!cl)
return false;
s = javastring_new_slash_to_dot(name);
- o = vm_call_method_intern(lc, cl, s, NULL, NULL);
+ o = vm_call_method(lc, cl, s);
c = (classinfo *) o;
Changes:
- $Id: properties.c 4552 2006-03-04 17:15:44Z twisti $
+ $Id: properties.c 4559 2006-03-05 23:24:50Z twisti $
*/
k = javastring_new_char(key);
v = javastring_new_char(value);
- (void) vm_call_method_intern(mput, psystem, k, v, NULL);
+ (void) vm_call_method(mput, (java_objectheader *) psystem, k, v);
}
/* call the exit function with passed exit status */
- (void) vm_call_method_intern(m, (void *) (ptrint) status, NULL, NULL, NULL);
+ (void) vm_call_method(m, NULL, (void *) (ptrint) status);
/* this should never happen */
}
-/* vm_call_method_intern *******************************************************
+/* vm_vmargs_from_valist *******************************************************
- Calls a Java method with a fixed number of arguments (namely 4) and
- returns an address.
+ XXX
*******************************************************************************/
-java_objectheader *vm_call_method_intern(methodinfo *m, void *a0, void *a1,
- void *a2, void *a3)
+static void vm_vmargs_from_valist(methodinfo *m, java_objectheader *o,
+ vm_arg *vmargs, va_list ap)
{
- java_objectheader *o;
+ typedesc *paramtypes;
+ s4 i;
+
+ paramtypes = m->parseddesc->paramtypes;
+
+ /* if method is non-static fill first block and skip `this' pointer */
+
+ i = 0;
+
+ if (o != NULL) {
+ /* the `this' pointer */
+ vmargs[0].type = TYPE_ADR;
+ vmargs[0].data = (u8) (ptrint) o;
+
+ paramtypes++;
+ i++;
+ }
+
+ for (; i < m->parseddesc->paramcount; i++, paramtypes++) {
+ switch (paramtypes->decltype) {
+ /* primitive types */
+ case PRIMITIVETYPE_BOOLEAN:
+ case PRIMITIVETYPE_BYTE:
+ case PRIMITIVETYPE_CHAR:
+ case PRIMITIVETYPE_SHORT:
+ case PRIMITIVETYPE_INT:
+ vmargs[i].type = TYPE_INT;
+ vmargs[i].data = (s8) va_arg(ap, s4);
+ break;
-#if defined(ENABLE_JIT)
-# if defined(ENABLE_INTRP)
- if (opt_intrp)
- o = intrp_asm_calljavafunction(m, a0, a1, a2, a3);
- else
-# endif
- o = asm_calljavafunction(m, a0, a1, a2, a3);
+ case PRIMITIVETYPE_LONG:
+ vmargs[i].type = TYPE_LNG;
+ vmargs[i].data = (s8) va_arg(ap, s8);
+ break;
+
+ case PRIMITIVETYPE_FLOAT:
+ vmargs[i].type = TYPE_FLT;
+#if defined(__ALPHA__)
+ /* this keeps the assembler function much simpler */
+
+ *((jdouble *) (&vmargs[i].data)) = (jdouble) va_arg(ap, jdouble);
#else
- o = intrp_asm_calljavafunction(m, a0, a1, a2, a3);
+ *((jfloat *) (&vmargs[i].data)) = (jfloat) va_arg(ap, jdouble);
#endif
+ break;
- return o;
+ case PRIMITIVETYPE_DOUBLE:
+ vmargs[i].type = TYPE_DBL;
+ *((jdouble *) (&vmargs[i].data)) = (jdouble) va_arg(ap, jdouble);
+ break;
+
+ case TYPE_ADR:
+ vmargs[i].type = TYPE_ADR;
+ vmargs[i].data = (u8) (ptrint) va_arg(ap, void*);
+ break;
+ }
+ }
}
-/* vm_call_method_intern_int ***************************************************
+/* vm_vmargs_from_jvalue *******************************************************
- Calls a Java method with a fixed number of arguments (namely 4) and
- returns an integer (s4).
+ XXX
*******************************************************************************/
-s4 vm_call_method_intern_int(methodinfo *m, void *a0, void *a1, void *a2,
- void *a3)
+static void vm_vmargs_from_jvalue(methodinfo *m, java_objectheader *o,
+ vm_arg *vmargs, jvalue *args)
{
- s4 i;
+ typedesc *paramtypes;
+ s4 i;
+ s4 j;
+
+ paramtypes = m->parseddesc->paramtypes;
+
+ /* if method is non-static fill first block and skip `this' pointer */
+
+ i = 0;
+
+ if (o != NULL) {
+ /* the `this' pointer */
+ vmargs[0].type = TYPE_ADR;
+ vmargs[0].data = (u8) (ptrint) o;
+
+ paramtypes++;
+ i++;
+ }
+
+ for (j = 0; i < m->parseddesc->paramcount; i++, j++, paramtypes++) {
+ switch (paramtypes->decltype) {
+ /* primitive types */
+ case PRIMITIVETYPE_BOOLEAN:
+ case PRIMITIVETYPE_BYTE:
+ case PRIMITIVETYPE_CHAR:
+ case PRIMITIVETYPE_SHORT:
+ case PRIMITIVETYPE_INT:
+ vmargs[i].type = TYPE_INT;
+ vmargs[i].data = (s8) args[j].i;
+ break;
-#if defined(ENABLE_JIT)
-# if defined(ENABLE_INTRP)
- if (opt_intrp)
- i = intrp_asm_calljavafunction_int(m, a0, a1, a2, a3);
- else
-# endif
- i = asm_calljavafunction_int(m, a0, a1, a2, a3);
+ case PRIMITIVETYPE_LONG:
+ vmargs[i].type = TYPE_LNG;
+ vmargs[i].data = (s8) args[j].j;
+ break;
+
+ case PRIMITIVETYPE_FLOAT:
+ vmargs[i].type = TYPE_FLT;
+#if defined(__ALPHA__)
+ /* this keeps the assembler function much simpler */
+
+ *((jdouble *) (&vmargs[i].data)) = (jdouble) args[j].f;
#else
- i = intrp_asm_calljavafunction_int(m, a0, a1, a2, a3);
+ *((jfloat *) (&vmargs[i].data)) = args[j].f;
#endif
+ break;
- return i;
+ case PRIMITIVETYPE_DOUBLE:
+ vmargs[i].type = TYPE_DBL;
+ *((jdouble *) (&vmargs[i].data)) = args[j].d;
+ break;
+
+ case TYPE_ADR:
+ vmargs[i].type = TYPE_ADR;
+ vmargs[i].data = (u8) (ptrint) args[j].l;
+ break;
+ }
+ }
}
*******************************************************************************/
-java_objectheader *vm_call_method(methodinfo *m, u4 count, vm_arg *vmargs)
+java_objectheader *vm_call_method(methodinfo *m, java_objectheader *o, ...)
+{
+ va_list ap;
+ java_objectheader *ro;
+
+ va_start(ap, o);
+ ro = vm_call_method_valist(m, o, ap);
+ va_end(ap);
+
+ return ro;
+}
+
+
+/* vm_call_method_valist *******************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a va_list, and returns an address.
+
+*******************************************************************************/
+
+java_objectheader *vm_call_method_valist(methodinfo *m, java_objectheader *o,
+ va_list ap)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ java_objectheader *ro;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_valist(m, o, vmargs, ap);
+
+ /* call the Java method */
+
+ ro = vm_call_method_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return ro;
+}
+
+
+/* vm_call_method_jvalue *******************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a jvalue array, and returns an address.
+
+*******************************************************************************/
+
+java_objectheader *vm_call_method_jvalue(methodinfo *m, java_objectheader *o,
+ jvalue *args)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ java_objectheader *ro;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_jvalue(m, o, vmargs, args);
+
+ /* call the Java method */
+
+ ro = vm_call_method_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return ro;
+}
+
+
+/* vm_call_method_vmarg ********************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a vm_arg array, and returns an address.
+
+*******************************************************************************/
+
+java_objectheader *vm_call_method_vmarg(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs)
{
java_objectheader *o;
#if defined(ENABLE_JIT)
# if defined(ENABLE_INTRP)
if (opt_intrp)
- o = intrp_asm_calljavafunction2(m, count, vmargs);
+ o = intrp_asm_vm_call_method(m, vmargscount, vmargs);
else
# endif
- o = asm_calljavafunction2(m, count, vmargs);
+ o = asm_vm_call_method(m, vmargscount, vmargs);
#else
- o = intrp_asm_calljavafunction(m, count, vmargs);
+ o = intrp_asm_vm_call_method(m, vmargscount, vmargs);
#endif
return o;
*******************************************************************************/
-s4 vm_call_method_int(methodinfo *m, u4 count, vm_arg *vmargs)
+s4 vm_call_method_int(methodinfo *m, java_objectheader *o, ...)
+{
+ va_list ap;
+ s4 i;
+
+ va_start(ap, o);
+ i = vm_call_method_int_valist(m, o, ap);
+ va_end(ap);
+
+ return i;
+}
+
+
+/* vm_call_method_int_valist ***************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a va_list, and returns an integer (s4).
+
+*******************************************************************************/
+
+s4 vm_call_method_int_valist(methodinfo *m, java_objectheader *o, va_list ap)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ s4 i;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_valist(m, o, vmargs, ap);
+
+ /* call the Java method */
+
+ i = vm_call_method_int_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return i;
+}
+
+
+/* vm_call_method_int_jvalue ***************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a jvalue array, and returns an integer (s4).
+
+*******************************************************************************/
+
+s4 vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, jvalue *args)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ s4 i;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_jvalue(m, o, vmargs, args);
+
+ /* call the Java method */
+
+ i = vm_call_method_int_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return i;
+}
+
+
+/* vm_call_method_int_vmarg ****************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a vm_arg array, and returns an integer (s4).
+
+*******************************************************************************/
+
+s4 vm_call_method_int_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
{
s4 i;
#if defined(ENABLE_JIT)
# if defined(ENABLE_INTRP)
if (opt_intrp)
- i = intrp_asm_calljavafunction2int(m, count, vmargs);
+ i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs);
else
# endif
- i = asm_calljavafunction2int(m, count, vmargs);
+ i = asm_vm_call_method_int(m, vmargscount, vmargs);
#else
- i = intrp_asm_calljavafunction2int(m, count, vmargs);
+ i = intrp_asm_vm_call_method_int(m, vmargscount, vmargs);
#endif
return i;
*******************************************************************************/
-s8 vm_call_method_long(methodinfo *m, u4 count, vm_arg *vmargs)
+s8 vm_call_method_long(methodinfo *m, java_objectheader *o, ...)
+{
+ va_list ap;
+ s8 l;
+
+ va_start(ap, o);
+ l = vm_call_method_long_valist(m, o, ap);
+ va_end(ap);
+
+ return l;
+}
+
+
+/* vm_call_method_long_valist **************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a va_list, and returns a long (s8).
+
+*******************************************************************************/
+
+s8 vm_call_method_long_valist(methodinfo *m, java_objectheader *o, va_list ap)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ s8 l;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_valist(m, o, vmargs, ap);
+
+ /* call the Java method */
+
+ l = vm_call_method_long_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return l;
+}
+
+
+/* vm_call_method_long_jvalue **************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a jvalue array, and returns a long (s8).
+
+*******************************************************************************/
+
+s8 vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, jvalue *args)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ s8 l;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_jvalue(m, o, vmargs, args);
+
+ /* call the Java method */
+
+ l = vm_call_method_long_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return l;
+}
+
+
+/* vm_call_method_long_vmarg ***************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a vm_arg array, and returns a long (s8).
+
+*******************************************************************************/
+
+s8 vm_call_method_long_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
{
s8 l;
#if defined(ENABLE_JIT)
# if defined(ENABLE_INTRP)
if (opt_intrp)
- l = intrp_asm_calljavafunction2long(m, count, vmargs);
+ l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs);
else
# endif
- l = asm_calljavafunction2long(m, count, vmargs);
+ l = asm_vm_call_method_long(m, vmargscount, vmargs);
#else
- l = intrp_asm_calljavafunction2long(m, count, vmargs);
+ l = intrp_asm_vm_call_method_long(m, vmargscount, vmargs);
#endif
return l;
*******************************************************************************/
-float vm_call_method_float(methodinfo *m, u4 count, vm_arg *vmargs)
+float vm_call_method_float(methodinfo *m, java_objectheader *o, ...)
+{
+ va_list ap;
+ float f;
+
+ va_start(ap, o);
+ f = vm_call_method_float_valist(m, o, ap);
+ va_end(ap);
+
+ return f;
+}
+
+
+/* vm_call_method_float_valist *************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a va_list, and returns a float.
+
+*******************************************************************************/
+
+float vm_call_method_float_valist(methodinfo *m, java_objectheader *o,
+ va_list ap)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ float f;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_valist(m, o, vmargs, ap);
+
+ /* call the Java method */
+
+ f = vm_call_method_float_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return f;
+}
+
+
+/* vm_call_method_float_jvalue *************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a jvalue array, and returns a float.
+
+*******************************************************************************/
+
+float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o,
+ jvalue *args)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ float f;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_jvalue(m, o, vmargs, args);
+
+ /* call the Java method */
+
+ f = vm_call_method_float_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return f;
+}
+
+
+/* vm_call_method_float_vmarg **************************************************
+
+ Calls a Java method with a variable number of arguments and returns
+ an float.
+
+*******************************************************************************/
+
+float vm_call_method_float_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
{
float f;
#if defined(ENABLE_JIT)
# if defined(ENABLE_INTRP)
if (opt_intrp)
- f = intrp_asm_calljavafunction2float(m, count, vmargs);
+ f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs);
else
# endif
- f = asm_calljavafunction2float(m, count, vmargs);
+ f = asm_vm_call_method_float(m, vmargscount, vmargs);
#else
- f = intrp_asm_calljavafunction2float(m, count, vmargs);
+ f = intrp_asm_vm_call_method_float(m, vmargscount, vmargs);
#endif
return f;
*******************************************************************************/
-double vm_call_method_double(methodinfo *m, u4 count, vm_arg *vmargs)
+double vm_call_method_double(methodinfo *m, java_objectheader *o, ...)
+{
+ va_list ap;
+ double d;
+
+ va_start(ap, o);
+ d = vm_call_method_double_valist(m, o, ap);
+ va_end(ap);
+
+ return d;
+}
+
+
+/* vm_call_method_double_valist ************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a va_list, and returns a double.
+
+*******************************************************************************/
+
+double vm_call_method_double_valist(methodinfo *m, java_objectheader *o,
+ va_list ap)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ double d;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_valist(m, o, vmargs, ap);
+
+ /* call the Java method */
+
+ d = vm_call_method_double_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return d;
+}
+
+
+/* vm_call_method_double_jvalue ************************************************
+
+ Calls a Java method with a variable number of arguments, passed via
+ a jvalue array, and returns a double.
+
+*******************************************************************************/
+
+double vm_call_method_double_jvalue(methodinfo *m, java_objectheader *o,
+ jvalue *args)
+{
+ s4 vmargscount;
+ vm_arg *vmargs;
+ double d;
+ s4 dumpsize;
+
+ /* mark start of dump memory area */
+
+ dumpsize = dump_size();
+
+ /* get number of Java method arguments */
+
+ vmargscount = m->parseddesc->paramcount;
+
+ /* allocate vm_arg array */
+
+ vmargs = DMNEW(vm_arg, vmargscount);
+
+ /* fill the vm_arg array from a va_list */
+
+ vm_vmargs_from_jvalue(m, o, vmargs, args);
+
+ /* call the Java method */
+
+ d = vm_call_method_double_vmarg(m, vmargscount, vmargs);
+
+ /* release dump area */
+
+ dump_release(dumpsize);
+
+ return d;
+}
+
+
+/* vm_call_method_double_vmarg *************************************************
+
+ Calls a Java method with a variable number of arguments and returns
+ a double.
+
+*******************************************************************************/
+
+double vm_call_method_double_vmarg(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs)
{
double d;
#if defined(ENABLE_JIT)
# if defined(ENABLE_INTRP)
if (opt_intrp)
- d = intrp_asm_calljavafunction2double(m, count, vmargs);
+ d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs);
else
# endif
- d = asm_calljavafunction2double(m, count, vmargs);
+ d = asm_vm_call_method_double(m, vmargscount, vmargs);
#else
- d = intrp_asm_calljavafunction2double(m, count, vmargs);
+ d = intrp_asm_vm_call_method_double(m, vmargscount, vmargs);
#endif
return d;
void vm_exit_handler(void);
/* Java method calling functions */
-java_objectheader *vm_call_method_intern(methodinfo *m, void *a0, void *a1,
- void *a2, void *a3);
-
-s4 vm_call_method_intern_int(methodinfo *m, void *a0, void *a1, void *a2,
- void *a3);
-
-java_objectheader *vm_call_method(methodinfo *m, u4 count, vm_arg *vmargs);
-s4 vm_call_method_int(methodinfo *m, u4 count, vm_arg *vmargs);
-s8 vm_call_method_long(methodinfo *m, u4 count, vm_arg *vmargs);
-float vm_call_method_float(methodinfo *m, u4 count, vm_arg *vmargs);
-double vm_call_method_double(methodinfo *m, u4 count, vm_arg *vmargs);
+java_objectheader *vm_call_method(methodinfo *m, java_objectheader *o, ...);
+java_objectheader *vm_call_method_valist(methodinfo *m, java_objectheader *o,
+ va_list ap);
+java_objectheader *vm_call_method_jvalue(methodinfo *m, java_objectheader *o,
+ jvalue *args);
+java_objectheader *vm_call_method_vmarg(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs);
+
+s4 vm_call_method_int(methodinfo *m, java_objectheader *o, ...);
+s4 vm_call_method_int_valist(methodinfo *m, java_objectheader *o, va_list ap);
+s4 vm_call_method_int_jvalue(methodinfo *m, java_objectheader *o, jvalue *args);
+s4 vm_call_method_int_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
+
+s8 vm_call_method_long(methodinfo *m, java_objectheader *o, ...);
+s8 vm_call_method_long_valist(methodinfo *m, java_objectheader *o, va_list ap);
+s8 vm_call_method_long_jvalue(methodinfo *m, java_objectheader *o, jvalue *args);
+s8 vm_call_method_long_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
+
+float vm_call_method_float(methodinfo *m, java_objectheader *o, ...);
+float vm_call_method_float_valist(methodinfo *m, java_objectheader *o,
+ va_list ap);
+float vm_call_method_float_jvalue(methodinfo *m, java_objectheader *o,
+ jvalue *args);
+float vm_call_method_float_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs);
+
+double vm_call_method_double(methodinfo *m, java_objectheader *o, ...);
+double vm_call_method_double_valist(methodinfo *m, java_objectheader *o,
+ va_list ap);
+double vm_call_method_double_jvalue(methodinfo *m, java_objectheader *o,
+ jvalue *args);
+double vm_call_method_double_vmarg(methodinfo *m, s4 vmargscount,
+ vm_arg *vmargs);
#endif /* _VM_H */