[kaffe] CVS kaffe (guilhem): More JNI splitting. Removed Makefile.am~.
Kaffe CVS
cvs-commits at kaffe.org
Tue Jun 22 10:17:02 PDT 2004
PatchSet 4862
Date: 2004/06/22 17:10:15
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
More JNI splitting. Removed Makefile.am~.
* kaffe/kaffevm/jni_funcs.h,
kaffe/kaffevm/jni-base.c,
kaffe/kaffevm/jni-callmethod.c: New files.
* kaffe/kaffevm/jni.c:
Moved JNI initializers to jni-base.c
Moved JNI functions to call methods to jni-callmethod.c
* kaffe/kaffevm/jni/Makefile.am: Added jni-base.c and jni-callmethod.c to
libkaffejni_la_SOURCES. Added jni_funcs.h to noinst_HEADERS.
* kaffe/kaffevm/jni/Makefile.in: Regenerated.
Members:
ChangeLog:1.2429->1.2430
kaffe/kaffevm/jni/Makefile.am:1.1->1.2
kaffe/kaffevm/jni/Makefile.am~:1.1->1.2(DEAD)
kaffe/kaffevm/jni/Makefile.in:1.1->1.2
kaffe/kaffevm/jni/jni-base.c:INITIAL->1.1
kaffe/kaffevm/jni/jni-callmethod.c:INITIAL->1.1
kaffe/kaffevm/jni/jni.c:1.1->1.2
kaffe/kaffevm/jni/jni_funcs.h:INITIAL->1.1
kaffe/kaffevm/jni/jni_i.h:1.1->1.2
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2429 kaffe/ChangeLog:1.2430
--- kaffe/ChangeLog:1.2429 Tue Jun 22 16:04:52 2004
+++ kaffe/ChangeLog Tue Jun 22 17:10:15 2004
@@ -13,6 +13,22 @@
2004-06-22 Guilhem Lavaux <guilhem at kaffe.org>
+ * kaffe/kaffevm/jni_funcs.h,
+ kaffe/kaffevm/jni-base.c,
+ kaffe/kaffevm/jni-callmethod.c: New files.
+
+ * kaffe/kaffevm/jni.c:
+ Moved JNI initializers to jni-base.c
+ Moved JNI functions to call methods to jni-callmethod.c
+
+ * kaffe/kaffevm/jni/Makefile.am: Added jni-base.c and
+ jni-callmethod.c to libkaffejni_la_SOURCES.
+ Added jni_funcs.h to noinst_HEADERS.
+
+ * kaffe/kaffevm/jni/Makefile.in: Regenerated.
+
+2004-06-22 Guilhem Lavaux <guilhem at kaffe.org>
+
* configure.ac: Use AM_LCMESSAGES to check for LC_MESSAGES in
locale.h. jni module added.
Index: kaffe/kaffe/kaffevm/jni/Makefile.am
diff -u kaffe/kaffe/kaffevm/jni/Makefile.am:1.1 kaffe/kaffe/kaffevm/jni/Makefile.am:1.2
--- kaffe/kaffe/kaffevm/jni/Makefile.am:1.1 Tue Jun 22 15:35:45 2004
+++ kaffe/kaffe/kaffevm/jni/Makefile.am Tue Jun 22 17:10:16 2004
@@ -22,13 +22,14 @@
noinst_LTLIBRARIES = libkaffejni.la
libkaffejni_la_LDFLAGS = \
- $(KVMLIBFLAGS) \
- -export-dynamic \
- -release $(PACKAGE_VERSION)
+ $(KVMLIBFLAGS)
libkaffejni_la_SOURCES = \
- jni.c
+ jni.c \
+ jni-base.c \
+ jni-callmethod.c
noinst_HEADERS= \
jni_i.h \
- jnirefs.h
+ jnirefs.h \
+ jni_funcs.h
===================================================================
Checking out kaffe/kaffe/kaffevm/jni/Makefile.am~
RCS: /home/cvs/kaffe/kaffe/kaffe/kaffevm/jni/Attic/Makefile.am~,v
VERS: 1.1
***************
--- kaffe/kaffe/kaffevm/jni/Makefile.am~ Tue Jun 22 17:17:00 2004
+++ /dev/null Sun Aug 4 19:57:58 2002
@@ -1,33 +0,0 @@
-# Makefile.am for the JNI - a Java(tm) compatible virtual machine.
-#
-# Copyright (c) 2004
-# Kaffe.org contributors, see ChangeLogs for details. All rights reserved.
-#
-# See the file "license.terms" for information on usage and redistribution
-# of this file.
-
-AM_CPPFLAGS = \
- -I$(top_srcdir)/kaffe/kaffevm/$(THREAD_DIR) \
- $(ENGINE_INCLUDES) \
- -I$(top_srcdir)/libltdl \
- $(ENGINE_DEFS) \
- -I$(top_srcdir)/kaffe/jvmpi \
- -I$(top_srcdir)/kaffe/xprof \
- -I$(top_builddir)/include \
- -I$(top_srcdir)/kaffe/kaffevm \
- -I$(top_srcdir)/kaffe/kaffevm/verifier \
- -I$(top_srcdir)/kaffe/kaffevm/jni
-
-noinst_LTLIBRARIES = libkaffejni.la
-
-libkaffejni_la_LDFLAGS = \
- $(KVMLIBFLAGS) \
- -export-dynamic \
- -release $(PACKAGE_VERSION)
-
-libkaffejni_la_SOURCES = \
- jni.c
-
-noinst_HEADERS= \
- jni_i.h \
- jnirefs.h
Index: kaffe/kaffe/kaffevm/jni/Makefile.in
diff -u kaffe/kaffe/kaffevm/jni/Makefile.in:1.1 kaffe/kaffe/kaffevm/jni/Makefile.in:1.2
--- kaffe/kaffe/kaffevm/jni/Makefile.in:1.1 Tue Jun 22 15:35:45 2004
+++ kaffe/kaffe/kaffevm/jni/Makefile.in Tue Jun 22 17:10:16 2004
@@ -74,12 +74,13 @@
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libkaffejni_la_LIBADD =
-am_libkaffejni_la_OBJECTS = jni.lo
+am_libkaffejni_la_OBJECTS = jni.lo jni-base.lo jni-callmethod.lo
libkaffejni_la_OBJECTS = $(am_libkaffejni_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config -I$(top_builddir)/include/kaffe
depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp
am__depfiles_maybe = depfiles
- at AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/jni.Plo
+ at AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/jni-base.Plo \
+ at AMDEP_TRUE@ ./$(DEPDIR)/jni-callmethod.Plo ./$(DEPDIR)/jni.Plo
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
@@ -351,12 +352,12 @@
noinst_LTLIBRARIES = libkaffejni.la
libkaffejni_la_LDFLAGS = \
- $(KVMLIBFLAGS) \
- -export-dynamic \
- -release $(PACKAGE_VERSION)
+ $(KVMLIBFLAGS)
libkaffejni_la_SOURCES = \
- jni.c
+ jni.c \
+ jni-base.c \
+ jni-callmethod.c
noinst_HEADERS = \
jni_i.h \
@@ -413,6 +414,8 @@
distclean-compile:
-rm -f *.tab.c
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/jni-base.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/jni-callmethod.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/jni.Plo at am__quote@
.c.o:
===================================================================
Checking out kaffe/kaffe/kaffevm/jni/jni-base.c
RCS: /home/cvs/kaffe/kaffe/kaffe/kaffevm/jni/jni-base.c,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/kaffe/kaffevm/jni/jni-base.c Tue Jun 22 17:17:00 2004
@@ -0,0 +1,98 @@
+/*
+ * jni-base.c
+ * Java Native Interface - Basic exported JNI functions.
+ *
+ * Copyright (c) 1996, 1997, 2004
+ * Transvirtual Technologies, Inc. All rights reserved.
+ *
+ * Copyright (c) 2004
+ * The Kaffe.org's developers. See ChangeLog for details.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file.
+ */
+
+#include "config.h"
+#include "config-std.h"
+#include "config-mem.h"
+#include "jni.h"
+#include "jnirefs.h"
+#include "jni_i.h"
+#include "threadData.h"
+#include "thread.h"
+#include "baseClasses.h"
+
+/*
+ * Define the version of JNI we support.
+ */
+int Kaffe_Java_Major_Version = 1;
+int Kaffe_Java_Minor_Version = 1;
+
+/*
+ * Keep track of how many VM's are active. Right now
+ * we only support one at a time.
+ */
+static int Kaffe_NumVM = 0;
+
+extern struct JNINativeInterface Kaffe_JNINativeInterface;
+extern JavaVMInitArgs Kaffe_JavaVMInitArgs;
+extern JavaVM Kaffe_JavaVM;
+
+jint
+JNI_GetDefaultJavaVMInitArgs(JavaVMInitArgs* args)
+{
+ if (args->version != ((Kaffe_Java_Major_Version << 16) | Kaffe_Java_Minor_Version)) {
+ return (-1);
+ }
+ memcpy(args, &Kaffe_JavaVMInitArgs, sizeof(JavaVMInitArgs));
+ args->version = (Kaffe_Java_Major_Version << 16) | Kaffe_Java_Minor_Version;
+ return (0);
+}
+
+jint
+JNI_CreateJavaVM(JavaVM** vm, JNIEnv** env, JavaVMInitArgs* args)
+{
+ if (args->version != ((Kaffe_Java_Major_Version << 16) | Kaffe_Java_Minor_Version)) {
+ return (-1);
+ }
+
+ /* We can only init. one KVM */
+ if (Kaffe_NumVM != 0) {
+ return (-1);
+ }
+
+ /* Setup the machine */
+ Kaffe_JavaVMArgs[0] = *args;
+ initialiseKaffe();
+
+ /* Setup JNI for main thread */
+#if defined(NEED_JNIREFS)
+ THREAD_DATA()->jnireferences = (jnirefs *)gc_malloc(sizeof(jnirefs), &gcNormal);
+#endif
+
+ /* Return the VM and JNI we're using */
+ *vm = &Kaffe_JavaVM;
+ *env = THREAD_JNIENV();
+ Kaffe_NumVM++;
+
+#if defined(ENABLE_JVMPI)
+ if( JVMPI_EVENT_ISENABLED(JVMPI_EVENT_JVM_INIT_DONE) )
+ {
+ JVMPI_Event ev;
+
+ ev.event_type = JVMPI_EVENT_JVM_INIT_DONE;
+ jvmpiPostEvent(&ev);
+ }
+#endif
+
+ return (0);
+}
+
+jint
+JNI_GetCreatedJavaVMs(JavaVM** vm, jsize buflen UNUSED, jsize* nvm)
+{
+ vm[0] = &Kaffe_JavaVM;
+ *nvm = Kaffe_NumVM;
+
+ return (0);
+}
===================================================================
Checking out kaffe/kaffe/kaffevm/jni/jni-callmethod.c
RCS: /home/cvs/kaffe/kaffe/kaffe/kaffevm/jni/jni-callmethod.c,v
VERS: 1.1
***************
--- /dev/null Sun Aug 4 19:57:58 2002
+++ kaffe/kaffe/kaffevm/jni/jni-callmethod.c Tue Jun 22 17:17:00 2004
@@ -0,0 +1,1769 @@
+/*
+ * jni-callmethod.c
+ * Java Native Interface - CallXMethod JNI functions.
+ *
+ * Copyright (c) 1996, 1997, 2004
+ * Transvirtual Technologies, Inc. All rights reserved.
+ *
+ * Copyright (c) 2004
+ * The Kaffe.org's developers. See ChangeLog for details.
+ *
+ * See the file "license.terms" for information on usage and redistribution
+ * of this file.
+ */
+#include "config.h"
+#include "baseClasses.h"
+#include "threadData.h"
+#include "classMethod.h"
+#include "exception.h"
+#include "jni.h"
+#include "jni_i.h"
+#include "jnirefs.h"
+#include "jni_funcs.h"
+
+/*
+ * Find the function to be called when meth is invoked on obj
+ */
+static inline void*
+getMethodFunc (Method* meth, Hjava_lang_Object *obj)
+{
+ if (obj && CLASS_IS_INTERFACE (meth->class)) {
+ register short *implementors;
+ register Hjava_lang_Class *clazz;
+
+ assert (meth->idx >= 0);
+
+ implementors = meth->class->implementors;
+ clazz = OBJECT_CLASS(obj);
+
+ assert (implementors != NULL && clazz->impl_index <= implementors[0]);
+
+ return clazz->itable2dtable[implementors[clazz->impl_index] + meth->idx + 1];
+ } else {
+ return meth->idx >= 0 ? obj->vtable->method[meth->idx] : METHOD_INDIRECTMETHOD (meth);
+ }
+}
+
+/*
+ * The JNI functions.
+ */
+
+
+/* ------------------------------------------------------------------------------
+ * Virtual method calls returning VOID
+ * ------------------------------------------------------------------------------
+ */
+
+void
+KaffeJNI_CallVoidMethodV(JNIEnv* env UNUSED, jobject obj, jmethodID meth, va_list args)
+{
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING_VOID();
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, getMethodFunc (m, o), obj, args, 0);
+
+ END_EXCEPTION_HANDLING();
+}
+
+void
+KaffeJNI_CallVoidMethod(JNIEnv* env, jobject obj, jmethodID meth, ...)
+{
+ va_list args;
+
+ BEGIN_EXCEPTION_HANDLING_VOID();
+
+ va_start(args, meth);
+ KaffeJNI_CallVoidMethodV(env, obj, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+}
+
+void
+KaffeJNI_CallVoidMethodA(JNIEnv* env UNUSED, jobject obj, jmethodID meth, jvalue* args)
+{
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING_VOID();
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, getMethodFunc (m, o), obj, args, 0, 0);
+
+ END_EXCEPTION_HANDLING();
+}
+
+/* ------------------------------------------------------------------------------
+ * Non-virtual method calls returning Object
+ * ------------------------------------------------------------------------------
+ */
+
+jobject
+KaffeJNI_CallNonvirtualObjectMethodV(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval);
+
+ ADD_REF(retval.l);
+ END_EXCEPTION_HANDLING();
+ return (retval.l);
+}
+
+jobject
+KaffeJNI_CallNonvirtualObjectMethod(JNIEnv* env, jobject obj, jclass cls, jmethodID meth, ...)
+{
+ va_list args;
+ jobject r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallNonvirtualObjectMethodV(env, obj, cls, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jobject
+KaffeJNI_CallNonvirtualObjectMethodA(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval, 0);
+
+ ADD_REF(retval.l);
+ END_EXCEPTION_HANDLING();
+ return (retval.l);
+}
+
+/* ------------------------------------------------------------------------------
+ * Non-virtual method calls returning boolean
+ * ------------------------------------------------------------------------------
+ */
+
+jboolean
+KaffeJNI_CallNonvirtualBooleanMethodV(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval);
+
+ END_EXCEPTION_HANDLING();
+ return ((jboolean) retval.i);
+}
+
+jboolean
+KaffeJNI_CallNonvirtualBooleanMethod(JNIEnv* env, jobject obj, jclass cls, jmethodID meth, ...)
+{
+ va_list args;
+ jboolean r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallNonvirtualBooleanMethodV(env, obj, cls, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jboolean
+KaffeJNI_CallNonvirtualBooleanMethodA(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval, 0);
+
+ END_EXCEPTION_HANDLING();
+ return ((jboolean) retval.i);
+}
+
+/* ------------------------------------------------------------------------------
+ * Non-virtual method calls returning byte
+ * ------------------------------------------------------------------------------
+ */
+jbyte
+KaffeJNI_CallNonvirtualByteMethodV(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval);
+
+ END_EXCEPTION_HANDLING();
+ return ((jbyte) retval.i);
+}
+
+jbyte
+KaffeJNI_CallNonvirtualByteMethod(JNIEnv* env, jobject obj, jclass cls, jmethodID meth, ...)
+{
+ va_list args;
+ jbyte r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallNonvirtualByteMethodV(env, obj, cls, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jbyte
+KaffeJNI_CallNonvirtualByteMethodA(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval, 0);
+
+ END_EXCEPTION_HANDLING();
+ return ((jbyte) retval.i);
+}
+
+/* ------------------------------------------------------------------------------
+ * Non-virtual method calls returning char
+ * ------------------------------------------------------------------------------
+ */
+
+jchar
+KaffeJNI_CallNonvirtualCharMethodV(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval);
+
+ END_EXCEPTION_HANDLING();
+ return ((jchar) retval.i);
+}
+
+jchar
+KaffeJNI_CallNonvirtualCharMethod(JNIEnv* env, jobject obj, jclass cls, jmethodID meth, ...)
+{
+ va_list args;
+ jchar r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallNonvirtualCharMethodV(env, obj, cls, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jchar
+KaffeJNI_CallNonvirtualCharMethodA(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval, 0);
+
+ END_EXCEPTION_HANDLING();
+ return ((jchar) retval.i);
+}
+
+/* ------------------------------------------------------------------------------
+ * Non-virtual method calls returning short
+ * ------------------------------------------------------------------------------
+ */
+
+jshort
+KaffeJNI_CallNonvirtualShortMethodV(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval);
+
+ END_EXCEPTION_HANDLING();
+ return ((jshort) retval.i);
+}
+
+jshort
+KaffeJNI_CallNonvirtualShortMethod(JNIEnv* env, jobject obj, jclass cls, jmethodID meth, ...)
+{
+ va_list args;
+ jshort r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallNonvirtualShortMethodV(env, obj, cls, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jshort
+KaffeJNI_CallNonvirtualShortMethodA(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval, 0);
+
+ END_EXCEPTION_HANDLING();
+ return ((jshort) retval.i);
+}
+
+/* ------------------------------------------------------------------------------
+ * Non-virtual method calls returning int
+ * ------------------------------------------------------------------------------
+ */
+
+jint
+KaffeJNI_CallNonvirtualIntMethodV(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval);
+
+ END_EXCEPTION_HANDLING();
+ return (retval.i);
+}
+
+jint
+KaffeJNI_CallNonvirtualIntMethod(JNIEnv* env, jobject obj, jclass cls, jmethodID meth, ...)
+{
+ va_list args;
+ jint r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallNonvirtualIntMethodV(env, obj, cls, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jint
+KaffeJNI_CallNonvirtualIntMethodA(JNIEnv* env UNUSED, jobject obj, jclass cls UNUSED, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, METHOD_INDIRECTMETHOD(m), obj, args, &retval, 0);
+
+ END_EXCEPTION_HANDLING();
+ return (retval.i);
+}
+
+/* ------------------------------------------------------------------------------
+ * Virtual method calls returning Object
+ * ------------------------------------------------------------------------------
+ */
+
+jobject
+KaffeJNI_CallObjectMethodV(JNIEnv* env UNUSED, jobject obj, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, getMethodFunc (m, o), obj, args, &retval);
+
+ ADD_REF(retval.l);
+ END_EXCEPTION_HANDLING();
+ return (retval.l);
+}
+
+
+jobject
+KaffeJNI_CallObjectMethod(JNIEnv* env, jobject obj, jmethodID meth, ...)
+{
+ va_list args;
+ jobject r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallObjectMethodV(env, obj, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jobject
+KaffeJNI_CallObjectMethodA(JNIEnv* env UNUSED, jobject obj, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, getMethodFunc (m, o), obj, args, &retval, 0);
+
+ END_EXCEPTION_HANDLING();
+ return (retval.l);
+}
+
+/* ------------------------------------------------------------------------------
+ * Virtual method calls returning boolean
+ * ------------------------------------------------------------------------------
+ */
+
+jboolean
+KaffeJNI_CallBooleanMethodV(JNIEnv* env UNUSED, jobject obj, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, getMethodFunc (m, o), obj, args, &retval);
+
+ END_EXCEPTION_HANDLING();
+ return ((jboolean) retval.i);
+}
+
+jboolean
+KaffeJNI_CallBooleanMethod(JNIEnv* env, jobject obj, jmethodID meth, ...)
+{
+ va_list args;
+ jboolean r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallBooleanMethodV(env, obj, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jboolean
+KaffeJNI_CallBooleanMethodA(JNIEnv* env UNUSED, jobject obj, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, getMethodFunc (m, o), obj, args, &retval, 0);
+
+ END_EXCEPTION_HANDLING();
+ return ((jboolean) retval.i);
+}
+
+/* ------------------------------------------------------------------------------
+ * Virtual method calls returning byte
+ * ------------------------------------------------------------------------------
+ */
+
+jbyte
+KaffeJNI_CallByteMethodV(JNIEnv* env UNUSED, jobject obj, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, getMethodFunc (m, o), obj, args, &retval);
+
+ END_EXCEPTION_HANDLING();
+ return ((jbyte) retval.i);
+}
+
+jbyte
+KaffeJNI_CallByteMethod(JNIEnv* env, jobject obj, jmethodID meth, ...)
+{
+ va_list args;
+ jbyte r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallByteMethodV(env, obj, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jbyte
+KaffeJNI_CallByteMethodA(JNIEnv* env UNUSED, jobject obj, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, getMethodFunc (m, o), obj, args, &retval, 0);
+
+ END_EXCEPTION_HANDLING();
+ return ((jbyte) retval.i);
+}
+
+/* ------------------------------------------------------------------------------
+ * Virtual method calls returning char
+ * ------------------------------------------------------------------------------
+ */
+
+jchar
+KaffeJNI_CallCharMethodV(JNIEnv* env UNUSED, jobject obj, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, getMethodFunc (m, o), obj, args, &retval);
+
+ END_EXCEPTION_HANDLING();
+ return ((jchar) retval.i);
+}
+
+jchar
+KaffeJNI_CallCharMethod(JNIEnv* env, jobject obj, jmethodID meth, ...)
+{
+ va_list args;
+ jchar r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ va_start(args, meth);
+ r = KaffeJNI_CallCharMethodV(env, obj, meth, args);
+ va_end(args);
+
+ END_EXCEPTION_HANDLING();
+ return (r);
+}
+
+jchar
+KaffeJNI_CallCharMethodA(JNIEnv* env UNUSED, jobject obj, jmethodID meth, jvalue* args)
+{
+ jvalue retval;
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodA(m, getMethodFunc (m, o), obj, args, &retval, 0);
+
+ END_EXCEPTION_HANDLING();
+ return ((jchar) retval.i);
+}
+
+/* ------------------------------------------------------------------------------
+ * Non-virtual method calls returning short
+ * ------------------------------------------------------------------------------
+ */
+
+jshort
+KaffeJNI_CallShortMethodV(JNIEnv* env UNUSED, jobject obj, jmethodID meth, va_list args)
+{
+ jvalue retval;
+ Hjava_lang_Object* o = (Hjava_lang_Object*)obj;
+ Method* m = (Method*)meth;
+
+ BEGIN_EXCEPTION_HANDLING(0);
+
+ if (METHOD_IS_STATIC(m)) {
+ throwException(NoSuchMethodError(m->name->data));
+ }
+
+ callMethodV(m, getMethodFunc (m, o), obj, args, &retval);
+
+ END_EXCEPTION_HANDLING();
+ return ((jshort) retval.i);
+}
+
+jshort
+KaffeJNI_CallShortMethod(JNIEnv* env, jobject obj, jmethodID meth, ...)
+{
+ va_list args;
+ jshort r;
+
+ BEGIN_EXCEPTION_HANDLING(0);
*** Patch too long, truncated ***
More information about the kaffe
mailing list