[kaffe] CVS kaffe (dalibor): Converted i386-qnx and i386-win32 sysdepCallMethods to inline functions

Kaffe CVS cvs-commits at kaffe.org
Thu Dec 11 10:09:01 PST 2003


PatchSet 4214 
Date: 2003/12/11 17:56:17
Author: dalibor
Branch: HEAD
Tag: (none) 
Log:
Converted i386-qnx and i386-win32 sysdepCallMethods to inline functions

2003-12-11  Dalibor Topic <robilad at kaffe.org>

        * config/arm/sysdepCallMethod.h: New file.

        * config/Makefile.am
        (EXTRA_DIST) Added config/arm/sysdepCallMethod.h.

        * aclocal.m4,
        config/Makefile.in,
        kaffe/Makefile.in,
        kaffe/kaffe/Makefile.in,
        kaffe/scripts/Makefile.in,
        kaffe/scripts/compat/Makefile.in,
        test/internal/Makefile.in,
        test/regression/Makefile.in:
        Regenerated.

        * config/arm/common.h
        (sysdepCallMethod) Moved into its own file,
        config/arm/sysdepCallMethod.h.

        * config/arm/linux/md.h,
        config/arm/netbsd1/md.h:
        Include config/arm/sysdepCallMethod.h.

        * config/arm/riscos/md.h:
        (sysdepCallMethod) Converted macro to inline function.

Members: 
	ChangeLog:1.1804->1.1805 
	aclocal.m4:1.78->1.79 
	config/Makefile.am:1.29->1.30 
	config/Makefile.in:1.96->1.97 
	config/i386/common.h:1.16->1.17 
	config/i386/sysdepCallMethod.h:INITIAL->1.1 
	config/i386/beos/md.h:1.5->1.6 
	config/i386/bsdi/md.h:1.3->1.4 
	config/i386/cygwin32/md.h:1.2->1.3 
	config/i386/dgux/md.h:1.2->1.3 
	config/i386/freebsd2/md.h:1.6->1.7 
	config/i386/gnu/md.h:1.2->1.3 
	config/i386/linux/md.h:1.5->1.6 
	config/i386/netbsd1/md.h:1.2->1.3 
	config/i386/nextstep3/md.h:1.3->1.4 
	config/i386/openbsd2/md.h:1.3->1.4 
	config/i386/oskit/md.h:1.4->1.5 
	config/i386/qnx/md.h:1.5->1.6 
	config/i386/sco3.2v5/md.h:1.2->1.3 
	config/i386/solaris2/md.h:1.2->1.3 
	config/i386/univel_svr4/md.h:1.4->1.5 
	config/i386/win32/md.h:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1804 kaffe/ChangeLog:1.1805
--- kaffe/ChangeLog:1.1804	Thu Dec 11 16:43:29 2003
+++ kaffe/ChangeLog	Thu Dec 11 17:56:17 2003
@@ -1,5 +1,40 @@
 2003-12-11  Dalibor Topic <robilad at kaffe.org>
 
+	* config/i386/sysdepCallMethod.h: New file.
+
+	* config/Makefile.am
+	(EXTRA_DIST) Added config/i386/sysdepCallMethod.h.
+
+        * aclocal.m4,
+        config/Makefile.in:
+	Regenerated.
+
+        * config/i386/common.h:
+	(sysdepCallMethod) Moved into its own file,
+        config/i386/sysdepCallMethod.h.
+
+        * config/i386/bsdi/md.h,
+	config/i386/beos/md.h,
+        config/i386/cygwin32/md.h,
+        config/i386/dgux/md.h,
+        config/i386/freebsd2/md.h,
+        config/i386/gnu/md.h,
+        config/i386/linux/md.h,
+        config/i386/netbsd1/md.h,
+        config/i386/nextstep3/md.h,
+        config/i386/openbsd2/md.h,
+        config/i386/oskit/md.h,
+        config/i386/sco3.2v5/md.h,
+        config/i386/solaris2/md.h,
+        config/i386/univel_svr4/md.h:
+	Include config/i386/sysdepCallMethod.h.
+
+        * config/i386/win32/md.h,
+        config/i386/qnx/md.h:
+	(sysdepCallMethod) Converted macro to inline function.
+
+2003-12-11  Dalibor Topic <robilad at kaffe.org>
+
 	* config/arm/sysdepCallMethod.h: New file.
 
 	* config/Makefile.am
Index: kaffe/aclocal.m4
diff -u kaffe/aclocal.m4:1.78 kaffe/aclocal.m4:1.79
--- kaffe/aclocal.m4:1.78	Thu Dec 11 16:43:30 2003
+++ kaffe/aclocal.m4	Thu Dec 11 17:56:18 2003
@@ -8723,7 +8723,7 @@
 AU_DEFUN([fp_WITH_DMALLOC], [AM_WITH_DMALLOC])
 
 # ----------------------------------------------------------------------------
-# $Id: aclocal.m4,v 1.78 2003/12/11 16:43:30 dalibor Exp $
+# $Id: aclocal.m4,v 1.79 2003/12/11 17:56:18 dalibor Exp $
 #
 # Copyright (C) 2003 Free Software Foundation, Inc.
 #
@@ -8767,7 +8767,7 @@
 #
 # GNU Crypto m4 macro for use by VM Providers
 #
-# $Revision: 1.78 $
+# $Revision: 1.79 $
 #
 
 # process --with-gnu-crypto configure option.
Index: kaffe/config/Makefile.am
diff -u kaffe/config/Makefile.am:1.29 kaffe/config/Makefile.am:1.30
--- kaffe/config/Makefile.am:1.29	Thu Dec 11 16:43:31 2003
+++ kaffe/config/Makefile.am	Thu Dec 11 17:56:20 2003
@@ -162,6 +162,7 @@
 	i386/solaris2/jit-md.h \
 	i386/solaris2/md.c \
 	i386/solaris2/md.h \
+	i386/sysdepCallMethod.h \
 	i386/threads.h \
 	i386/trampolines.c \
 	i386/univel_svr4/config.frag \
Index: kaffe/config/Makefile.in
diff -u kaffe/config/Makefile.in:1.96 kaffe/config/Makefile.in:1.97
--- kaffe/config/Makefile.in:1.96	Thu Dec 11 16:43:31 2003
+++ kaffe/config/Makefile.in	Thu Dec 11 17:56:20 2003
@@ -404,6 +404,7 @@
 	i386/solaris2/jit-md.h \
 	i386/solaris2/md.c \
 	i386/solaris2/md.h \
+	i386/sysdepCallMethod.h \
 	i386/threads.h \
 	i386/trampolines.c \
 	i386/univel_svr4/config.frag \
Index: kaffe/config/i386/common.h
diff -u kaffe/config/i386/common.h:1.16 kaffe/config/i386/common.h:1.17
--- kaffe/config/i386/common.h:1.16	Sat Oct  4 22:55:23 2003
+++ kaffe/config/i386/common.h	Thu Dec 11 17:56:20 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997, 1998, 1999
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -14,53 +17,6 @@
 
 /* The 386 never aligns to more than a 4 byte boundary. */
 #define	ALIGNMENT_OF_SIZE(S)	((S) < 4 ? (S) : 4)
-
-/*
- * Make a call to a native or Java (JIT) method.
- *  This assembly code should build a standard C call using the passed
- *  call information.  By its nature this is highly processor specific.
- *  This function is mandatory for both JIT and Interpreter (since stubs
- *  have now been deprecated).
- */
-#if NEED_sysdepCallMethod
-static inline void sysdepCallMethod(callMethodInfo *call) {
-  unsigned args = call->nrargs;
-
-  /* Push all arguments into the stack, in last-to-first order.  This
-     assumes that the second 32bit-word of longs and doubles is
-     available as an additional int argument, as callMethod[AV]() do.  */
-  while (args > 0)
-    asm volatile ("pushl %0" : : "m" (call->args[--args].i) : "sp");
-
-  switch(call->retsize) {
-  case 0:
-    /* Must be void.  */
-    ((void (*)(void))(call->function))();
-    break;
-
-  case 1:
-    if (call->rettype == 'F')
-      call->ret->f = ((jfloat (*)(void))(call->function))();
-    else /* Must be 32-bit or smaller int.  */
-      call->ret->i = ((jint (*)(void))(call->function))();
-    break;
-
-  default:
-    /* It could've been `case 2;', but then we'd get an additional cmp
-     * that we don't really need.  */
-    if (call->rettype == 'D')
-      call->ret->d = ((jdouble (*)(void))(call->function))();
-    else /* Must be jlong.  */
-      call->ret->j = ((jlong (*)(void))(call->function))();
-    break;
-  }
-
-  /* Adjust the stack pointer.  */
-  asm volatile ("addl %0,%%esp" : :
-		"r" (call->argsize * sizeof(jint)) : "cc", "sp");
-}
-#endif /* NEED_sysdepCallMethod */
-
 
 #if defined(__GNUC__)
 #define KAFFE_PROFILER 1
===================================================================
Checking out kaffe/config/i386/sysdepCallMethod.h
RCS:  /home/cvs/kaffe/kaffe/config/i386/sysdepCallMethod.h,v
VERS: 1.1
***************
--- /dev/null	Sun Aug  4 19:57:58 2002
+++ kaffe/config/i386/sysdepCallMethod.h	Thu Dec 11 17:59:20 2003
@@ -0,0 +1,67 @@
+/*
+ * i386/sysdepCallMethod.h
+ * Common i386 sysdepCallMethod.
+ *
+ * Copyright (c) 1996, 1997, 1998, 1999
+ *	Transvirtual Technologies, Inc.  All rights reserved.
+ *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
+ * See the file "license.terms" for information on usage and redistribution 
+ * of this file. 
+ */
+
+#ifndef __i386_sysdepCallMethod_h
+#define __i386_sysdepCallMethod_h
+
+/* Needed for callMethodInfo declaration */
+#include "support.h"
+
+/*
+ * Make a call to a native or Java (JIT) method.
+ *  This assembly code should build a standard C call using the passed
+ *  call information.  By its nature this is highly processor specific.
+ *  This function is mandatory for both JIT and Interpreter (since stubs
+ *  have now been deprecated).
+ */
+#if NEED_sysdepCallMethod
+static inline void sysdepCallMethod(callMethodInfo *call) {
+  unsigned args = call->nrargs;
+
+  /* Push all arguments into the stack, in last-to-first order.  This
+     assumes that the second 32bit-word of longs and doubles is
+     available as an additional int argument, as callMethod[AV]() do.  */
+  while (args > 0)
+    asm volatile ("pushl %0" : : "m" (call->args[--args].i) : "sp");
+
+  switch(call->retsize) {
+  case 0:
+    /* Must be void.  */
+    ((void (*)(void))(call->function))();
+    break;
+
+  case 1:
+    if (call->rettype == 'F')
+      call->ret->f = ((jfloat (*)(void))(call->function))();
+    else /* Must be 32-bit or smaller int.  */
+      call->ret->i = ((jint (*)(void))(call->function))();
+    break;
+
+  default:
+    /* It could've been `case 2;', but then we'd get an additional cmp
+     * that we don't really need.  */
+    if (call->rettype == 'D')
+      call->ret->d = ((jdouble (*)(void))(call->function))();
+    else /* Must be jlong.  */
+      call->ret->j = ((jlong (*)(void))(call->function))();
+    break;
+  }
+
+  /* Adjust the stack pointer.  */
+  asm volatile ("addl %0,%%esp" : :
+		"r" (call->argsize * sizeof(jint)) : "cc", "sp");
+}
+#endif /* NEED_sysdepCallMethod */
+
+#endif /* __i386_sysdepCallMethod_h */
Index: kaffe/config/i386/beos/md.h
diff -u kaffe/config/i386/beos/md.h:1.5 kaffe/config/i386/beos/md.h:1.6
--- kaffe/config/i386/beos/md.h:1.5	Wed Aug 27 07:04:19 2003
+++ kaffe/config/i386/beos/md.h	Thu Dec 11 17:56:20 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_beos_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /*
Index: kaffe/config/i386/bsdi/md.h
diff -u kaffe/config/i386/bsdi/md.h:1.3 kaffe/config/i386/bsdi/md.h:1.4
--- kaffe/config/i386/bsdi/md.h:1.3	Wed Aug 27 07:04:19 2003
+++ kaffe/config/i386/bsdi/md.h	Thu Dec 11 17:56:21 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_bsdi_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /*
Index: kaffe/config/i386/cygwin32/md.h
diff -u kaffe/config/i386/cygwin32/md.h:1.2 kaffe/config/i386/cygwin32/md.h:1.3
--- kaffe/config/i386/cygwin32/md.h:1.2	Wed Aug 27 07:04:19 2003
+++ kaffe/config/i386/cygwin32/md.h	Thu Dec 11 17:56:21 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -16,6 +19,7 @@
 /* Thread handling */
 /**/
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /* Redefine the stack pointer offset */
Index: kaffe/config/i386/dgux/md.h
diff -u kaffe/config/i386/dgux/md.h:1.2 kaffe/config/i386/dgux/md.h:1.3
--- kaffe/config/i386/dgux/md.h:1.2	Wed Aug 27 07:04:20 2003
+++ kaffe/config/i386/dgux/md.h	Thu Dec 11 17:56:21 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_dgux_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /**/
Index: kaffe/config/i386/freebsd2/md.h
diff -u kaffe/config/i386/freebsd2/md.h:1.6 kaffe/config/i386/freebsd2/md.h:1.7
--- kaffe/config/i386/freebsd2/md.h:1.6	Tue Jun 24 19:26:01 2003
+++ kaffe/config/i386/freebsd2/md.h	Thu Dec 11 17:56:22 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_freebsd2_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /*
Index: kaffe/config/i386/gnu/md.h
diff -u kaffe/config/i386/gnu/md.h:1.2 kaffe/config/i386/gnu/md.h:1.3
--- kaffe/config/i386/gnu/md.h:1.2	Wed Aug 27 07:04:21 2003
+++ kaffe/config/i386/gnu/md.h	Thu Dec 11 17:56:22 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __ki386_gnu_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /* Function prototype for signal handlers */
Index: kaffe/config/i386/linux/md.h
diff -u kaffe/config/i386/linux/md.h:1.5 kaffe/config/i386/linux/md.h:1.6
--- kaffe/config/i386/linux/md.h:1.5	Wed Aug 27 07:04:21 2003
+++ kaffe/config/i386/linux/md.h	Thu Dec 11 17:56:22 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __ki386_linux_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /* Linux requires a little initialisation */
Index: kaffe/config/i386/netbsd1/md.h
diff -u kaffe/config/i386/netbsd1/md.h:1.2 kaffe/config/i386/netbsd1/md.h:1.3
--- kaffe/config/i386/netbsd1/md.h:1.2	Thu Aug  7 10:47:14 2003
+++ kaffe/config/i386/netbsd1/md.h	Thu Dec 11 17:56:23 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_netbsd1_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /*
Index: kaffe/config/i386/nextstep3/md.h
diff -u kaffe/config/i386/nextstep3/md.h:1.3 kaffe/config/i386/nextstep3/md.h:1.4
--- kaffe/config/i386/nextstep3/md.h:1.3	Wed Aug 27 07:04:21 2003
+++ kaffe/config/i386/nextstep3/md.h	Thu Dec 11 17:56:23 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_nextstep3_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /*
Index: kaffe/config/i386/openbsd2/md.h
diff -u kaffe/config/i386/openbsd2/md.h:1.3 kaffe/config/i386/openbsd2/md.h:1.4
--- kaffe/config/i386/openbsd2/md.h:1.3	Mon Aug 25 06:14:46 2003
+++ kaffe/config/i386/openbsd2/md.h	Thu Dec 11 17:56:23 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_openbsd2_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /*
Index: kaffe/config/i386/oskit/md.h
diff -u kaffe/config/i386/oskit/md.h:1.4 kaffe/config/i386/oskit/md.h:1.5
--- kaffe/config/i386/oskit/md.h:1.4	Wed Aug 27 07:04:22 2003
+++ kaffe/config/i386/oskit/md.h	Thu Dec 11 17:56:24 2003
@@ -4,6 +4,9 @@
  * See the file "license.terms" for information on usage and redistribution
  * of this file.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * Contributed by the Flux Research Group at the University of Utah.
  * Authors: Godmar Back, Leigh Stoller
  */
@@ -12,6 +15,7 @@
 #define __i386_oskit_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /*
Index: kaffe/config/i386/qnx/md.h
diff -u kaffe/config/i386/qnx/md.h:1.5 kaffe/config/i386/qnx/md.h:1.6
--- kaffe/config/i386/qnx/md.h:1.5	Sat Oct  4 22:55:24 2003
+++ kaffe/config/i386/qnx/md.h	Thu Dec 11 17:56:24 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -22,6 +25,7 @@
 #include "i386/common.h"
 #include "i386/threads.h"
 
+#include "support.h"
 /*
  * Redefine stack pointer offset.
  */
@@ -77,43 +81,44 @@
  * point unit.  We must make some changes to the sysdepCallMethod to
  * handle this.
  */
-#undef	sysdepCallMethod
-#define	sysdepCallMethod(CALL)						\
-	asm volatile ("	\n"						\
-"1:			\n"						\
-"		cmpl $0,%0 \n"						\
-"		je 3f \n"						\
-"		decl %0	\n"						\
-"		cmpb $0,(%2,%0)	\n"					\
-"		je 1b \n"						\
-"		cmpb $1,(%2,%0)	\n"					\
-"		je 2f \n"						\
-"		pushl 4(%1,%0,8) \n"					\
-"2:		\n"							\
-"		pushl (%1,%0,8)	\n"					\
-"		jmpl 1b	\n"						\
-"3:		\n"							\
-"		call *%3 \n"						\
-"		movl %5,%%ebx \n"					\
-"		movb %4,%%cl \n"					\
-"		movl %%eax,(%%ebx) \n"					\
-"		cmpb $0x44,%%cl \n"					\
-"		je 4f \n"						\
-"		cmpb $0x4a,%%cl	\n"					\
-"		jne 5f \n"						\
-"4:		\n"							\
-"		movl %%edx,4(%%ebx) \n"					\
-"5:		\n"							\
-"	" :								\
-	  : "r" ((CALL)->nrargs),					\
-	    "r" ((CALL)->args),						\
-	    "r" ((CALL)->callsize),					\
-	    "m" ((CALL)->function),					\
-	    "m" ((CALL)->rettype),					\
-	    "m" ((CALL)->ret)						\
-	  : "eax", "ebx", "ecx", "edx", "edi", "esi", "cc", "memory");	\
-	asm volatile ("	\n"						\
-"		subl %0,%%esp \n"					\
-	" : : "r" ((CALL)->argsize * sizeof(jint)) : "cc")
+static inline void sysdepCallMethod(callMethodInfo *call) 
+{
+	asm volatile ("	\n"
+"1:			\n"
+"		cmpl $0,%0 \n"
+"		je 3f \n"
+"		decl %0	\n"
+"		cmpb $0,(%2,%0)	\n"
+"		je 1b \n"
+"		cmpb $1,(%2,%0)	\n"
+"		je 2f \n"
+"		pushl 4(%1,%0,8) \n"
+"2:		\n"
+"		pushl (%1,%0,8)	\n"
+"		jmpl 1b	\n"
+"3:		\n"
+"		call *%3 \n"
+"		movl %5,%%ebx \n"
+"		movb %4,%%cl \n"
+"		movl %%eax,(%%ebx) \n"
+"		cmpb $0x44,%%cl \n"
+"		je 4f \n"
+"		cmpb $0x4a,%%cl	\n"
+"		jne 5f \n"
+"4:		\n"
+"		movl %%edx,4(%%ebx) \n"
+"5:		\n"
+"	" :
+	  : "r" ((call)->nrargs),
+	    "r" ((call)->args),
+	    "r" ((call)->callsize),
+	    "m" ((call)->function),
+	    "m" ((call)->rettype),
+	    "m" ((call)->ret)
+	  : "eax", "ebx", "ecx", "edx", "edi", "esi", "cc", "memory");
+	asm volatile ("	\n"
+"		subl %0,%%esp \n"
+"	" : : "r" ((call)->argsize * sizeof(jint)) : "cc");
+}
 
 #endif
Index: kaffe/config/i386/sco3.2v5/md.h
diff -u kaffe/config/i386/sco3.2v5/md.h:1.2 kaffe/config/i386/sco3.2v5/md.h:1.3
--- kaffe/config/i386/sco3.2v5/md.h:1.2	Wed Aug 27 07:04:23 2003
+++ kaffe/config/i386/sco3.2v5/md.h	Thu Dec 11 17:56:24 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_sco3_2v5_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 #define	POSIX_SIGNALS
Index: kaffe/config/i386/solaris2/md.h
diff -u kaffe/config/i386/solaris2/md.h:1.2 kaffe/config/i386/solaris2/md.h:1.3
--- kaffe/config/i386/solaris2/md.h:1.2	Wed Aug 27 07:04:23 2003
+++ kaffe/config/i386/solaris2/md.h	Thu Dec 11 17:56:25 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_solaris2_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 #define	SIGNAL_ARGS(sig, sc) int sig, siginfo_t* sip, ucontext_t* sc
Index: kaffe/config/i386/univel_svr4/md.h
diff -u kaffe/config/i386/univel_svr4/md.h:1.4 kaffe/config/i386/univel_svr4/md.h:1.5
--- kaffe/config/i386/univel_svr4/md.h:1.4	Wed Aug 27 07:04:24 2003
+++ kaffe/config/i386/univel_svr4/md.h	Thu Dec 11 17:56:25 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -13,6 +16,7 @@
 #define __i386_univel_svr4_md_h
 
 #include "i386/common.h"
+#include "i386/sysdepCallMethod.h"
 #include "i386/threads.h"
 
 /* Function prototype for signal handlers */
Index: kaffe/config/i386/win32/md.h
diff -u kaffe/config/i386/win32/md.h:1.2 kaffe/config/i386/win32/md.h:1.3
--- kaffe/config/i386/win32/md.h:1.2	Tue Jul 27 23:30:41 1999
+++ kaffe/config/i386/win32/md.h	Thu Dec 11 17:56:25 2003
@@ -5,6 +5,9 @@
  * Copyright (c) 1996, 1997, 1998
  *	Transvirtual Technologies, Inc.  All rights reserved.
  *
+ * Copyright (c) 2003
+ *      Kaffe.org contributors. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution 
  * of this file. 
  */
@@ -17,6 +20,8 @@
 #include "i386/common.h"
 #include "i386/threads.h"
 
+#include "support.h"
+
 #if !defined(EXTERN_C)
 #define EXTERN_C extern
 #endif
@@ -33,8 +38,10 @@
 
 extern void _sysdepCallMethod(void*);
 
-#undef sysdepCallMethod
-#define	sysdepCallMethod(M) _sysdepCallMethod((void*)(M)) /* Provided by WIN32-MD.ASM */
+static inline void sysdepCallMethod(callMethodInfo *call) {
+	/* Provided by WIN32-MD.ASM */
+	return _sysdepCallMethod((void*)(call));
+}
 
 extern int _compareAndExchange(void*, void*, void*);
 




More information about the kaffe mailing list