Merged revisions 7766-7796 via svnmerge from
authormichi <none@none>
Mon, 23 Apr 2007 20:12:39 +0000 (20:12 +0000)
committermichi <none@none>
Mon, 23 Apr 2007 20:12:39 +0000 (20:12 +0000)
svn+ssh://michi@c1.complang.tuwien.ac.at/ahome/cacao/svn/cacao/trunk

........
  r7769 | tbfg | 2007-04-19 17:01:49 +0200 (Thu, 19 Apr 2007) | 16 lines

  * src/vm/jit/m68k/linux/md-abi.c (abi_registers_integer_saved): Fixed.
  (abi_registers_float_saved): Fixed.

  * src/vm/jit/m68k/emit.c (emit_classcast_check): Fixed.

  * src/vm/jit/m68k/codegen.c (codegen_emit): Temporary hacked
  a field for saved adr registers until real patch will be done.
  (ICMD_INSTANCEOF): Fixed.
  (ICMD_CHECKCAST): Fixed.
  (codegen_emit_stub_compiler): Removed useless code.

  * src/vm/jit/m68k/asmpart.S (L_asm_handle_exception_not_catched):
  Implemented.

  * src/vm/jit/m68k/codegen.h (M_BLS): Added.
........
  r7770 | twisti | 2007-04-19 21:39:06 +0200 (Thu, 19 Apr 2007) | 20 lines

  * src/vm/jit/powerpc/darwin/md-abi.h (REG_FA0, REG_FA1): Added.
  (REG_A0_A1_PACKED, REG_A2_A3_PACKED): Likewise.

  * src/vm/jit/powerpc/darwin/md-os.c [ENABLE_THREADS]
  (threads/native/threads.h): Added.
  (md_signal_handler_sigsegv): Changed for hardware-exceptions.
  (md_signal_handler_sigtrap): New function.

  * src/vm/jit/powerpc/darwin/md-abi.c (vm/descriptor.h): Changed to
  vmcore/descriptor.h.
  (regs): Renamed to abi_registers_integer_name.
  (abi_registers_integer_argument): Added.
  (abi_registers_integer_saved): Likewise.
  (abi_registers_integer_temporary): Likewise.
  (abi_registers_float_argument): Likewise.
  (abi_registers_float_saved): Likewise.
  (abi_registers_float_temporary): Likewise.
  (md_param_alloc): Use new register arrays.
  (md_param_alloc_native): New function.
........
  r7771 | twisti | 2007-04-19 21:41:08 +0200 (Thu, 19 Apr 2007) | 5 lines

  * src/cacaoh/dummy.c (exceptions_print_current_exception): Added
  abort.
  (exceptions_throw_outofmemoryerror): Removed.
  (exceptions_throw_illegalaccessexception): Likewise.
........
  r7772 | twisti | 2007-04-19 21:43:39 +0200 (Thu, 19 Apr 2007) | 5 lines

  * src/vm/signal.c (assert.h): Added.
  (vm/exceptions.h): Likewise.
  [ENABLE_STATISTICS] (vmcore/statistics.h): Likewise.
  (signal_init): Added hardware-exception assert.
........
  r7773 | twisti | 2007-04-19 21:44:54 +0200 (Thu, 19 Apr 2007) | 3 lines

  * src/vm/exceptions.h: Added a comment about the hardware-exception
  assert in signal_init.
........
  r7774 | twisti | 2007-04-19 21:58:08 +0200 (Thu, 19 Apr 2007) | 2 lines

  * configure.ac (AC_INIT): Changed version to 0.98rc.
........
  r7775 | twisti | 2007-04-19 21:59:17 +0200 (Thu, 19 Apr 2007) | 3 lines

  * tests/regression/resolving/Makefile.am (check): Added missing
  JAVAFLAGS.
........
  r7776 | twisti | 2007-04-19 23:31:47 +0200 (Thu, 19 Apr 2007) | 3 lines

  * src/vm/signal.c (signal_thread): Check return value of sig*
  functions.
........
  r7777 | twisti | 2007-04-20 13:21:38 +0200 (Fri, 20 Apr 2007) | 2 lines

  * src/threads/threads-common.h (native/jni.h): Added.
........
  r7778 | twisti | 2007-04-20 14:40:05 +0200 (Fri, 20 Apr 2007) | 3 lines

  * src/vm/jit/codegen-common.c (codegen_finish_native_call): #ifdef lrt
  and plrt. Don't set lrt, we don't need it.
........
  r7779 | twisti | 2007-04-20 14:48:55 +0200 (Fri, 20 Apr 2007) | 2 lines

  * src/vm/vm.c (vm_create): Print unknown -verbose option.
........
  r7780 | twisti | 2007-04-20 14:53:45 +0200 (Fri, 20 Apr 2007) | 2 lines

  * src/vm/vm.c (version): Print libjvm.so path.
........
  r7781 | twisti | 2007-04-20 15:06:45 +0200 (Fri, 20 Apr 2007) | 4 lines

  * src/native/vm/cldc1.1/com_sun_cldchi_jvm_JVM.c (loadLibrary): Fixed
  string-internal warnings.
  * src/native/vm/cldc1.1/java_lang_System.c (getProperty0): Likewise.
........
  r7782 | twisti | 2007-04-20 15:09:36 +0200 (Fri, 20 Apr 2007) | 2 lines

  * src/vm/vm.c: Changed header order to prevent a warning.
........
  r7783 | twisti | 2007-04-20 15:28:27 +0200 (Fri, 20 Apr 2007) | 16 lines

  * src/toolbox/list.h (listnode): Renamed to listnode_t.
  (list): Renamed to list_t.

  * src/toolbox/list.c,
  src/vm/jit/codegen-common.c,
  src/vm/jit/codegen-common.h,
  src/vm/jit/emit-common.c,
  src/vm/jit/optimizing/profile.c,
  src/vm/jit/optimizing/recompile.c,
  src/vm/jit/optimizing/recompile.h,
  src/vm/properties.c,
  src/vmcore/class.c,
  src/vmcore/class.h,
  src/vmcore/suck.c,
  src/vmcore/suck.h: Likewise.
........
  r7784 | twisti | 2007-04-20 15:51:41 +0200 (Fri, 20 Apr 2007) | 9 lines

  * src/toolbox/list.h (list_t): Added size.

  * src/toolbox/list.c (list_create): Initialize size.
  (list_create_dump): Likewise.
  (list_add_first): Increase size.
  (list_add_last_unsynced): Likewise.
  (list_add_before): Likewise.
  (list_remove_unsynced): Decrease size.
........
  r7785 | edwin | 2007-04-21 12:55:30 +0200 (Sat, 21 Apr 2007) | 6 lines

  * src/vm/jit/replace.c, src/vm/jit/intrp/asmpart.c,
  src/vm/jit/codegen-common.c, src/vm/builtin.c, src/vm/exceptions.c,
  src/vm/vm.c, src/threads/native/lock.c (ENABLE_VMLOG): Applied the
  vmlog patch and wrapped all inserted code with
  #if defined(ENABLE_VMLOG).
........
  r7786 | edwin | 2007-04-21 14:37:47 +0200 (Sat, 21 Apr 2007) | 6 lines

  * configure.ac (--enable-vmlog): New configure option.

  * src/vm/jit/Makefile.am, src/vm/Makefile.am,
  src/threads/native/Makefile.am (AM_CPPFLAGS): Added -I for vmlog
  includes.
........
  r7787 | edwin | 2007-04-21 14:48:14 +0200 (Sat, 21 Apr 2007) | 3 lines

  * contrib/vmlog/vmlog_cacao.patch: Removed. It is no longer needed.
  * contrib/vmlog/README: Updated for CACAO's --enable-vmlog.
........
  r7788 | edwin | 2007-04-21 18:26:34 +0200 (Sat, 21 Apr 2007) | 2 lines

  * contrib/vmlog/Makefile: Renamed to maintain.mk.
........
  r7789 | edwin | 2007-04-21 18:42:52 +0200 (Sat, 21 Apr 2007) | 4 lines

  * configure.ac: Generate vmlog Makefiles.
  * contrib/Makefile.am: Added vmlog to SUBDIRS.
  * contrib/vmlog/Makefile.am, contrib/vmlog/t/Makefile.am: New files.
........
  r7790 | edwin | 2007-04-21 20:56:43 +0200 (Sat, 21 Apr 2007) | 3 lines

  * tests/regression/resolving/Makefile.am: Added "-classpath ." to javac
  options so the tests work with ecj out-of-the-box.
........
  r7791 | ajordan | 2007-04-22 17:55:51 +0200 (Sun, 22 Apr 2007) | 13 lines

  * src/vm/jit/sparc64/arch.h: Properly activated all FP features SPARC64 supports in hardware.

  * src/vm/jit/sparc64/asmpart.S: Added functions to read/write the FP state register.
  * src/vm/jit/sparc64/md.c: Added prototypes here.

  * src/vm/jit/sparc64/codegen.h: Added 'branch on FP condition codes' macros.

  * src/vm/jit/sparc64/emit.c (emit_verbosecall_enter): Fixed FP argument passing.

  * src/vm/jit/sparc64/codegen.c (codegen_emit): Fixed FP conversion functions to (a) use unique slots in the data segment (doh!),
  (b) catch the case where NaN is converted to an integer value. (JVMS and SPARC do not inherently agree here).
........
  r7792 | tbfg | 2007-04-22 22:02:05 +0200 (Sun, 22 Apr 2007) | 31 lines

  * src/vm/jit/m68k/linux/md-os.c (md_signal_handler_sigsegv): Implemented.
  (md_signal_handler_sigill): More exceptions handled. Some fixes.

  * src/vm/jit/m68k/linux/md-os.h
  (M68K_EXCEPTION_HARDWARE_NULLPOINTER): Used instead of
  EXCEPTION_HARDWARE_NULLPOINTER, because a trap with value #0 will
  not be taken.

  * src/vm/jit/m68k/emit.c (emit_load_[low|high]): Fixed assertion.
  (emit_arrayindexoutofbounds_check): Implemented.
  (emit_nullpointer_check): Implemented.
  (emit_exception_check_ireg): Renamed emit_exception_check.
  (emit_exception_check_areg): Disabled code.
  (emit_exception_check): Implemented.

  * src/vm/jit/m68k/codegen.c (ICMD_LALOAD): Implemented.
  (ICMD_FALOAD): Implemented.
  (ICMD_DALOAD): Implemented.
  (ICMD_LASTORE): Implemented.
  (ICMD_FASTORE): Implemented.
  (ICMD_DASTORE): Implemented.
  (ICMD_BUILTIN): Exception check enabled.
  (ICMD_MULTIANEWARRAY): Implemented.
  (codegen_emit_stub_native): Exception check implemented.

  * src/vm/jit/m68k/asmpart.S (asm_handle_nat_exception): Symbol
  exported and implemented.

  * src/vm/jit/stacktrace.c (stacktrace_create_extern_stackframe): More
  m68k fixes.
........
  r7793 | twisti | 2007-04-23 16:29:48 +0200 (Mon, 23 Apr 2007) | 3 lines

  * src/vm/signal.c (signal_thread): Don't check for an error on
  sigwait (revisit this patch with the exact-GC).
........
  r7795 | twisti | 2007-04-23 22:03:38 +0200 (Mon, 23 Apr 2007) | 2 lines

  * src/vm/builtin.h (md-abi.h): Added.
........
  r7796 | twisti | 2007-04-23 22:04:44 +0200 (Mon, 23 Apr 2007) | 4 lines

  * configure.ac: Removed all classpath related checks and made
  functions for them.
  * m4/classpath.m4: New file.
........

--HG--
branch : exact-gc

54 files changed:
configure.ac
contrib/Makefile.am
contrib/vmlog/Makefile [deleted file]
contrib/vmlog/README
contrib/vmlog/vmlog_cacao.patch [deleted file]
src/cacaoh/dummy.c
src/mm/cacao-gc/final.c
src/mm/cacao-gc/final.h
src/native/vm/cldc1.1/com_sun_cldchi_jvm_JVM.c
src/native/vm/cldc1.1/java_lang_System.c
src/threads/native/Makefile.am
src/threads/native/lock.c
src/threads/threads-common.h
src/toolbox/list.c
src/toolbox/list.h
src/vm/Makefile.am
src/vm/builtin.c
src/vm/builtin.h
src/vm/exceptions.c
src/vm/exceptions.h
src/vm/jit/Makefile.am
src/vm/jit/codegen-common.c
src/vm/jit/codegen-common.h
src/vm/jit/emit-common.c
src/vm/jit/intrp/asmpart.c
src/vm/jit/m68k/asmpart.S
src/vm/jit/m68k/codegen.c
src/vm/jit/m68k/codegen.h
src/vm/jit/m68k/emit.c
src/vm/jit/m68k/linux/md-abi.c
src/vm/jit/m68k/linux/md-os.c
src/vm/jit/m68k/linux/md-os.h
src/vm/jit/optimizing/profile.c
src/vm/jit/optimizing/recompile.c
src/vm/jit/optimizing/recompile.h
src/vm/jit/powerpc/darwin/md-abi.c
src/vm/jit/powerpc/darwin/md-abi.h
src/vm/jit/powerpc/darwin/md-os.c
src/vm/jit/replace.c
src/vm/jit/sparc64/arch.h
src/vm/jit/sparc64/asmpart.S
src/vm/jit/sparc64/codegen.c
src/vm/jit/sparc64/codegen.h
src/vm/jit/sparc64/emit.c
src/vm/jit/sparc64/md.c
src/vm/jit/stacktrace.c
src/vm/properties.c
src/vm/signal.c
src/vm/vm.c
src/vmcore/class.c
src/vmcore/class.h
src/vmcore/suck.c
src/vmcore/suck.h
tests/regression/resolving/Makefile.am

index cfbabe42ff01e2db53ec9eab4500defcb8694d08..327d6171e944322c9be3bcf6c7589d4c657b11ca 100644 (file)
@@ -22,12 +22,12 @@ dnl along with this program; if not, write to the Free Software
 dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 dnl 02110-1301, USA.
 dnl 
-dnl $Id: configure.ac 7667 2007-04-05 00:16:05Z michi $
+dnl $Id: configure.ac 7796 2007-04-23 20:04:44Z twisti $
 
 dnl Process this file with autoconf to produce a configure script.
 
 
-AC_INIT(cacao, 0.97+svn, cacao@cacaojvm.org)
+AC_INIT(cacao, 0.98rc, cacao@cacaojvm.org)
 AC_CONFIG_SRCDIR(src/cacao/cacao.c)
 AC_CANONICAL_HOST
 AC_PREREQ(2.59)
@@ -88,6 +88,11 @@ powerpc64 )
     ARCH_CFLAGS="-D__POWERPC64__"
     ;;
 
+s390 )
+    ARCH_DIR="s390"
+    ARCH_CFLAGS="-D__S390__"
+    ;;
+
 sparc | sparc64 )
     ARCH_DIR="sparc64"
     ARCH_CFLAGS="-mcpu=v9 -m64 -D__SPARC_64__"
@@ -105,12 +110,6 @@ xdspcore )
     USE_SCHEDULER="1"
     ;;
 
-s390 )
-    ARCH_DIR="s390"
-    ARCH_CFLAGS="-D__S390__"
-    ;;
-
-
 * )
     AC_MSG_ERROR($host_cpu systems are not supported at this time)
     ;;
@@ -423,6 +422,23 @@ if test x"${ENABLE_MEMCHECK}" = "xyes"; then
 fi
 
 
+dnl check for vmlog support
+AC_MSG_CHECKING(whether vmlog tracing should be enabled)
+AC_ARG_ENABLE([vmlog],
+              [AS_HELP_STRING(--enable-vmlog,enable vmlog tracing [[default=no]])],
+              [case "${enableval}" in
+                   yes) ENABLE_VMLOG=yes;;
+                   *) ENABLE_VMLOG=no;;
+               esac],
+              [ENABLE_VMLOG=no])
+AC_MSG_RESULT(${ENABLE_VMLOG})
+AM_CONDITIONAL([ENABLE_VMLOG], test x"${ENABLE_VMLOG}" = "xyes")
+
+if test x"${ENABLE_VMLOG}" = "xyes"; then
+    AC_DEFINE([ENABLE_VMLOG], 1, [enable vmlog tracing code])
+fi
+
+
 dnl check for disassembler support
 AC_MSG_CHECKING(whether disassembler should be enabled)
 AC_ARG_ENABLE([disassembler],
@@ -855,80 +871,11 @@ AC_DEFINE_UNQUOTED([CACAO_VM_ZIP], "${CACAO_VM_ZIP}", [CACAO's vm.zip])
 AC_SUBST(CACAO_VM_ZIP)
 
 
-dnl which Java core library are we using?
-AC_MSG_CHECKING(which Java core library to use)
-AC_ARG_WITH([classpath],
-            [AS_HELP_STRING(--with-classpath=<type>,specifies which type of classpath to use as Java core library (gnu) [[default=gnu]])],
-            [case "${withval}" in
-                cldc1.1)
-                    WITH_CLASSPATH=cldc1.1
-                    AC_DEFINE([WITH_CLASSPATH_CLDC1_1], 1, [use Sun's CLDC1.1 classes])
-                    AC_SUBST(WITH_CLASSPATH_CLDC1_1)
-                    ;;
-                gnu)
-                    WITH_CLASSPATH=gnu
-                    AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
-                    AC_SUBST(WITH_CLASSPATH_GNU)
-                    ;;
-                *)
-                    AC_MSG_ERROR(unknown classpath ${withval})
-                    ;;
-             esac],
-            [WITH_CLASSPATH=gnu
-             AC_DEFINE([WITH_CLASSPATH_GNU], 1, [use GNU Classpath])
-             AC_SUBST(WITH_CLASSPATH_GNU)])
-AC_MSG_RESULT(${WITH_CLASSPATH})
-AM_CONDITIONAL([WITH_CLASSPATH_CLDC1_1], test x"${WITH_CLASSPATH}" = "xcldc1.1")
-AM_CONDITIONAL([WITH_CLASSPATH_GNU], test x"${WITH_CLASSPATH}" = "xgnu")
-
-
-dnl where is Java core library installed?
-AC_MSG_CHECKING(where Java core library is installed)
-AC_ARG_WITH([classpath-prefix],
-            [AS_HELP_STRING(--with-classpath-prefix=<dir>,installation directory of Java core library [[default=/usr/local/classpath]])],
-            [CLASSPATH_PREFIX=${withval}],
-            [CLASSPATH_PREFIX=/usr/local/classpath])
-AC_MSG_RESULT(${CLASSPATH_PREFIX})
-AC_DEFINE_UNQUOTED([CLASSPATH_PREFIX], "${CLASSPATH_PREFIX}", [Java core library installation directory])
-AC_SUBST(CLASSPATH_PREFIX)
-
-
-dnl where are Java core library classes installed?
-AC_MSG_CHECKING(where Java core library classes are installed)
-AC_ARG_WITH([classpath-classes],
-            [AS_HELP_STRING(--with-classpath-classes=<path>,path to Java core library classes (includes the name of the file and may be flat) [[default=/usr/local/classpath/share/classpath/glibj.zip]])],
-            [CLASSPATH_CLASSES=${withval}],
-            [CLASSPATH_CLASSES=${CLASSPATH_PREFIX}/share/classpath/glibj.zip])
-AC_MSG_RESULT(${CLASSPATH_CLASSES})
-AC_DEFINE_UNQUOTED([CLASSPATH_CLASSES], "${CLASSPATH_CLASSES}", [Java core library classes])
-AC_SUBST(CLASSPATH_CLASSES)
-
-
-dnl where are Java core library native libraries installed?
-AC_MSG_CHECKING(where Java core library native libraries are installed)
-AC_ARG_WITH([classpath-libdir],
-            [AS_HELP_STRING(--with-classpath-libdir=<dir>,installation directory of Java core library native libraries [[default=/usr/local/classpath/lib]])],
-            [CLASSPATH_LIBDIR=${withval}],
-            [CLASSPATH_LIBDIR=${CLASSPATH_PREFIX}/lib])
-AC_MSG_RESULT(${CLASSPATH_LIBDIR})
-
-dnl expand CLASSPATH_LIBDIR to something that is usable in C code
-AS_AC_EXPAND([CLASSPATH_LIBDIR], ${CLASSPATH_LIBDIR})
-AC_DEFINE_UNQUOTED([CLASSPATH_LIBDIR], "${CLASSPATH_LIBDIR}", [Java core library native libraries installation directory])
-AC_SUBST(CLASSPATH_LIBDIR)
-
-
-dnl where are Java core library headers installed?
-AC_MSG_CHECKING(where Java core library headers are installed)
-AC_ARG_WITH([classpath-includedir],
-            [AS_HELP_STRING(--with-classpath-includedir=<dir>,installation directory of Java core library headers [[default=/usr/local/classpath/include]])],
-            [CLASSPATH_INCLUDEDIR=${withval}],
-            [CLASSPATH_INCLUDEDIR=${CLASSPATH_PREFIX}/include])
-AC_MSG_RESULT(${CLASSPATH_INCLUDEDIR})
-
-AC_CHECK_HEADER([${CLASSPATH_INCLUDEDIR}/jni.h],
-                [AC_DEFINE_UNQUOTED([CLASSPATH_JNI_H], "${CLASSPATH_INCLUDEDIR}/jni.h", [Java core library jni.h header])],
-                [AC_MSG_ERROR(cannot find jni.h)])
+AC_CHECK_WITH_CLASSPATH
+AC_CHECK_WITH_CLASSPATH_PREFIX
+AC_CHECK_WITH_CLASSPATH_CLASSES
+AC_CHECK_WITH_CLASSPATH_LIBDIR
+AC_CHECK_WITH_CLASSPATH_INCLUDEDIR
 
 
 dnl if we compile for a JRE-style directory layout
@@ -989,6 +936,8 @@ AC_CONFIG_FILES([Makefile]
                [contrib/Makefile]
                [contrib/setenvinstalled]
                [contrib/setenvsource]
+               [contrib/vmlog/Makefile]
+               [contrib/vmlog/t/Makefile]
                [doc/Makefile]
                [doc/handbook/Makefile]
                [man/Makefile]
index 382060d2c7b93d4d6e0186fb3ca7d3efc554827b..133d0f90821834e8af9fab0099718c02997d94cd 100644 (file)
 ##
 ## Changes:
 ##
-## $Id: Makefile.am 4357 2006-01-22 23:33:38Z twisti $
+## $Id: Makefile.am 7789 2007-04-21 16:42:52Z edwin $
 
 ## Process this file with automake to produce Makefile.in
 
+SUBDIRS = vmlog
+
 noinst_DATA = \
        setenvinstalled.in \
        setenvsource.in
diff --git a/contrib/vmlog/Makefile b/contrib/vmlog/Makefile
deleted file mode 100644 (file)
index 3821b68..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-VERSION=0.0.5
-RELEASENAME=vmlog-$(VERSION)
-TARBALL=releases/$(RELEASENAME).tar.gz
-
-CFLAGS=-g -ansi -std=c99 -pedantic -Wall -Wno-long-long -Wno-unused-function -I/home/edwin/local/classpath/include
-#CFLAGS_TOOL=-O2 -DNDEBUG -ansi -std=c99 -march=pentium4m -pedantic -Wall -Wno-long-long
-CFLAGS_TOOL=-g3 -pedantic -ansi -std=c99 -Wall -Wno-long-long -Wno-unused-function
-
-all: vmlog.o vmlogdump vmlogindex vmlogdiff
-
-runtests: t/hash.run t/memdup.run t/string.run t/threadhash.run t/file.run t/log.run t/concat.run t/ring.run t/opt.run t/tags.run
-
-test: cleantests runtests
-       cat TESTRESULTS
-
-cleantests:
-       @rm -f TESTIDX TESTSTR TESTLOG? TESTFILE TESTRESULTS
-       
-%.run: %.c t/prolog.h vmlog.c vmlog.h
-       $(CC) $(CFLAGS) -I. -o $* $<
-       echo $* >>TESTRESULTS
-       { $* || echo "FAILED: exitcode == $$?" ; } | uniq -c >>TESTRESULTS
-
-vmlogdump: vmlogdump.c vmlog.c vmlog.h
-       $(CC) $(CFLAGS_TOOL) -o $@ vmlogdump.c vmlog.c
-vmlogindex: vmlogindex.c vmlog.c vmlog.h
-       $(CC) $(CFLAGS_TOOL) -o $@ vmlogindex.c vmlog.c
-vmlogdiff: vmlogdiff.c vmlog.c vmlog.h
-       $(CC) $(CFLAGS_TOOL) -o $@ vmlogdiff.c vmlog.c
-
-cscope:
-       cscope -b *.[ch] t/*.[ch]
-
-clean: cleantests
-       rm -f *.o
-       rm -f vmlogdump vmlogindex vmlogdiff
-       rm -f cscope.out
-       rm -f t/hash t/memdup t/string t/threadhash t/file t/log t/concat t/ring t/opt t/tags
-
-checkedin:
-       if (cg-status | grep ^[AMD]) ; then echo "difference to repository!"; exit 1; else /bin/true ; fi
-
-distprep: clean all test clean
-       mkdir $(RELEASENAME)
-       cp -a --parents `git-ls-files` $(RELEASENAME)
-       tar cfz $(TARBALL) $(RELEASENAME)/*
-       rm -rf $(RELEASENAME)
-
-dist: checkedin distprep
-       cg-tag $(VERSION)
index b95a8139945d952e0d0b91be472fe816a6091393..f1fef1161a44ad4a72ae1333f78515d776671605 100644 (file)
@@ -32,7 +32,10 @@ for details.
 How to compile a VM with vmlog
 ------------------------------
 
-You need to do two things:
+CACAO has vmlog support built-in. Use the configure flag --enable-vmlog
+to build it.
+
+For other VMs, you need to do two things:
 
        * patch the VM code with the provided vmlog_<vm>.patch
        * configure the VM with CFLAGS that include -Ivmlogdir
diff --git a/contrib/vmlog/vmlog_cacao.patch b/contrib/vmlog/vmlog_cacao.patch
deleted file mode 100644 (file)
index 0849ab4..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-diff --git a/src/threads/native/lock.c b/src/threads/native/lock.c
-index 6eeec82..b6909f1 100644
---- a/src/threads/native/lock.c
-+++ b/src/threads/native/lock.c
-@@ -53,6 +53,8 @@
- # include "vmcore/statistics.h"
- #endif
-+#include <vmlog_cacao.h>
-+
- /* arch.h must be here because it defines USE_FAKE_ATOMIC_INSTRUCTIONS */
- #include "arch.h"
-@@ -222,6 +224,8 @@ void lock_init(void)
-       pthread_mutex_init(&lock_global_pool_lock, NULL);
-       lock_hashtable_init();
-+
-+      vmlog_cacao_init_lock();
- }
-diff --git a/src/vm/builtin.c b/src/vm/builtin.c
-index a2298c9..168d950 100644
---- a/src/vm/builtin.c
-+++ b/src/vm/builtin.c
-@@ -81,6 +81,8 @@
- #include "vmcore/options.h"
- #include "vmcore/rt-timing.h"
-+#include <vmlog_cacao.h>
-+
- /* include builtin tables *****************************************************/
-@@ -1149,6 +1151,8 @@ java_objectheader *builtin_trace_exception(java_objectheader *xptr,
-       s4    dumpsize;
-       codeinfo *code;
-+      return xptr;
-+
-       if (opt_verbosecall && indent)
-               methodindent--;
-@@ -1420,6 +1424,9 @@ void builtin_verbosecall_enter(s8 a0, s8 a1,
-       s4          i;
-       s4          pos;
-+      vmlog_cacao_enter_method(m);
-+      return;
-+
-       md = m->parseddesc;
-       /* calculate message length */
-@@ -1591,6 +1598,9 @@ void builtin_verbosecall_exit(s8 l, double d, float f, methodinfo *m)
-       s4          pos;
-       imm_union   val;
-+      vmlog_cacao_leave_method(m);
-+      return;
-+
-       md = m->parseddesc;
-       /* calculate message length */
-@@ -2683,6 +2693,9 @@ java_objectheader *builtin_clone(void *env, java_objectheader *o)
-     return co;
- }
-+#define NDEBUG
-+#include <vmlog_cacao.c>
-+
- /*
-  * These are local overrides for various environment variables in Emacs.
-diff --git a/src/vm/exceptions.c b/src/vm/exceptions.c
-index 6754a62..11c3e3c 100644
---- a/src/vm/exceptions.c
-+++ b/src/vm/exceptions.c
-@@ -70,6 +70,8 @@
- #include "vmcore/loader.h"
- #include "vmcore/options.h"
-+#include <vmlog_cacao.h>
-+
- /* for raising exceptions from native methods *********************************/
-@@ -1771,6 +1773,8 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
-               builtin_trace_exception(xptr, m, xpc, 1);
- #endif
-+      vmlog_cacao_throw(xptr);
-+
-       for (i = 0; i < exceptiontablelength; i++) {
-               /* ATTENTION: keep this here, as we need to decrement the
-            pointer before the loop executes! */
-@@ -1795,6 +1799,8 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
- #if !defined(NDEBUG)
-                               /* Print stacktrace of exception when caught. */
-+                              vmlog_cacao_catch(xptr);
-+
-                               if (opt_verboseexception) {
-                                       exceptions_print_exception(xptr);
-                                       stacktrace_print_trace(xptr);
-@@ -1852,6 +1858,8 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
- #if !defined(NDEBUG)
-                               /* Print stacktrace of exception when caught. */
-+                              vmlog_cacao_catch(xptr);
-+
-                               if (opt_verboseexception) {
-                                       exceptions_print_exception(xptr);
-                                       stacktrace_print_trace(xptr);
-@@ -1884,6 +1892,8 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
-       /* none of the exceptions catch this one */
-+      vmlog_cacao_unwnd_method(m);
-+
-       return NULL;
- }
- #endif /* defined(ENABLE_JIT) */
-diff --git a/src/vm/jit/codegen-common.c b/src/vm/jit/codegen-common.c
-index 5981383..a5581b3 100644
---- a/src/vm/jit/codegen-common.c
-+++ b/src/vm/jit/codegen-common.c
-@@ -101,6 +101,8 @@
- # include "vmcore/statistics.h"
-+#include <vmlog_cacao.h>
-+
- /* in this tree we store all method addresses *********************************/
-@@ -640,6 +642,8 @@ u1 *codegen_get_pv_from_pc(u1 *pc)
-       if (mte == NULL) {
-               /* No method was found.  Let's dump a stacktrace. */
-+              vmlog_cacao_signl("SIGSEGV");
-+
-               log_println("We received a SIGSEGV and tried to handle it, but we were");
-               log_println("unable to find a Java method at:");
-               log_println("");
-diff --git a/src/vm/jit/intrp/asmpart.c b/src/vm/jit/intrp/asmpart.c
-index 52ec0d4..e9bcc50 100644
---- a/src/vm/jit/intrp/asmpart.c
-+++ b/src/vm/jit/intrp/asmpart.c
-@@ -53,6 +53,8 @@
- #include "vmcore/loader.h"
- #include "vmcore/options.h"
-+#include <vmlog_cacao.h>
-+
- static bool intrp_asm_vm_call_method_intern(methodinfo *m, s4 vmargscount,
-                                                                                       vm_arg *vmargs)
-@@ -206,6 +208,8 @@ Inst *intrp_asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell
-                 builtin_trace_exception(o, m, ip, 1);
- #endif
-+        vmlog_cacao_throw(o);
-+
-         for (i = 0; i < exceptiontablelength; i++) {
-                 ex--;
-@@ -260,6 +264,8 @@ Inst *intrp_asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell
-                 if (ip-1 >= (Inst *) ex->startpc && ip-1 < (Inst *) ex->endpc &&
-                         (c == NULL || builtin_instanceof(o, c))) 
-                 {
-+                        vmlog_cacao_catch(o);
-+
-                         *new_spp = (Cell *)(((u1 *)fp) - framesize - SIZEOF_VOID_P);
-                         *new_fpp = fp;
-                         return (Inst *) (ex->handlerpc);
-@@ -289,6 +295,8 @@ Inst *intrp_asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell
-         /* unwind stack frame */
-+        vmlog_cacao_unwnd_method(m);
-+
-         ip = (Inst *)access_local_cell(-framesize - SIZEOF_VOID_P);
-         fp = (Cell *)access_local_cell(-framesize);
-   }
-diff --git a/src/vm/jit/replace.c b/src/vm/jit/replace.c
-index e16217b..7bbeeb6 100644
---- a/src/vm/jit/replace.c
-+++ b/src/vm/jit/replace.c
-@@ -57,6 +57,7 @@
- #define REPLACE_PATCH_DYNAMIC_CALL
- /*#define REPLACE_PATCH_ALL*/
-+#include <vmlog_cacao.h>
- /*** architecture-dependent configuration *************************************/
-@@ -2309,6 +2310,7 @@ sourcestate_t *replace_recover_source_state(rplpoint *rp,
-                          replace_replacement_point_println(rp, 1); );
-               replace_read_executionstate(rp, es, ss, ss->frames == NULL);
-+              vmlog_cacao_unrol_method(ss->frames->method);
- #if defined(REPLACE_STATISTICS)
-               REPLACE_COUNT(stat_frames);
-@@ -2529,6 +2531,7 @@ static void replace_build_execution_state_intern(sourcestate_t *ss,
-               es->code = ss->frames->tocode;
-               prevframe = ss->frames;
-+              vmlog_cacao_rerol_method(ss->frames->method);
-               replace_write_executionstate(rp, es, ss, ss->frames->down == NULL);
-               DOLOG( replace_executionstate_println(es); );
-diff --git a/src/vm/vm.c b/src/vm/vm.c
-index 362e2fd..0396243 100644
---- a/src/vm/vm.c
-+++ b/src/vm/vm.c
-@@ -82,6 +82,8 @@
- # include "native/jvmti/cacaodbg.h"
- #endif
-+#include <vmlog_cacao.h>
-+
- /* Invocation API variables ***************************************************/
-@@ -739,6 +741,8 @@ bool vm_create(JavaVMInitArgs *vm_args)
-       jdwp = agentbypath = false;
- #endif
-+      vmlog_cacao_init(vm_args);
-+
-       /* check the JNI version requested */
-       switch (vm_args->version) {
index 4c1fcfde0b53dc18175b36efcd165dd3b7722cae..8b682765eb31e8b11a4077ef45176987ff573019 100644 (file)
@@ -184,6 +184,7 @@ void exceptions_clear_exception(void)
 
 void exceptions_print_current_exception(void)
 {
+       abort();
 }
 
 void exceptions_throw_abstractmethoderror(void)
@@ -278,13 +279,6 @@ void exceptions_throw_noclassdeffounderror_wrong_name(classinfo *c, utf *name)
        abort();
 }
 
-void exceptions_throw_outofmemoryerror(void)
-{
-       fprintf(stderr, "java.lang.OutOfMemoryError\n");
-
-       abort();
-}
-
 void exceptions_throw_verifyerror(methodinfo *m, const char *message)
 {
        fprintf(stderr, "java.lang.VerifyError: ");
@@ -336,18 +330,6 @@ void exceptions_throw_unsupportedclassversionerror(classinfo *c,
        abort();
 }
 
-void exceptions_throw_illegalaccessexception(classinfo *c)
-{
-       fprintf(stderr, "java.lang.IllegalAccessException: ");
-
-       if (c != NULL)
-               utf_fprint_printable_ascii_classname(stderr, c->name);
-
-       fputc('\n', stderr);
-
-       abort();
-}
-
 void exceptions_throw_nullpointerexception(void)
 {
        fprintf(stderr, "java.lang.NullPointerException\n");
index c64aece274ab8f43bab5850a77dc7459450b56a6..95d2d3f6f2fe97c6db7ce63bf974266f19fbc3aa 100644 (file)
@@ -39,7 +39,7 @@
 
 /* Global Variables ***********************************************************/
 
-list *final_list;
+list_t *final_list;
 
 
 
index 93130401869499d0c3300e3ff9ac6cc1c6efaf38..36a62d8c35d8826d25b6867ac16461c9936d94db 100644 (file)
@@ -38,7 +38,7 @@
 
 /* Global Variables ***********************************************************/
 
-extern list *final_list;
+extern list_t *final_list;
 
 
 /* Structures *****************************************************************/
@@ -51,7 +51,7 @@ typedef struct final_entry final_entry;
 #define FINAL_FINALIZED   4
 
 struct final_entry {
-       listnode           linkage;
+       listnode_t         linkage;
        u4                 type;
        java_objectheader *o;
        methodinfo        *finalizer;
index 8579b95f5c9659776f74f6adb1ea220b331fa031..4a42b030a9cdf9bb43e06c5e928153fe255da39e 100644 (file)
@@ -59,7 +59,7 @@ JNIEXPORT void JNICALL Java_com_sun_cldchi_jvm_JVM_loadLibrary(JNIEnv *env, jcla
        /* check for error and throw one in case */
 
        if (result == 0) {
-               name = javastring_toutf(libName, 0);
+               name = javastring_toutf((java_objectheader *) libName, false);
                exceptions_throw_unsatisfiedlinkerror(name);
        }
 }
index d0f48bdd9cdae10256f653f13e54a15fd96de568..ff415f17fb2bf54e25576ae57cc83c67051b3176 100644 (file)
@@ -1,6 +1,6 @@
-/* src/native/vm/java_lang_System.c
+/* src/native/vm/cldc1.1/java_lang_System.c
 
-   Copyright (C) 2006 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   Copyright (C) 2006, 2007 R. Grafl, A. Krall, C. Kruegel, C. Oates,
    R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
    C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
    Institut f. Computersprachen - TU Wien
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Phil Tomsich
-            Christian Thalinger
-
    $Id: java_lang_VMRuntime.c 5900 2006-11-04 17:30:44Z michi $
 
 */
@@ -72,7 +67,7 @@ JNIEXPORT java_lang_String* JNICALL Java_java_lang_System_getProperty0(JNIEnv *e
        java_objectheader *so;
        char*              key;
        char*              value;
-       java_lang_String*  result;
+       java_objectheader *result;
 
        so = (java_objectheader *) s;
 
@@ -93,7 +88,7 @@ JNIEXPORT java_lang_String* JNICALL Java_java_lang_System_getProperty0(JNIEnv *e
 
        result = javastring_new_from_ascii(value);
 
-       return result;
+       return (java_lang_String *) result;
 }
 
 
index 64461426c2882bb4b341684d30e77db17ca4764d..a8ce9b28449a23cfc17fad06b0696f5deba118e4 100644 (file)
 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 ## 02110-1301, USA.
 ##
-## $Id: Makefile.am 7338 2007-02-13 00:17:22Z twisti $
+## $Id: Makefile.am 7786 2007-04-21 12:37:47Z edwin $
 
 ## Process this file with automake to produce Makefile.in
 
-AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR) -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)/$(OS_DIR) -I$(top_builddir)/src
+AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR) -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)/$(OS_DIR) -I$(top_builddir)/src -I$(top_srcdir)/contrib/vmlog
 
 LIBS =
 
index 6eeec822fb1f4ab88d694f33e7b59541cbac7c11..a6078339f7da4834877cb3b7ffd3688ea54d4375 100644 (file)
 # include "vmcore/statistics.h"
 #endif
 
+#if defined(ENABLE_VMLOG)
+#include <vmlog_cacao.h>
+#endif
+
 /* arch.h must be here because it defines USE_FAKE_ATOMIC_INSTRUCTIONS */
 
 #include "arch.h"
@@ -222,6 +226,10 @@ void lock_init(void)
        pthread_mutex_init(&lock_global_pool_lock, NULL);
 
        lock_hashtable_init();
+
+#if defined(ENABLE_VMLOG)
+       vmlog_cacao_init_lock();
+#endif
 }
 
 
index 4e78f9e40b28168433aee5db26d72edc0ad9158d..a605f28042ddafdda56dd67e9f8128580fea8f61 100644 (file)
@@ -34,6 +34,9 @@
 #include "vm/types.h"
 
 #include "vm/global.h"
+
+#include "native/jni.h"
+
 #include "native/include/java_lang_Thread.h"
 
 #if defined(ENABLE_THREADS)
index 33fefd713f9bc586f32dec54d0129e5b90e6235d..e5a46d5c3dc5fac5cfabe3b5851b8e5393847ee5 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: list.c 7601 2007-03-28 23:02:50Z michi $
+   $Id: list.c 7784 2007-04-20 13:51:41Z twisti $
 
 */
 
 
 *******************************************************************************/
 
-list *list_create(s4 nodeoffset)
+list_t *list_create(s4 nodeoffset)
 {
-       list *l;
+       list_t *l;
 
-       l = NEW(list);
+       l = NEW(list_t);
 
 #if defined(ENABLE_THREADS)
        lock_init_object_lock((java_objectheader *) l);
@@ -63,6 +63,7 @@ list *list_create(s4 nodeoffset)
        l->first      = NULL;
        l->last       = NULL;
        l->nodeoffset = nodeoffset;
+       l->size       = 0;
 
        return l;
 }
@@ -76,25 +77,32 @@ list *list_create(s4 nodeoffset)
 
 *******************************************************************************/
 
-list *list_create_dump(s4 nodeoffset)
+list_t *list_create_dump(s4 nodeoffset)
 {
-       list *l;
+       list_t *l;
 
-       l = DNEW(list);
+       l = DNEW(list_t);
 
        l->first      = NULL;
        l->last       = NULL;
        l->nodeoffset = nodeoffset;
+       l->size       = 0;
 
        return l;
 }
 
 
-void list_add_first(list *l, void *element)
+/* list_add_first **************************************************************
+
+   Adds the element as first element.
+
+*******************************************************************************/
+
+void list_add_first(list_t *l, void *element)
 {
-       listnode *ln;
+       listnode_t *ln;
 
-       ln = (listnode *) (((u1 *) element) + l->nodeoffset);
+       ln = (listnode_t *) (((u1 *) element) + l->nodeoffset);
 
        LOCK_MONITOR_ENTER(l);
 
@@ -111,6 +119,10 @@ void list_add_first(list *l, void *element)
                l->first = ln;
        }
 
+       /* increase number of elements */
+
+       l->size++;
+
        LOCK_MONITOR_EXIT(l);
 }
 
@@ -121,7 +133,7 @@ void list_add_first(list *l, void *element)
 
 *******************************************************************************/
 
-void list_add_last(list *l, void *element)
+void list_add_last(list_t *l, void *element)
 {
        LOCK_MONITOR_ENTER(l);
 
@@ -139,11 +151,11 @@ void list_add_last(list *l, void *element)
 
 *******************************************************************************/
 
-void list_add_last_unsynced(list *l, void *element)
+void list_add_last_unsynced(list_t *l, void *element)
 {
-       listnode *ln;
+       listnode_t *ln;
 
-       ln = (listnode *) (((u1 *) element) + l->nodeoffset);
+       ln = (listnode_t *) (((u1 *) element) + l->nodeoffset);
 
        if (l->last) {
                ln->prev      = l->last;
@@ -157,6 +169,10 @@ void list_add_last_unsynced(list *l, void *element)
                l->last  = ln;
                l->first = ln;
        }
+
+       /* increase number of elements */
+
+       l->size++;
 }
 
 
@@ -168,13 +184,13 @@ void list_add_last_unsynced(list *l, void *element)
 
 *******************************************************************************/
 
-void list_add_before(list *l, void *element, void *newelement)
+void list_add_before(list_t *l, void *element, void *newelement)
 {
-       listnode *ln;
-       listnode *newln;
+       listnode_t *ln;
+       listnode_t *newln;
 
-       ln    = (listnode *) (((u1 *) element) + l->nodeoffset);
-       newln = (listnode *) (((u1 *) newelement) + l->nodeoffset);
+       ln    = (listnode_t *) (((u1 *) element) + l->nodeoffset);
+       newln = (listnode_t *) (((u1 *) newelement) + l->nodeoffset);
 
        LOCK_MONITOR_ENTER(l);
 
@@ -196,6 +212,10 @@ void list_add_before(list *l, void *element, void *newelement)
        if (l->last == ln)
                l->last = newln;
 
+       /* increase number of elements */
+
+       l->size++;
+
        LOCK_MONITOR_EXIT(l);
 }
 
@@ -206,7 +226,7 @@ void list_add_before(list *l, void *element, void *newelement)
 
 *******************************************************************************/
 
-void list_remove(list *l, void *element)
+void list_remove(list_t *l, void *element)
 {
        LOCK_MONITOR_ENTER(l);
 
@@ -224,11 +244,11 @@ void list_remove(list *l, void *element)
 
 *******************************************************************************/
 
-void list_remove_unsynced(list *l, void *element)
+void list_remove_unsynced(list_t *l, void *element)
 {
-       listnode *ln;
+       listnode_t *ln;
 
-       ln = (listnode *) (((u1 *) element) + l->nodeoffset);
+       ln = (listnode_t *) (((u1 *) element) + l->nodeoffset);
        
        if (ln->next)
                ln->next->prev = ln->prev;
@@ -242,6 +262,10 @@ void list_remove_unsynced(list *l, void *element)
 
        ln->next = NULL;
        ln->prev = NULL;
+
+       /* decrease number of elements */
+
+       l->size--;
 }
 
  
@@ -251,7 +275,7 @@ void list_remove_unsynced(list *l, void *element)
 
 *******************************************************************************/
 
-void *list_first(list *l)
+void *list_first(list_t *l)
 {
        void *el;
 
@@ -273,7 +297,7 @@ void *list_first(list *l)
 
 *******************************************************************************/
 
-void *list_first_unsynced(list *l)
+void *list_first_unsynced(list_t *l)
 {
        void *el;
 
@@ -292,7 +316,7 @@ void *list_first_unsynced(list *l)
 
 *******************************************************************************/
 
-void *list_last(list *l)
+void *list_last(list_t *l)
 {
        void *el;
 
@@ -314,7 +338,7 @@ void *list_last(list *l)
 
 *******************************************************************************/
 
-void *list_last_unsynced(list *l)
+void *list_last_unsynced(list_t *l)
 {
        void *el;
 
@@ -333,7 +357,7 @@ void *list_last_unsynced(list *l)
 
 *******************************************************************************/
 
-void *list_next(list *l, void *element)
+void *list_next(list_t *l, void *element)
 {
        void *el;
 
@@ -356,12 +380,12 @@ void *list_next(list *l, void *element)
 
 *******************************************************************************/
 
-void *list_next_unsynced(list *l, void *element)
+void *list_next_unsynced(list_t *l, void *element)
 {
-       listnode *ln;
+       listnode_t *ln;
        void     *el;
 
-       ln = (listnode *) (((u1 *) element) + l->nodeoffset);
+       ln = (listnode_t *) (((u1 *) element) + l->nodeoffset);
 
        if (ln->next == NULL)
                el = NULL;
@@ -378,7 +402,7 @@ void *list_next_unsynced(list *l, void *element)
 
 *******************************************************************************/
 
-void *list_prev(list *l, void *element)
+void *list_prev(list_t *l, void *element)
 {
        void *el;
 
@@ -401,12 +425,12 @@ void *list_prev(list *l, void *element)
 
 *******************************************************************************/
 
-void *list_prev_unsynced(list *l, void *element)
+void *list_prev_unsynced(list_t *l, void *element)
 {
-       listnode *ln;
+       listnode_t *ln;
        void     *el;
 
-       ln = (listnode *) (((u1 *) element) + l->nodeoffset);
+       ln = (listnode_t *) (((u1 *) element) + l->nodeoffset);
 
        if (ln->prev == NULL)
                el = NULL;
index b6a3ed7031a10f3ee77a726c1d1b4bfc9d9065da..c3d3accc3c0cd46ab473a382ca434b654dddc701 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: list.h 7601 2007-03-28 23:02:50Z michi $
+   $Id: list.h 7784 2007-04-20 13:51:41Z twisti $
 
 */
 
@@ -93,56 +93,57 @@ distinct list).
 
 */
 
-/* listnode *******************************************************************/
+/* listnode_t *****************************************************************/
 
-typedef struct listnode listnode;
+typedef struct listnode_t listnode_t;
 
-struct listnode {
-       listnode *next;
-       listnode *prev;
+struct listnode_t {
+       listnode_t *next;
+       listnode_t *prev;
 };
 
 
-/* list ***********************************************************************/
+/* list_t *********************************************************************/
 
-typedef struct list list;
+typedef struct list_t list_t;
 
-struct list {
+struct list_t {
 #if defined(ENABLE_THREADS)
        java_objectheader  lock;            /* threads lock object                */
 #endif
-       listnode          *first;
-       listnode          *last;
+       listnode_t        *first;
+       listnode_t        *last;
        s4                 nodeoffset;
+       s4                 size;            /* number of elements in the list     */
 };
 
 
 /* function prototypes ********************************************************/
 
-list *list_create(s4 nodeoffset);
-list *list_create_dump(s4 nodeoffset);
+list_t *list_create(s4 nodeoffset);
+list_t *list_create_dump(s4 nodeoffset);
 
-void list_add_first(list *l, void *element);
+void   list_add_first(list_t *l, void *element);
 
-void list_add_last(list *l, void *element);
-void list_add_last_unsynced(list *l, void *element);
+void   list_add_last(list_t *l, void *element);
+void   list_add_last_unsynced(list_t *l, void *element);
 
-void list_add_before(list *l, void *element, void *newelement);
+void   list_add_before(list_t *l, void *element, void *newelement);
 
-void list_remove(list *l, void *element);
-void list_remove_unsynced(list *l, void *element);
-void *list_first(list *l);
-void *list_first_unsynced(list *l);
+void   list_remove(list_t *l, void *element);
+void   list_remove_unsynced(list_t *l, void *element);
 
-void *list_last(list *l);
-void *list_last_unsynced(list *l);
+void   *list_first(list_t *l);
+void   *list_first_unsynced(list_t *l);
 
-void *list_next(list *l, void *element);
-void *list_next_unsynced(list *l, void *element);
+void   *list_last(list_t *l);
+void   *list_last_unsynced(list_t *l);
 
-void *list_prev(list *l, void *element);
-void *list_prev_unsynced(list *l, void *element);
+void   *list_next(list_t *l, void *element);
+void   *list_next_unsynced(list_t *l, void *element);
+
+void   *list_prev(list_t *l, void *element);
+void   *list_prev_unsynced(list_t *l, void *element);
 
 #endif /* _LIST_H */
 
index 0161a9c70a0ea7964674379082cbe68cbd7d97d7..aa734bda8b688b4a45e7f343071dec695ce7bc0e 100644 (file)
 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 ## 02110-1301, USA.
 ##
-## $Id: Makefile.am 7483 2007-03-08 13:17:40Z michi $
+## $Id: Makefile.am 7786 2007-04-21 12:37:47Z edwin $
 
 ## Process this file with automake to produce Makefile.in
 
-AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR) -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)/$(OS_DIR) -I$(top_builddir)/src
+AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR) -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)/$(OS_DIR) -I$(top_builddir)/src -I$(top_srcdir)/contrib/vmlog
 
 LIBS =
 
index 562c301192dda23c3a20fa2f1fc33d260b9541ee..839a47d4ecccc2058b10d5a6bdf3125ca5e13c4c 100644 (file)
@@ -28,7 +28,7 @@
    calls instead of machine instructions, using the C calling
    convention.
 
-   $Id: builtin.c 7764 2007-04-19 12:50:37Z twisti $
+   $Id: builtin.c 7797 2007-04-23 20:12:39Z michi $
 
 */
 
 #include "vmcore/options.h"
 #include "vmcore/rt-timing.h"
 
+#if defined(ENABLE_VMLOG)
+#include <vmlog_cacao.h>
+#endif
+
 
 /* include builtin tables *****************************************************/
 
@@ -1217,6 +1221,10 @@ java_objectheader *builtin_trace_exception(java_objectheader *xptr,
        s4    dumpsize;
        codeinfo *code;
 
+#if defined(ENABLE_VMLOG)
+       return xptr;
+#endif
+
        if (opt_verbosecall && indent)
                methodindent--;
 
@@ -1485,6 +1493,11 @@ void builtin_verbosecall_enter(s8 a0, s8 a1,
        s4          i;
        s4          pos;
 
+#if defined(ENABLE_VMLOG)
+       vmlog_cacao_enter_method(m);
+       return;
+#endif
+
        md = m->parseddesc;
 
        /* calculate message length */
@@ -1656,6 +1669,11 @@ void builtin_verbosecall_exit(s8 l, double d, float f, methodinfo *m)
        s4          pos;
        imm_union   val;
 
+#if defined(ENABLE_VMLOG)
+       vmlog_cacao_leave_method(m);
+       return;
+#endif
+
        md = m->parseddesc;
 
        /* calculate message length */
@@ -2748,6 +2766,11 @@ java_objectheader *builtin_clone(void *env, java_objectheader *o)
     return co;
 }
 
+#if defined(ENABLE_VMLOG)
+#define NDEBUG
+#include <vmlog_cacao.c>
+#endif
+
 
 /*
  * These are local overrides for various environment variables in Emacs.
index 658a5937e463dae89d4ef8124ef279fe08879441..e77ef882b0332c795a227b3bdc8d8707a867337c 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: builtin.h 7710 2007-04-15 15:33:35Z michi $
+   $Id: builtin.h 7797 2007-04-23 20:12:39Z michi $
 
 */
 
@@ -34,6 +34,7 @@
 #include "vm/types.h"
 
 #include "arch.h"
+#include "md-abi.h"
 
 #include "toolbox/logging.h"
 
index a32993fda98a37cedbe373fb92e8b14a42599298..1d2259c5e5bd45ea41881b44e8f02c0d7251dcd9 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: exceptions.c 7674 2007-04-05 13:27:11Z michi $
+   $Id: exceptions.c 7785 2007-04-21 10:55:30Z edwin $
 
 */
 
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
 
+#if defined(ENABLE_VMLOG)
+#include <vmlog_cacao.h>
+#endif
+
 
 /* for raising exceptions from native methods *********************************/
 
@@ -1783,6 +1787,10 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
                builtin_trace_exception(xptr, m, xpc, 1);
 #endif
 
+#if defined(ENABLE_VMLOG)
+       vmlog_cacao_throw(xptr);
+#endif
+
        for (i = 0; i < exceptiontablelength; i++) {
                /* ATTENTION: keep this here, as we need to decrement the
            pointer before the loop executes! */
@@ -1807,6 +1815,10 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
 #if !defined(NDEBUG)
                                /* Print stacktrace of exception when caught. */
 
+#if defined(ENABLE_VMLOG)
+                               vmlog_cacao_catch(xptr);
+#endif
+
                                if (opt_verboseexception) {
                                        exceptions_print_exception(xptr);
                                        stacktrace_print_trace(xptr);
@@ -1864,6 +1876,10 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
 #if !defined(NDEBUG)
                                /* Print stacktrace of exception when caught. */
 
+#if defined(ENABLE_VMLOG)
+                               vmlog_cacao_catch(xptr);
+#endif
+
                                if (opt_verboseexception) {
                                        exceptions_print_exception(xptr);
                                        stacktrace_print_trace(xptr);
@@ -1896,6 +1912,10 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
 
        /* none of the exceptions catch this one */
 
+#if defined(ENABLE_VMLOG)
+       vmlog_cacao_unwnd_method(m);
+#endif
+
        return NULL;
 }
 #endif /* defined(ENABLE_JIT) */
index 8bce2f11e257a9dfa2695b366dc17dd600d6365e..f8aa9ab034db179f6b316b691ea60a61bb8b7222 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: exceptions.h 7609 2007-03-29 17:09:48Z michi $
+   $Id: exceptions.h 7773 2007-04-19 19:44:54Z twisti $
 
 */
 
    8-byte boundaries, since normal loads could have such offsets with
    a base of NULL which should result in a NullPointerException.
 
+   NOTE: In signal_init() we have an assert checking that the offset
+   of java_objectheader.data[0] is greater than the largest
+   displacement defined below.  Otherwise normal array loads/stores
+   could trigger an exception.
+
 *******************************************************************************/
 
 #define EXCEPTION_HARDWARE_NULLPOINTER              0
index abe950fefaf3db9165ca890efc2a07106a59de29..16f1664b9cc94b35ff798d4956dfaee69e8d46fc 100644 (file)
 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 ## 02110-1301, USA.
 ##
-## $Id: Makefile.am 7727 2007-04-16 21:18:43Z michi $
+## $Id: Makefile.am 7786 2007-04-21 12:37:47Z edwin $
 
 ## Process this file with automake to produce Makefile.in
 
-AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR) -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)/$(OS_DIR) -I$(top_builddir)/src
+AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR) -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)/$(OS_DIR) -I$(top_builddir)/src -I$(top_srcdir)/contrib/vmlog
 
 LIBS =
 
index 706bacf1fd3b946a65d6e8cafbbb128133183363..bc63d9550039f1f0ab6d44868716813a00264928 100644 (file)
@@ -39,7 +39,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen-common.c 7766 2007-04-19 13:24:48Z michi $
+   $Id: codegen-common.c 7797 2007-04-23 20:12:39Z michi $
 
 */
 
 
 # include "vmcore/statistics.h"
 
+#if defined(ENABLE_VMLOG)
+#include <vmlog_cacao.h>
+#endif
+
 
 /* in this tree we store all method addresses *********************************/
 
@@ -491,7 +495,7 @@ void codegen_resolve_branchrefs(codegendata *cd, basicblock *bptr)
 
 void codegen_branch_label_add(codegendata *cd, s4 label, s4 condition, s4 reg, u4 options)
 {
-       list               *list;
+       list_t             *list;
        branch_label_ref_t *br;
        s4                  mpc;
 
@@ -648,6 +652,10 @@ u1 *codegen_get_pv_from_pc(u1 *pc)
        if (mte == NULL) {
                /* No method was found.  Let's dump a stacktrace. */
 
+#if defined(ENABLE_VMLOG)
+               vmlog_cacao_signl("SIGSEGV");
+#endif
+
                log_println("We received a SIGSEGV and tried to handle it, but we were");
                log_println("unable to find a Java method at:");
                log_println("");
@@ -1390,16 +1398,16 @@ java_objectheader *codegen_finish_native_call(u1 *datasp)
 {
        stackframeinfo     *sfi;
        stackframeinfo    **psfi;
+#if defined(ENABLE_JAVASE)
        localref_table     *lrt;
        localref_table     *plrt;
        s4                  localframes;
+#endif
        java_objectheader  *e;
 
        /* get data structures from stack */
 
        sfi = (stackframeinfo *) (datasp - sizeof(stackframeinfo));
-       lrt = (localref_table *) (datasp - sizeof(stackframeinfo) - 
-                                                         sizeof(localref_table));
 
 #if defined(ENABLE_THREADS) && defined(ENABLE_GC_CACAO)
        /* clear the native world flag */
index e07cb22e35063e0d61da8ec0b93e2d462625e4c0..b70f56fdfff95949a81addec74430bb9e2a6edbf 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: codegen-common.h 7764 2007-04-19 12:50:37Z twisti $
+   $Id: codegen-common.h 7797 2007-04-23 20:12:39Z michi $
 
 */
 
@@ -146,9 +146,9 @@ struct codegendata {
        dataref        *datareferences; /* list of data segment references        */
 #endif
 
-/*     list           *patchrefs; */
+/*     list_t         *patchrefs; */
        patchref       *patchrefs;
-       list           *brancheslabel;
+       list_t         *brancheslabel;
 
        linenumberref  *linenumberreferences; /* list of line numbers and the     */
                                        /* program counters of their first        */
@@ -201,7 +201,7 @@ struct branch_label_ref_t {
        s4         condition;       /* conditional branch condition               */
        s4         reg;             /* register number to check                   */
        u4         options;         /* branch options                             */
-       listnode   linkage;
+       listnode_t linkage;
 };
 
 
index 243109adc6b2754a6c65a1b6fc428d252d8094de..dec288b7d3e9fe827a5330b539bc3374fe85dc55 100644 (file)
@@ -454,7 +454,7 @@ void emit_bnan(codegendata *cd, basicblock *target)
 
 void emit_label_bccz(codegendata *cd, s4 label, s4 condition, s4 reg, u4 options)
 {
-       list               *list;
+       list_t             *list;
        branch_label_ref_t *br;
        s4                  mpc;
        s4                  disp;
@@ -509,7 +509,7 @@ void emit_label_bccz(codegendata *cd, s4 label, s4 condition, s4 reg, u4 options
 
 void emit_label(codegendata *cd, s4 label)
 {
-       list               *list;
+       list_t             *list;
        branch_label_ref_t *br;
        s4                  mpc;
        s4                  disp;
index 4a3ec9a5de600a4e81d8b6dac2e989d6b24cb75f..1de3e70eefaed1b1e890347613ce4946ee66af8f 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: asmpart.c 7688 2007-04-12 09:05:12Z michi $
+   $Id: asmpart.c 7785 2007-04-21 10:55:30Z edwin $
 
 */
 
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
 
+#if defined(ENABLE_VMLOG)
+#include <vmlog_cacao.h>
+#endif
+
 
 static bool intrp_asm_vm_call_method_intern(methodinfo *m, s4 vmargscount,
                                                                                        vm_arg *vmargs)
@@ -207,6 +211,10 @@ Inst *intrp_asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell
                  builtin_trace_exception(o, m, ip, 1);
 #endif
 
+#if defined(ENABLE_VMLOG)
+         vmlog_cacao_throw(o);
+#endif
+
          for (i = 0; i < exceptiontablelength; i++) {
                  ex--;
 
@@ -261,6 +269,10 @@ Inst *intrp_asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell
                  if (ip-1 >= (Inst *) ex->startpc && ip-1 < (Inst *) ex->endpc &&
                          (c == NULL || builtin_instanceof(o, c))) 
                  {
+#if defined(ENABLE_VMLOG)
+                         vmlog_cacao_catch(o);
+#endif
+
                          *new_spp = (Cell *)(((u1 *)fp) - framesize - SIZEOF_VOID_P);
                          *new_fpp = fp;
                          return (Inst *) (ex->handlerpc);
@@ -290,6 +302,10 @@ Inst *intrp_asm_handle_exception(Inst *ip, java_objectheader *o, Cell *fp, Cell
 
          /* unwind stack frame */
 
+#if defined(ENABLE_VMLOG)
+         vmlog_cacao_unwnd_method(m);
+#endif
+
          ip = (Inst *)access_local_cell(-framesize - SIZEOF_VOID_P);
          fp = (Cell *)access_local_cell(-framesize);
   }
index d9152d0e13944c04a8031b3a349c87e0b0e323b1..f2e0e5e658dd477d2e71a15128778ac375642c92 100644 (file)
@@ -6,6 +6,8 @@
 #include "config.h"
 
 #include "vm/jit/m68k/offsets.h"
+#include "md-abi.h"
+#include "vm/jit/methodheader.h"
 
 .data
 call_jit_dummy:
@@ -30,6 +32,7 @@ call_jit_dummy:
 .globl asm_criticalsections
 
 .globl asm_handle_exception
+.globl asm_handle_nat_exception
 
 /*
  *     This functions implement the C prototyped funtion
@@ -265,8 +268,9 @@ asm_abstractmethoderror:
 *   exception object pointer...%a2   exception raising address...%a3           *
 *                                                                              *
 *******************************************************************************/
-asm_handle_exception:
 asm_handle_nat_exception:
+       lea     %sp@(4), %sp
+asm_handle_exception:
 L_asm_handle_exception_stack_loop:
        
        /* we need the dseg, figure it out */
@@ -288,9 +292,54 @@ L_asm_handle_exception_stack_loop:
 
        /* %d0 contains address of exception handler */
        moveal  %d0, %a0
-       jsr     %a0@
+       jmp     %a0@
 
 L_asm_handle_exception_not_catched:
-       jsr 0
+       /* we did not find an exception handler in this stackframe */
+       /* remove this frame and search in the one above */
+       /* %a2 containts exception object ptr, %d2 the actual pv */
+       moveal  %d2, %a3
+       movel   %a3@(FrameSize), %d2
+
+       moveal  %sp, %a0
+       addal   %d2, %a0        /* %a0 now points to top of stackframe, where saved regs are */
+
+       /* the saved registers have to be restored */
+       /* XXX ugly hack: intsave and adrsave share one field */
+       movel   %a3@(IntSave), %d0
+       andil   #0x0000ffff, %d0        /* this is IntSave */
+       cmpb    #0,%d0
+       beq     L_asm_handle_ex_int_done
+       movel   (%a0)+, %d7
+
+       cmpb    #1,%d0
+       beq     L_asm_handle_ex_int_done
+       movel   (%a0)+, %d6
+
+       cmpb    #2,%d0 
+       beq     L_asm_handle_ex_int_done
+       movel   (%a0)+, %d5
+
+L_asm_handle_ex_int_done:
+
+       movel   %a3@(IntSave), %d0
+       andil   #0xffff0000, %d0        /* this is AdrSave */
+       tstl    %d0
+       beq     L_handle_exception_nat_catched_no_adr
+       moveal  (%a0)+, %a5
+L_handle_exception_nat_catched_no_adr:
+
+#if !defined(ENABLE_SOFTFLOAT)
+       FIXME
+#else
+       /* nothing to do */
+#endif
+       addal   %d2, %sp                /* remove old stackframe */
+       moveal  %sp@(0), %a3            /* make return address, new exception rasing address */
+       addal   #4,%sp                  /* remove return address fromstack */
+       subal   #2, %a3                 /* it was a jsr %aX, which is 4 bytes long */
+       jmp     L_asm_handle_exception_stack_loop
+
+
 illegal
 .long 0x23234242
index 65f6c5c68860f46075a2303d15e267013afd70dd..1c3f1114d8ad3e18ae20c376b36a0db5baffe241 100644 (file)
@@ -125,9 +125,11 @@ bool codegen_emit(jitdata *jd)
                        (void) dseg_add_unique_s4(cd, (rd->memuse + 1) * 4);/* IsSync         */
                else
 #endif
-                       (void) dseg_add_unique_s4(cd, 0);                  /* IsSync          */
+               (void) dseg_add_unique_s4(cd, 0);                      /* IsSync          */
                (void) dseg_add_unique_s4(cd, jd->isleafmethod);       /* IsLeaf          */
-               (void) dseg_add_unique_s4(cd, INT_SAV_CNT - rd->savintreguse); /* IntSave */
+
+               /* XXX we use the IntSAce a split field for the adr now */
+               (void) dseg_add_unique_s4(cd, (ADR_SAV_CNT - rd->savadrreguse) << 16 | (INT_SAV_CNT - rd->savintreguse)); /* IntSave */
                (void) dseg_add_unique_s4(cd, FLT_SAV_CNT - rd->savfltreguse); /* FltSave */
 
                dseg_addlinenumbertablesize(cd);
@@ -1046,43 +1048,61 @@ bool codegen_emit(jitdata *jd)
                        emit_store_dst(jd, iptr, d);
                        break;
 
-#if 0
                case ICMD_LALOAD:     /* ..., arrayref, index  ==> ..., value         */
-                       s1 = emit_load_s1(jd, iptr, REG_ITMP1);
+                       s1 = emit_load_s1(jd, iptr, REG_ATMP1);
                        s2 = emit_load_s2(jd, iptr, REG_ITMP2);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP12_PACKED);
                        /* implicit null-pointer check */
                        emit_arrayindexoutofbounds_check(cd, iptr, s1, s2);
-                       M_SLL_IMM(s2, 3, REG_ITMP2);
-                       M_IADD(s1, REG_ITMP2, REG_ITMP2);
-                       M_LLD_INTERN(d, REG_ITMP2, OFFSET(java_longarray, data[0]));
+                       M_INTMOVE(s2, REG_ITMP2);
+                       M_ISSL_IMM(3, REG_ITMP2);
+                       M_IADD(s1, REG_ITMP2);
+                       M_LLD(d, REG_ITMP2, OFFSET(java_longarray, data[0]));
                        emit_store_dst(jd, iptr, d);
                        break;
 
                case ICMD_FALOAD:     /* ..., arrayref, index  ==> ..., value         */
-                       s1 = emit_load_s1(jd, iptr, REG_ITMP1);
+                       s1 = emit_load_s1(jd, iptr, REG_ATMP1);
                        s2 = emit_load_s2(jd, iptr, REG_ITMP2);
                        d = codegen_reg_of_dst(jd, iptr, REG_FTMP1);
                        emit_arrayindexoutofbounds_check(cd, iptr, s1, s2);
-                       M_SLL_IMM(s2, 2, REG_ITMP2);
-                       M_IADD_IMM(REG_ITMP2, OFFSET(java_floatarray, data[0]), REG_ITMP2);
+                       M_INTMOVE(s2, REG_ITMP2);
+                       M_ISSL_IMM(2, REG_ITMP2);
+                       M_IADD_IMM(OFFSET(java_floatarray, data[0]), REG_ITMP2);
+                       M_ADRMOVE(s1, REG_ATMP1);
+                       M_AADDINT(REG_ITMP2, REG_ATMP1);
                        /* implicit null-pointer check */
-                       M_LFSX(d, s1, REG_ITMP2);
+#if !defined(ENABLE_SOFTFLOAT)
+                       M_LFSX(REG_ATMP1, d);
+#else
+                       M_LWZX(REG_ATMP1, d);
+#endif
                        emit_store_dst(jd, iptr, d);
                        break;
 
                case ICMD_DALOAD:     /* ..., arrayref, index  ==> ..., value         */
-                       s1 = emit_load_s1(jd, iptr, REG_ITMP1);
+                       s1 = emit_load_s1(jd, iptr, REG_ATMP1);
                        s2 = emit_load_s2(jd, iptr, REG_ITMP2);
-                       d = codegen_reg_of_dst(jd, iptr, REG_FTMP1);
                        emit_arrayindexoutofbounds_check(cd, iptr, s1, s2);
-                       M_SLL_IMM(s2, 3, REG_ITMP2);
-                       M_IADD_IMM(REG_ITMP2, OFFSET(java_doublearray, data[0]), REG_ITMP2);
+                       M_INTMOVE(s2, REG_ITMP2);
+                       M_ISSL_IMM(3, REG_ITMP2);
+                       M_IADD_IMM(OFFSET(java_doublearray, data[0]), REG_ITMP2);
+                       M_ADRMOVE(s1, REG_ATMP1);
+                       M_AADDINT(REG_ITMP2, REG_ATMP1);
                        /* implicit null-pointer check */
-                       M_LFDX(d, s1, REG_ITMP2);
+#if !defined(ENABLE_SOFTFLOAT)
+                       d = codegen_reg_of_dst(jd, iptr, REG_ITMP12_PACKED);    /* FIXME */
+                       M_LFDX(REG_ATMP1, s3);
+#else
+                       d = codegen_reg_of_dst(jd, iptr, REG_ITMP12_PACKED);
+                       /* implicit null-pointer check */
+                       M_LWZX(REG_ATMP1, GET_LOW_REG(d));
+                       M_AADD_IMM(REG_ATMP1, 4);
+                       /* implicit null-pointer check */
+                       M_LWZX(REG_ATMP1, GET_HIGH_REG(d));
+#endif
                        emit_store_dst(jd, iptr, d);
                        break;
-               #endif
 
                case ICMD_AALOAD:     /* ..., arrayref, index  ==> ..., value         */
 
@@ -1104,7 +1124,7 @@ bool codegen_emit(jitdata *jd)
 
                case ICMD_BASTORE:    /* ..., arrayref, index, value  ==> ...         */
 
-                       s1 = emit_load_s1(jd, iptr, REG_ITMP1);
+                       s1 = emit_load_s1(jd, iptr, REG_ATMP1);
                        s2 = emit_load_s2(jd, iptr, REG_ITMP2);
                        emit_arrayindexoutofbounds_check(cd, iptr, s1, s2);
                        s3 = emit_load_s3(jd, iptr, REG_ITMP3);
@@ -1162,22 +1182,23 @@ bool codegen_emit(jitdata *jd)
                        M_STWX(REG_ATMP1, s3);
                        break;
 
-#if 0
                case ICMD_LASTORE:    /* ..., arrayref, index, value  ==> ...         */
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        s2 = emit_load_s2(jd, iptr, REG_ITMP2);
                        emit_arrayindexoutofbounds_check(cd, iptr, s1, s2);
                        s3 = emit_load_s3_high(jd, iptr, REG_ITMP3);
+
                        M_INTMOVE(s2, REG_ITMP2);
-                       M_IADD_IMM(OFFSET(java_bytearray, data[0]), REG_ITMP2);
-                       M_ISSL_IMM(1, REG_ITMP2);
+                       M_ISSL_IMM(3, REG_ITMP2);
+                       M_IADD_IMM(OFFSET(java_longarray, data[0]), REG_ITMP2);
                        M_ADRMOVE(s1, REG_ATMP1);
                        M_AADDINT(REG_ITMP2, REG_ATMP1);
                        /* implicit null-pointer check */
-                       M_STWX(s3, s1, REG_ITMP2);
-                       M_IADD_IMM(REG_ITMP2, 4, REG_ITMP2);
+                       M_STWX(REG_ATMP1, s3);
+                       M_AADD_IMM(REG_ATMP1, 4);
                        s3 = emit_load_s3_low(jd, iptr, REG_ITMP3);
-                       M_STWX(s3, s1, REG_ITMP2);
+                       /* implicit null-pointer check */
+                       M_STWX(REG_ATMP1, s3);
                        break;
 
                case ICMD_FASTORE:    /* ..., arrayref, index, value  ==> ...         */
@@ -1185,24 +1206,43 @@ bool codegen_emit(jitdata *jd)
                        s2 = emit_load_s2(jd, iptr, REG_ITMP2);
                        emit_arrayindexoutofbounds_check(cd, iptr, s1, s2);
                        s3 = emit_load_s3(jd, iptr, REG_FTMP3);
-                       M_SLL_IMM(s2, 2, REG_ITMP2);
-                       M_IADD_IMM(REG_ITMP2, OFFSET(java_floatarray, data[0]), REG_ITMP2);
+                       M_INTMOVE(s2, REG_ITMP2);
+                       M_ISSL_IMM(2, REG_ITMP2);
+                       M_IADD_IMM(OFFSET(java_floatarray, data[0]), REG_ITMP2);
+                       M_ADRMOVE(s1, REG_ATMP1);
+                       M_AADDINT(REG_ITMP2, REG_ATMP1);
                        /* implicit null-pointer check */
-                       M_STFSX(s3, s1, REG_ITMP2);
+#if !defined(ENABLE_SOFTFLOAT)
+                       M_STFSX(REG_ATMP1, s3);
+#else
+                       M_STWX(REG_ATMP1, s3);
+#endif
                        break;
 
                case ICMD_DASTORE:    /* ..., arrayref, index, value  ==> ...         */
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        s2 = emit_load_s2(jd, iptr, REG_ITMP2);
                        emit_arrayindexoutofbounds_check(cd, iptr, s1, s2);
+                       M_INTMOVE(s2, REG_ITMP2);
+                       M_ISSL_IMM(3, REG_ITMP2);
+                       M_IADD_IMM(OFFSET(java_doublearray, data[0]), REG_ITMP2);
+                       M_ADRMOVE(s1, REG_ATMP1);
+                       M_AADDINT(REG_ITMP2, REG_ATMP1);
+                       /* implicit null-pointer check */
+#if !defined(ENABLE_SOFTFLOAT)
                        s3 = emit_load_s3(jd, iptr, REG_FTMP3);
-                       M_SLL_IMM(s2, 3, REG_ITMP2);
-                       M_IADD_IMM(REG_ITMP2, OFFSET(java_doublearray, data[0]), REG_ITMP2);
+                       M_STFDX(REG_ATMP1, s3);
+#else
+                       s3 = emit_load_s3_high(jd, iptr, REG_ITMP3);
+                       /* implicit null-pointer check */
+                       M_STWX(REG_ATMP1, s3);
+                       M_AADD_IMM(REG_ATMP1, 4);
+                       s3 = emit_load_s3_low(jd, iptr, REG_ITMP3);
                        /* implicit null-pointer check */
-                       M_STFDX(s3, s1, REG_ITMP2);
+                       M_STWX(REG_ATMP1, s3);
+#endif
                        break;
 
-       #endif
                case ICMD_AASTORE:    /* ..., arrayref, index, value  ==> ...         */
 
                        s1 = emit_load_s1(jd, iptr, REG_ATMP1);
@@ -1216,7 +1256,7 @@ bool codegen_emit(jitdata *jd)
                        M_AST(s1, REG_SP, 0*4);
                        M_AST(s3, REG_SP, 1*4);
                        M_JSR_IMM(BUILTIN_canstore);    
-                       emit_exception_check_ireg(cd, iptr);
+                       emit_exception_check(cd, iptr);
 
                        s1 = emit_load_s1(jd, iptr, REG_ATMP1);
                        s2 = emit_load_s2(jd, iptr, REG_ITMP1);
@@ -1303,7 +1343,7 @@ bool codegen_emit(jitdata *jd)
                                        M_JSR_IMM(disp);
 
                                        REPLACEMENT_POINT_INVOKE_RETURN(cd, iptr);
-                                       /*emit_exception_check(cd, iptr); TODO */
+                                       emit_exception_check(cd, iptr);
                                        break;
 
                                case ICMD_INVOKESPECIAL: 
@@ -1647,8 +1687,8 @@ nowperformreturn:
                                codegen_threadcritstop(cd, cd->mcodeptr - cd->mcodebase);
 #endif
                                M_ISUB(REG_ITMP3, REG_ITMP1);
-                               M_ICMP(REG_ITMP1, REG_ITMP2);
-                               M_BGT(4);
+                               M_ICMP(REG_ITMP2, REG_ITMP1);
+                               M_BHI(4);
                                M_IMOV_IMM(1, d);
                                M_TPFW;                 /* overlaps next instruction */
                                M_ICLR(d);
@@ -1763,28 +1803,14 @@ nowperformreturn:
                                        codegen_threadcritstart(cd, cd->mcodeptr - cd->mcodebase);
 #endif
                                        M_ILD(REG_ITMP3, REG_ATMP2, OFFSET(vftbl_t, baseval));  /* REG_ITMP3 == sub->vftbl->baseval */
-#if 0
-                                       if (s1 != REG_ATMP1) {
-#endif
-                                               M_ILD(REG_ITMP1, REG_ATMP3, OFFSET(vftbl_t, baseval));
-                                               M_ILD(REG_ITMP2, REG_ATMP3, OFFSET(vftbl_t, diffval));
+                                       M_ILD(REG_ITMP1, REG_ATMP3, OFFSET(vftbl_t, baseval));
+                                       M_ILD(REG_ITMP2, REG_ATMP3, OFFSET(vftbl_t, diffval));
 #if defined(ENABLE_THREADS)
                                                codegen_threadcritstop(cd, cd->mcodeptr - cd->mcodebase);
 #endif
-                                               M_ISUB(REG_ITMP1, REG_ITMP3);
-                                               M_ICMP(REG_ITMP2, REG_ITMP1);   /* XXX was CMPU */
-#if 0                                  
-                                       } else {
-                                               assert(0);
-                                               M_ILD(REG_ITMP2, REG_ATMP3, OFFSET(vftbl_t, baseval));
-                                               M_ISUB(REG_ITMP3, REG_ITMP2);
-                                               M_ILD(REG_ITMP3, REG_ATMP3, OFFSET(vftbl_t, diffval));
-                                               M_ICMP(REG_ITMP2, REG_ITMP3);   /* XXX was CMPU */
-#if defined(ENABLE_THREADS)
-                                               codegen_threadcritstop(cd, cd->mcodeptr - cd->mcodebase);
-#endif
-                                       }
-#endif
+                                       M_ISUB(REG_ITMP1, REG_ITMP3);
+                                       M_ICMP(REG_ITMP2, REG_ITMP3);   /* XXX was CMPU */
+
                                        emit_classcast_check(cd, iptr, BRANCH_UGT, REG_ITMP3, s1); /* XXX was BRANCH_GT */
 
                                        if (super != NULL)
@@ -1809,8 +1835,8 @@ nowperformreturn:
                                        M_AMOV_IMM(iptr->sx.s23.s3.c.cls, REG_ATMP1);
                                }
        
-                               M_APUSH(s1);
                                M_APUSH(REG_ATMP1);
+                               M_APUSH(s1);
                                M_JSR_IMM(BUILTIN_arraycheckcast);
                                M_AADD_IMM(2*4, REG_SP);                /* pop arguments off stack */
                                M_ITST(REG_RESULT);
@@ -1889,6 +1915,51 @@ nowperformreturn:
                        break;
                        }
 
+               case ICMD_MULTIANEWARRAY:/* ..., cnt1, [cnt2, ...] ==> ..., arrayref  */
+
+                       /* check for negative sizes and copy sizes to stack if necessary  */
+                       MCODECHECK((iptr->s1.argcount << 1) + 64);
+
+                       for (s1 = iptr->s1.argcount; --s1 >= 0;) {
+                               var = VAR(iptr->sx.s23.s2.args[s1]);
+
+                               /* Already Preallocated? */
+                               if (!(var->flags & PREALLOC)) {
+                                       s2 = emit_load(jd, iptr, var, REG_ITMP1);
+                                       M_IST(s2, REG_SP, (s1 + 3) * 4);
+                               }
+                       }
+
+                       /* a0 = dimension count */
+                       M_IMOV_IMM(iptr->s1.argcount, REG_ITMP1);
+                       M_IST(REG_ITMP1, REG_SP, 0*4);
+
+                       /* a1 = arraydescriptor */
+                       if (INSTRUCTION_IS_UNRESOLVED(iptr)) {
+                               codegen_addpatchref(cd, PATCHER_resolve_classref_to_classinfo, iptr->sx.s23.s3.c.ref, 0);
+                               M_AMOV_IMM(0, REG_ATMP1);
+                       } else  {
+                               M_AMOV_IMM(iptr->sx.s23.s3.c.cls, REG_ATMP1);
+                       }
+                       M_AST(REG_ATMP1, REG_SP, 1*4);
+
+                       /* a2 = pointer to dimensions = stack pointer */
+                       M_AMOV(REG_SP, REG_ATMP1);
+                       M_AADD_IMM(REG_ATMP1, 3*4);
+                       M_AST(REG_ATMP1, REG_SP, 2*4);
+
+                       M_JSR_IMM(BUILTIN_multianewarray);
+
+                       /* check for exception before result assignment */
+                       emit_exception_check(cd, iptr);
+
+                       assert(VAROP(iptr->dst)->type == TYPE_ADR);
+                       d = codegen_reg_of_dst(jd, iptr, REG_RESULT);
+                       M_INT2ADRMOVE(REG_RESULT, d);
+                       emit_store_dst(jd, iptr, d);
+                       break;
+
+
 
                default:
                        printf("UNKNOWN OPCODE %d\n", iptr->opc);
@@ -1930,8 +2001,8 @@ void codegen_emit_stub_compiler(jitdata *jd)
 
        M_AMOV_IMM(m, REG_ATMP1);
        M_AMOV_IMM(asm_call_jit_compiler, REG_ATMP3);
-       M_JMP_IMM(asm_call_jit_compiler);
-       M_RET;
+       M_JMP(REG_ATMP3);
+       M_JMP_IMM(0);   /* FIXME: remove me */
 }
 
 
@@ -2105,7 +2176,7 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f)
        M_AST(REG_ATMP3, REG_SP, 0 * 4);                        /* datasp */
        M_JSR_IMM(codegen_finish_native_call);
        
-       M_INT2ADRMOVE(REG_RESULT, REG_ATMP3);
+       M_INT2ADRMOVE(REG_RESULT, REG_ATMP1);
        /* restore return value */
        switch (md->returntype.type)    {
                case TYPE_VOID: break;
@@ -2134,13 +2205,18 @@ void codegen_emit_stub_native(jitdata *jd, methoddesc *nmd, functionptr f)
 
        M_AADD_IMM(cd->stackframesize*4, REG_SP);
        /* check for exception */
-       M_ATST(REG_ATMP3);
+       M_ATST(REG_ATMP1);
        M_BNE(2);
        M_RET;
 
-       /* handle exception */
-       M_JSR_IMM(0);   /* FIXME */
+       /* handle exception, REG_ATMP1 already contains exception object, REG_ATMP2 holds address */
+       
+       M_ALD(REG_ATMP2_XPC, REG_SP, 0);                /* take return address as faulting instruction */
+       M_AADD_IMM(-2, REG_ATMP2_XPC);                  /* which is off by 2 */
+       M_JMP_IMM(asm_handle_nat_exception);
 
+       /* should never be reached from within jit code*/
+       M_JSR_IMM(0);
 
        /* generate patcher stub call code */
        emit_patcher_stubs(jd);
index 90d42e0169e74dd46f4e4e519a6999236872f075..7103b75fb0d296945fbaefcf842f04bc31189b80 100644 (file)
 #define M_BHI_16(a)                    BRANCH16(0x2, (a))
 #define M_BHI_32(a)                    BRANCH32(0x2, (a))
 
+#define M_BLS(a)                       BRANCH8 (0x3, (a))
+
 #define        M_BMI(a)                        BRANCH8(0xb, (a))
 #define M_BPL(a)                       BRANCH8(0xa, (a))
 
 #define M_STWX(a,c)                    OPWORD( ( (2<<6) | ((a) << 3) | 2), 0, (c))
 #define M_STAX(a,c)                    OPWORD( ( (2<<6) | ((a) << 3) | 2), 1, (c))     /* movea.l */
 
+#if !defined(ENABLE_SOFTFLOAT)
+       #define M_LFSX(a,c)             M_ILLEGAL
+       #define M_LFDX(a,c)             M_ILLEGAL
+       #define M_STFSX(a,c)            M_ILLEGAL
+       #define M_STFDX(a,c)            M_ILLEGAL
+#endif
+
 #define M_BSEXT(a,b)                   OPWORD( ( (7<<6) | ((b) << 3) | 4), 0, (a))     /* mvs.b */
 #define M_CZEXT(a,b)                   OPWORD( ( (7<<6) | ((b) << 3) | 7), 0, (a))     /* mvz.w */
 #define M_SSEXT(a,b)                   OPWORD( ( (7<<6) | ((b) << 3) | 5), 0, (a))     /* mvs.w */
index b36a26b2ad9d9b7cb4f4ca0612839b735aab3334..822526bdbbe11f68cf42d79e649aa66c39771190 100644 (file)
@@ -40,6 +40,7 @@
 #include "mm/memory.h"
 
 #include "codegen.h"
+#include "md-os.h"
 
 /*
  *     Loads an immededat operand into data register
@@ -336,7 +337,11 @@ s4 emit_load_low(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
        s4            disp;
        s4            reg;
 
+#if !defined(ENABLE_SOFTFLOAT)
        assert(src->type == TYPE_LNG);
+#else
+       assert(src->type == TYPE_LNG || src->type == TYPE_DBL);
+#endif
 
        /* get required compiler data */
        cd = jd->cd;
@@ -358,8 +363,11 @@ s4 emit_load_high(jitdata *jd, instruction *iptr, varinfo *src, s4 tempreg)
        s4            disp;
        s4            reg;
 
+#if !defined(ENABLE_SOFTFLOAT)
        assert(src->type == TYPE_LNG);
-
+#else
+       assert(src->type == TYPE_LNG || src->type == TYPE_DBL);
+#endif
        /* get required compiler data */
        cd = jd->cd;
 
@@ -621,7 +629,7 @@ void emit_classcast_check(codegendata *cd, instruction *iptr, s4 condition, s4 r
                        M_BLE(4);
                        break;
                case BRANCH_UGT:
-                       M_BHI(4);
+                       M_BLS(4);
                        break;
                default:
                        vm_abort("emit_classcast_check: unknown condition %d", condition);
@@ -640,10 +648,10 @@ void emit_arrayindexoutofbounds_check(codegendata *cd, instruction *iptr, s4 s1,
 {
        if (INSTRUCTION_MUST_CHECK(iptr)) {
                M_ILD(REG_ITMP3, s1, OFFSET(java_arrayheader, size));
-               M_ICMP(REG_ITMP3, s2);
-               M_BLT(2);
+               M_ICMP(s2, REG_ITMP3);
+               M_BHI(2);
                /*M_ALD_INTERN(s2, REG_ZERO, EXCEPTION_LOAD_DISP_ARRAYINDEXOUTOFBOUNDS);*/
-               M_ILLEGAL; /*FIXME */
+               M_TRAP(EXCEPTION_HARDWARE_ARRAYINDEXOUTOFBOUNDS);
        }
 }
 
@@ -656,11 +664,9 @@ void emit_nullpointer_check(codegendata *cd, instruction *iptr, s4 reg)
 {
        if (INSTRUCTION_MUST_CHECK(iptr)) {
                /* did like to assert on TYPE_ADR, but not possible in here */
-               /* so assert before each emit_nullpointer_check */
                M_ATST(reg);
                M_BNE(2);
-               /*M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_LOAD_DISP_NULLPOINTER);*/
-               M_ILLEGAL;
+               M_TRAP(M68K_EXCEPTION_HARDWARE_NULLPOINTER);
        }
 }
 
@@ -680,6 +686,7 @@ void emit_arithmetic_check(codegendata *cd, instruction *iptr, s4 reg)
        }
 }
 
+#if 0
 /* emit_exception_check_areg **************************************************
  *
    Emit an Exception check, tested register is address REG_RESULT
@@ -694,18 +701,20 @@ void emit_exception_check_areg(codegendata *cd, instruction *iptr)
                M_ILLEGAL; /*FIXME*/
        }
 }
+#endif
+
 /* emit_exception_check_ireg **************************************************
 
    Emit an Exception check. Teste register is integer REG_RESULT
 
 *******************************************************************************/
-void emit_exception_check_ireg(codegendata *cd, instruction *iptr)
+void emit_exception_check(codegendata *cd, instruction *iptr)
 {
        if (INSTRUCTION_MUST_CHECK(iptr)) {
                M_ITST(REG_RESULT);
                M_BNE(2);
                /*M_ALD_INTERN(REG_ZERO, REG_ZERO, EXCEPTION_HARDWARE_EXCEPTION);*/
-               M_ILLEGAL; /*FIXME*/
+               M_TRAP(EXCEPTION_HARDWARE_EXCEPTION);
        }
 }
 
index b315acf0022437ecc24e1e3295911e53dfd68800..37735f57dfb574688920acdbb02094d5fff16df9 100644 (file)
@@ -45,7 +45,7 @@ s4 nregdescint[] = { REG_TMP, REG_TMP, REG_RES, REG_RES, REG_RES, REG_SAV, REG_S
 const char *abi_registers_integer_name [] = { "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7" };
 
 const s4 abi_registers_integer_argument[]      ;
-const s4 abi_registers_integer_saved[]                 = {2,3,4,5,6,7};
+const s4 abi_registers_integer_saved[]                 = {5,6,7};
 const s4 abi_registers_integer_temporary[]     = {0,1};
 
 /* Address register description */
@@ -65,7 +65,7 @@ s4 nregdescfloat[] = { REG_RES, REG_RES, REG_RES, REG_RES, REG_RES, REG_RES, REG
 const char *abi_registers_float_name [] = { "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7" };
 
 const s4 abi_registers_float_argument[]        ;
-const s4 abi_registers_float_saved[]           = {2,3,4,5,6,7};
+const s4 abi_registers_float_saved[]           = {5,6,7};
 const s4 abi_registers_float_temporary[]       = {0,1};
 
 
index f334bb1b65f13a409d793448365a58d6d8ed5726..2f5267ee23ed5c863b569e77d4f7949a767de2b7 100644 (file)
@@ -56,6 +56,8 @@ typedef struct actual_mcontext {
        actual_fpregset_t fpregs;
 } actual_mcontext_t;
 
+#define GREGS_ADRREG_OFF       8
+
 typedef struct actual_ucontext {
        unsigned long     uc_flags;
        struct actual_ucontext  *uc_link;
@@ -83,20 +85,73 @@ void md_init_linux()
 
 /* md_signal_handler_sigsegv ******************************************
  *
- * BLA BLA
- */
-void md_signal_handler_sigsegv(/*int sig, siginfo_t *siginfo, void *_p*/) 
+ * Invoked when a Nullpointerexception occured, or when the cm 
+ * crashes, hard to tell the difference. 
+ **********************************************************************/
+void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, actual_ucontext_t *_uc) 
 {      
-       assert(0); 
+       uint32_t        xpc, sp;
+       uint16_t        opc;
+       uint32_t        val, regval, off;
+       bool            adrreg;
+       java_objectheader *e;
+       mcontext_t      *_mc;
+
+       _mc = &_uc->uc_mcontext;
+       sp = _mc->gregs[R_SP];
+       xpc = _mc->gregs[R_PC];
+       opc = *(uint16_t*)xpc;
+
+       /* m68k uses a whole bunch of difficult to differ load instructions where null pointer check could occure */
+       /* the first two are 2*32bit sized */
+       adrreg = false;
+       off = 0;
+       if ((opc & ((2<<12) | (5<<3))) == ((2<<12) | (5<<3)))   {
+               if (opc & (1<<6)) adrreg = true;                /* M_XLD */
+               val = opc & 0x0007;
+               off = *(uint16_t*)(xpc+1);
+       } else if ((opc & ((2<<12) | (5<<6))) == ((2<<12) | (5<<6)))    {
+               if (opc & (1<<3)) adrreg = true;                /* M_XST */
+               val = (opc >> 9) & 0x0007;
+               off = *(uint16_t*)(xpc+1);
+       } else {
+               fprintf(stderr, "SEGV: short instructions %x\n", opc);
+               /* now check the 32 bit sized instructions */
+               if ((opc & (2<<3)) == (2<<3))   {
+                       if (opc & (1<<6)) adrreg = true;                /* M_L*X */
+                       val = opc & 0x0007;
+               } else if ((opc & (2<<6)) == (2<<6))    {
+                       if (opc & (1<<3)) adrreg = true;                /* M_S*X */
+                       val = (opc >> 9) & 0x0007;
+               } else {
+                       vm_abort("md_signal_handler_sigsegv: unhandeled faulting opcode %x", opc);
+               }
+       }
+
+       /* val is now register number, adreg == true if it is an address regsiter */
+       regval = _mc->gregs[adrreg ? GREGS_ADRREG_OFF + val : val];
+       /*
+       if (regval != 0)        {
+               vm_abort("md_signal_handler_sigsegv: faulting address is not NULL: addr=%p", regval);
+       }*/
+
+
+       fprintf(stderr, "SEGV: sp=%x, xpc=%x, regval=%x\n", sp, xpc, regval);
+       e = exceptions_new_hardware_exception(0, sp, xpc, xpc, EXCEPTION_HARDWARE_NULLPOINTER, regval);
+
+       _mc->gregs[GREGS_ADRREG_OFF + REG_ATMP1]     = (ptrint) e;
+       _mc->gregs[GREGS_ADRREG_OFF + REG_ATMP2_XPC] = (ptrint) xpc;
+       _mc->gregs[R_PC]          = (ptrint) asm_handle_exception;
 }
 
-/*
+/* md_signal_handler_sigill *******************************************
+ *
  * This handler is used to generate hardware exceptions.
  * Type of exception derived from trap number.
  * If an object is needed a tst instruction (2 byte long) has
  * been created directly before the trap instruction (2 bytes long).
  * the last 3 bit of this tst instruction contain the register number.
- */
+ **********************************************************************/
 void md_signal_handler_sigill(int sig, siginfo_t *siginfo, actual_ucontext_t *_uc) 
 {
        uint32_t        xpc, sp;
@@ -106,40 +161,49 @@ void md_signal_handler_sigill(int sig, siginfo_t *siginfo, actual_ucontext_t *_u
        java_objectheader *e;
        mcontext_t      *_mc;
 
+       xpc = siginfo->si_addr;
+
+       if (siginfo->si_code == ILL_ILLOPC)     {
+               vm_abort("md_signal_handler_sigill: the illegal instruction @ 0x%x, aborting", xpc);
+       }
        if (siginfo->si_code != ILL_ILLTRP)     {
                vm_abort("md_signal_handler_sigill: Caught something not a trap");
        }
 
-       xpc = siginfo->si_addr;
        opc = *(uint16_t*)(xpc-2);
 
-       if (opc == 0x4afc)      {
-               vm_abort("md_signal_handler_sigill: the illegal instruction @ 0x%x, aborting", xpc);
-       }
-
        assert( (opc&0xfff0) == 0x4e40 );
        type = opc & 0x000f;            /* filter trap number */
 
        _mc = &_uc->uc_mcontext;
        sp = _mc->gregs[R_SP];
 
-       /* Figure out in which register the object causing the exception resides for exceptions
-        * appropiate.
+       /* Figure out in which register the object causing the exception resides for appropiate exceptions
         */
        switch (type)   {
+               case EXCEPTION_HARDWARE_EXCEPTION:
+                       /* nothing */
+                       break;
                case EXCEPTION_HARDWARE_CLASSCAST: 
                        regval = *(uint16_t*)(xpc-4);
                        assert( (regval&0xfff0) == 0x4a00 );
                        /* was in a address register */
-                       regval = _mc->gregs[ 8 + (regval & 0x7) ];
+                       regval = _mc->gregs[ GREGS_ADRREG_OFF + (regval & 0x7) ];
                        break;
+               case EXCEPTION_HARDWARE_ARRAYINDEXOUTOFBOUNDS:
+                       regval = 0; /* FIXME */
+                       break;
+               case M68K_EXCEPTION_HARDWARE_NULLPOINTER:
+                       type = EXCEPTION_HARDWARE_NULLPOINTER;
+                       break;
+
                default: assert(0);
        }
 
-       fprintf(stderr, "NEW HWE: sp=%x, xpc=%x, tpye=%x, regval=%x\n", sp, xpc, type, regval);
+       /*fprintf(stderr, "NEW HWE: sp=%x, xpc=%x, tpye=%x, regval=%x\n", sp, xpc, type, regval);*/
        e = exceptions_new_hardware_exception(0, sp, xpc, xpc, type, regval);
 
-       _mc->gregs[REG_ATMP1]     = (ptrint) e;
-       _mc->gregs[REG_ATMP2_XPC] = (ptrint) xpc;
+       _mc->gregs[GREGS_ADRREG_OFF + REG_ATMP1]     = (ptrint) e;
+       _mc->gregs[GREGS_ADRREG_OFF + REG_ATMP2_XPC] = (ptrint) xpc;
        _mc->gregs[R_PC]          = (ptrint) asm_handle_exception;
 }
index dfba624724e5d6bcced01194ea10937d5f884c53..847d09ef5dee50c271deb4f2cc64580d8375140d 100644 (file)
@@ -28,6 +28,8 @@
 
 #include "config.h"
 
+/* XXX trap #0 is reserved and will not be delivered to signal handler */
+#define M68K_EXCEPTION_HARDWARE_NULLPOINTER 14
 
 void md_signal_handler_sigill();
 void md_init_linux();
index 6a50fa9add1a07d878e593cbcc66b13a817297be..898d8710a60473422dea1e450fd6e96c7fc5013f 100644 (file)
@@ -206,7 +206,7 @@ bool profile_start_thread(void)
 #if !defined(NDEBUG)
 void profile_printstats(void)
 {
-       list                   *l;
+       list_t                 *l;
        list_method_entry      *lme;
        list_method_entry      *tlme;
        classinfo              *c;
index 5ae5669546c97d6168c1a4b16de14b2fe1461e3a..fe596c1d84d9a02b872917766af1501927fa24a8 100644 (file)
@@ -61,7 +61,7 @@
 
 static threadobject      *thread_recompile;
 static java_objectheader *lock_thread_recompile;
-static list              *list_recompile_methods;
+static list_t            *list_recompile_methods;
 
 
 /* recompile_init **************************************************************
index 73cec302bde0b84f21db10c48b1c7eb30a2add60..cb1e4fedba495c062282c9d68099a762ece26234 100644 (file)
@@ -1,6 +1,6 @@
-/* src/vm/jit/recompile.h - recompilation system
+/* src/vm/jit/optimizing/recompile.h - recompilation system
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
    J. Wenninger, J. Wenninger, Institut f. Computersprachen - TU Wien
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Contact: cacao@cacaojvm.org
-
-   Authors: Christian Thalinger
-
-   Changes:
-
    $Id: cacao.c 4357 2006-01-22 23:33:38Z twisti $
 
 */
@@ -48,7 +42,7 @@ typedef struct list_method_entry list_method_entry;
 
 struct list_method_entry {
        methodinfo *m;
-       listnode    linkage;
+       listnode_t  linkage;
 };
 
 
index 812042c810b69605615c820dd39e70e774717db6..8ba7d3418c5b1ab52100b1a98ce0a1a986797450 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/jit/powerpc/darwin/md-abi.c - functions for PowerPC Darwin ABI
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
    J. Wenninger, Institut f. Computersprachen - TU Wien
@@ -28,7 +28,7 @@
 
    Changes: Christian Ullrich
 
-   $Id: md-abi.c 5634 2006-10-02 14:18:04Z edwin $
+   $Id: md-abi.c 7770 2007-04-19 19:39:06Z twisti $
 
 */
 
 
 #include "vm/jit/powerpc/darwin/md-abi.h"
 
-#include "vm/descriptor.h"
 #include "vm/global.h"
+
 #include "vm/jit/abi.h"
 
+#include "vmcore/descriptor.h"
+
 
 /* register descripton arrays *************************************************/
 
@@ -61,13 +63,48 @@ s4 nregdescint[] = {
        REG_END
 };
 
-char *regs[] = {
+const char *abi_registers_integer_name[] = {
        "r0",  "r1",  "r2",  "r3",  "r4",  "r5",  "r6",  "r7",
        "r8",  "r9",  "r10", "r11", "r12", "r13", "r14", "r15",
        "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23",
        "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31",
 };
 
+const s4 abi_registers_integer_argument[] = {
+       3,  /* a0 */
+       4,  /* a1 */
+       5,  /* a2 */
+       6,  /* a3 */
+       7,  /* a4 */
+       8,  /* a5 */
+       9,  /* a6 */
+       10, /* a7 */
+};
+
+const s4 abi_registers_integer_saved[] = {
+       14, /* s0 */
+       15, /* s1 */
+       24, /* s2 */
+       25, /* s3 */
+       26, /* s4 */
+       27, /* s5 */
+       28, /* s6 */
+       29, /* s7 */
+       30, /* s8 */
+       31, /* s9 */
+};
+
+const s4 abi_registers_integer_temporary[] = {
+       2,  /* t0 */
+       17, /* t1 */
+       18, /* t2 */
+       19, /* t3 */
+       20, /* t4 */
+       21, /* t5 */
+       22, /* t6 */
+       23, /* t7 */
+};
+
 
 s4 nregdescfloat[] = {
        /*ftmp3,  fa0/v0,     fa1,     fa2,     fa3,     fa4,     fa5,     fa6,   */
@@ -85,6 +122,45 @@ s4 nregdescfloat[] = {
        REG_END
 };
 
+const s4 abi_registers_float_argument[] = {
+       1,  /* fa0  */
+       2,  /* fa1  */
+       3,  /* fa2  */
+       4,  /* fa3  */
+       5,  /* fa4  */
+       6,  /* fa5  */
+       7,  /* fa6  */
+       8,  /* fa7  */
+       9,  /* fa8  */
+       10, /* fa9  */
+       11, /* fa10 */
+       12, /* fa11 */
+       13, /* fa12 */
+};
+
+const s4 abi_registers_float_saved[] = {
+       14, /* fs0  */
+       15, /* fs1  */
+       24, /* fs2  */
+       25, /* fs3  */
+       26, /* fs4  */
+       27, /* fs5  */
+       28, /* fs6  */
+       29, /* fs7  */
+       30, /* fs8  */
+       31, /* fs9  */
+};
+
+const s4 abi_registers_float_temporary[] = {
+       17, /* ft5  */
+       18, /* ft6  */
+       19, /* ft7  */
+       20, /* ft8  */
+       21, /* ft9  */
+       22, /* ft10 */
+       23, /* ft11 */
+};
+
 
 /* md_param_alloc **************************************************************
 
@@ -113,8 +189,8 @@ void md_param_alloc(methoddesc *md)
 
        /* set default values */
 
-       iarg = 0;
-       farg = 0;
+       iarg      = 0;
+       farg      = 0;
        stacksize = LA_SIZE_IN_POINTERS;
 
        /* get params field of methoddesc */
@@ -127,12 +203,12 @@ void md_param_alloc(methoddesc *md)
                case TYPE_ADR:
                        if (iarg < INT_ARG_CNT) {
                                pd->inmemory = false;
-                               pd->regoff = iarg;           /* rd->arg[int|flt]regs index !! */
+                               pd->regoff   = abi_registers_integer_argument[iarg];
                                iarg++;
                        }
                        else {
                                pd->inmemory = true;
-                               pd->regoff = stacksize;
+                               pd->regoff   = stacksize;
                        }
                        stacksize++;
                        break;
@@ -140,14 +216,15 @@ void md_param_alloc(methoddesc *md)
                case TYPE_LNG:
                        if (iarg < INT_ARG_CNT - 1) {
                                pd->inmemory = false;
-                                                            /* rd->arg[int|flt]regs index !! */
-                               pd->regoff = PACK_REGS(iarg + 1, iarg); 
+                               pd->regoff   =
+                                       PACK_REGS(abi_registers_integer_argument[iarg + 1],
+                                                         abi_registers_integer_argument[iarg]);
                                iarg += 2;
                        }
                        else {
                                pd->inmemory = true;
-                               pd->regoff = stacksize;
-                               iarg = INT_ARG_CNT;
+                               pd->regoff   = stacksize;
+                               iarg         = INT_ARG_CNT;
                        }
                        stacksize += 2;
                        break;
@@ -155,13 +232,13 @@ void md_param_alloc(methoddesc *md)
                case TYPE_FLT:
                        if (farg < FLT_ARG_CNT) {
                                pd->inmemory = false;
-                               pd->regoff = farg;           /* rd->arg[int|flt]regs index !! */
+                               pd->regoff   = abi_registers_float_argument[farg];
                                iarg++;                   /* skip 1 integer argument register */
                                farg++;
                        }
                        else {
                                pd->inmemory = true;
-                               pd->regoff = stacksize;
+                               pd->regoff   = stacksize;
                        }
                        stacksize++;
                        break;
@@ -169,13 +246,13 @@ void md_param_alloc(methoddesc *md)
                case TYPE_DBL:
                        if (farg < FLT_ARG_CNT) {
                                pd->inmemory = false;
-                               pd->regoff = farg;           /* rd->arg[int|flt]regs index !! */
+                               pd->regoff   = abi_registers_float_argument[farg];
                                iarg += 2;               /* skip 2 integer argument registers */
                                farg++;
                        }
                        else {
                                pd->inmemory = true;
-                               pd->regoff = stacksize;
+                               pd->regoff   = stacksize;
                        }
                        stacksize += 2;
                        break;
@@ -204,6 +281,21 @@ void md_param_alloc(methoddesc *md)
 }
 
 
+/* md_param_alloc_native *******************************************************
+
+   Pre-allocate arguments according the native ABI.
+
+*******************************************************************************/
+
+void md_param_alloc_native(methoddesc *md)
+{
+       /* On PowerPC we use the same ABI for JIT method calls as for
+          native method calls. */
+
+       md_param_alloc(md);
+}
+
+
 /* md_return_alloc *************************************************************
 
    Precolor the Java Stackelement containing the Return Value, if
index 1fb3af25339fd31eeb2a4616af15112e41d62497..23a4b0d2229702895bb9a2117fbf665e438271ef 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/jit/powerpc/darwin/md-abi.h - defines for PowerPC Darwin ABI
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
    J. Wenninger, Institut f. Computersprachen - TU Wien
@@ -28,7 +28,7 @@
 
    Changes: Christian Ullrich
 
-   $Id: md-abi.h 5382 2006-09-06 21:17:00Z twisti $
+   $Id: md-abi.h 7770 2007-04-19 19:39:06Z twisti $
 
 */
 
@@ -70,6 +70,9 @@
 
 #define REG_IFTMP        0   /* temporary integer and floating point register */
 
+#define REG_FA0          1   /* define some argument registers                */
+#define REG_FA1          2
+
 
 #define INT_REG_CNT     32   /* number of integer registers                   */
 #define INT_SAV_CNT     10   /* number of int callee saved registers          */
 
 /* packed register defines ****************************************************/
 
+#define REG_RESULT_PACKED    PACK_REGS(REG_RESULT2, REG_RESULT)
+
+#define REG_A0_A1_PACKED     PACK_REGS(REG_A1, REG_A0)
+#define REG_A2_A3_PACKED     PACK_REGS(REG_A3, REG_A2)
+
 #define REG_ITMP12_PACKED    PACK_REGS(REG_ITMP2, REG_ITMP1)
 #define REG_ITMP23_PACKED    PACK_REGS(REG_ITMP3, REG_ITMP2)
-#define REG_RESULT_PACKED    PACK_REGS(REG_RESULT2, REG_RESULT)
 
 
 /* ABI defines ****************************************************************/
index d3200f7855e5cc9537f46be98fdc20b7793142a0..eefc9930fad46cea978a39bfe2614c2261b0e8d1 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/jit/powerpc/darwin/md-os.c - machine dependent PowerPC Darwin functions
 
-   Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+   Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
    J. Wenninger, Institut f. Computersprachen - TU Wien
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: md-os.c 7601 2007-03-28 23:02:50Z michi $
+   $Id: md-os.c 7770 2007-04-19 19:39:06Z twisti $
 
 */
 
 #include "vm/jit/powerpc/codegen.h"
 #include "vm/jit/powerpc/darwin/md-abi.h"
 
+#if defined(ENABLE_THREADS)
+# include "threads/native/threads.h"
+#endif
+
 #include "vm/exceptions.h"
 #include "vm/global.h"
 #include "vm/signallocal.h"
 #include "vm/stringlocal.h"
+
 #include "vm/jit/asmpart.h"
 #include "vm/jit/stacktrace.h"
 
@@ -62,6 +67,7 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
        ucontext_t         *_uc;
        mcontext_t          _mc;
        ppc_thread_state_t *_ss;
+       ptrint             *gregs;
        u1                 *pv;
        u1                 *sp;
        u1                 *ra;
@@ -70,15 +76,19 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
        s4                  s1;
        s4                  disp;
        s4                  d;
-       ptrint             *gregs;
-       ptrint              addr;
-       ptrint              val;
-       java_objectheader  *e;
+       ptrint             addr;
+       ptrint             val;
+       s4                 type;
+       java_objectheader *o;
 
        _uc = (ucontext_t *) _p;
        _mc = _uc->uc_mcontext;
        _ss = &_mc->ss;
 
+       /* immitate a gregs array */
+
+       gregs = &_ss->r0;
+
        /* get register values */
 
        pv  = (u1 *) _ss->r13;
@@ -94,15 +104,93 @@ void md_signal_handler_sigsegv(int sig, siginfo_t *siginfo, void *_p)
        disp = M_INSTR_OP2_IMM_I(mcode);
        d    = M_INSTR_OP2_IMM_D(mcode);
 
+       val  = gregs[d];
+
+       /* check for special-load */
+
+       if (s1 == REG_ZERO) {
+               /* we use the exception type as load displacement */
+
+               type = disp;
+       }
+       else {
+               /* This is a normal NPE: addr must be NULL and the NPE-type
+                  define is 0. */
+
+               addr = gregs[s1];
+               type = EXCEPTION_HARDWARE_NULLPOINTER;
+
+               if (addr != 0)
+                       vm_abort("md_signal_handler_sigsegv: faulting address is not NULL: addr=%p", addr);
+       }
+
+       /* generate appropriate exception */
+
+       o = exceptions_new_hardware_exception(pv, sp, ra, xpc, type, val);
+
+       /* set registers */
+
+       _ss->r11  = (ptrint) o;
+       _ss->r12  = (ptrint) xpc;
+       _ss->srr0 = (ptrint) asm_handle_exception;
+}
+
+
+/* md_signal_handler_sigtrap ***************************************************
+
+   Signal handler for hardware-traps.
+
+*******************************************************************************/
+
+void md_signal_handler_sigtrap(int sig, siginfo_t *siginfo, void *_p)
+{
+       ucontext_t         *_uc;
+       mcontext_t          _mc;
+       ppc_thread_state_t *_ss;
+       ptrint             *gregs;
+       u1                 *pv;
+       u1                 *sp;
+       u1                 *ra;
+       u1                 *xpc;
+       u4                  mcode;
+       s4                  s1;
+       ptrint              val;
+       s4                  type;
+       java_objectheader  *o;
+
+       _uc = (ucontext_t *) _p;
+       _mc = _uc->uc_mcontext;
+       _ss = &_mc->ss;
+
+       /* immitate a gregs array */
+
        gregs = &_ss->r0;
-       addr  = gregs[s1];
-       val   = gregs[d];
 
-       e = exceptions_new_hardware_exception(pv, sp, ra, xpc, s1, disp, addr, val);
+       /* get register values */
+
+       pv  = (u1 *) _ss->r13;
+       sp  = (u1 *) _ss->r1;
+       ra  = (u1 *) _ss->lr;                    /* this is correct for leafs */
+       xpc = (u1 *) _ss->srr0;
+
+       /* get exception-throwing instruction */
+
+       mcode = *((u4 *) xpc);
+
+       s1 = M_OP3_GET_A(mcode);
+
+       /* for now we only handle ArrayIndexOutOfBoundsException */
+
+       type = EXCEPTION_HARDWARE_ARRAYINDEXOUTOFBOUNDS;
+       val  = gregs[s1];
+
+       /* generate appropriate exception */
+
+       o = exceptions_new_hardware_exception(pv, sp, ra, xpc, type, val);
 
        /* set registers */
 
-       _ss->r11  = (ptrint) e;
+       _ss->r11  = (ptrint) o;
        _ss->r12  = (ptrint) xpc;
        _ss->srr0 = (ptrint) asm_handle_exception;
 }
index 8ef94b157ab99d62a71afee8d63bdf9afb239c6e..bea522c330d7da62c31fc44026ba05c55395700c 100644 (file)
@@ -63,6 +63,9 @@
 #define REPLACE_PATCH_DYNAMIC_CALL
 /*#define REPLACE_PATCH_ALL*/
 
+#if defined(ENABLE_VMLOG)
+#include <vmlog_cacao.h>
+#endif
 
 /*** architecture-dependent configuration *************************************/
 
@@ -2331,6 +2334,10 @@ sourcestate_t *replace_recover_source_state(rplpoint *rp,
 
                replace_read_executionstate(rp, es, ss, ss->frames == NULL);
 
+#if defined(ENABLE_VMLOG)
+               vmlog_cacao_unrol_method(ss->frames->method);
+#endif
+
 #if defined(REPLACE_STATISTICS)
                REPLACE_COUNT(stat_frames);
                depth++;
@@ -2596,6 +2603,11 @@ void replace_build_execution_state_intern(sourcestate_t *ss,
 
                es->code = ss->frames->tocode;
                prevframe = ss->frames;
+
+#if defined(ENABLE_VMLOG)
+               vmlog_cacao_rerol_method(ss->frames->method);
+#endif
+
                replace_write_executionstate(rp, es, ss, ss->frames->down == NULL);
 
                DOLOG( replace_executionstate_println(es); );
index 7cc3c511c7ea596ffdac4080599613d7fbd4453b..15e2a1c45c645c3c92b432bd2156eb899a1c1cfa 100644 (file)
@@ -37,7 +37,7 @@
 
 #define U8_AVAILABLE                     1
 
-#define SUPPORT_DIVISION                 0
+#define SUPPORT_DIVISION                 1
 #define SUPPORT_LONG                     1
 
 #define SUPPORT_I2F                      1
 #define SUPPORT_L2F                      1
 #define SUPPORT_L2D                      1
 
-#define SUPPORT_F2I                      0
-#define SUPPORT_F2L                      0
-#define SUPPORT_D2I                      0
-#define SUPPORT_D2L                      0
+#define SUPPORT_F2I                      1
+#define SUPPORT_F2L                      1
+#define SUPPORT_D2I                      1
+#define SUPPORT_D2L                      1
 
 #define SUPPORT_LONG_ADD                 1
 #define SUPPORT_LONG_CMP                 1
@@ -56,7 +56,7 @@
 #define SUPPORT_LONG_LOGICAL             1
 #define SUPPORT_LONG_SHIFT               1
 #define SUPPORT_LONG_MUL                 1
-#define SUPPORT_LONG_DIV                 0
+#define SUPPORT_LONG_DIV                 1
 
 #define SUPPORT_CONST_LOGICAL            1  /* AND, OR, XOR with immediates   */
 #define SUPPORT_CONST_MUL                1  /* mutiply with immediate         */
index 2b2abed3faa28ddf832b1fcf60ca2041e0910381..3afa0d92dd72bee69c80824c63dd8a2895f86192 100644 (file)
@@ -58,6 +58,9 @@
        
        .global asm_criticalsections
        .global asm_getclassvalues_atomic
+       
+       .global asm_store_fp_state_reg
+       .global asm_load_fp_state_reg
 
 
 /* asm_vm_call_method ******************************************************
@@ -440,6 +443,37 @@ asm_criticalsections:
     .xword   _crit_restart
 #endif
     .xword   0
+    
+    
+/* asm_store_fp_state_reg **************************************************
+ *                                                                         *
+ * This function stores the 64-bit floating point state register to a      *
+ * memory location. (which needs to be 8-byte aligned)                     *
+ *                                                                         *
+ * C-prototype:                                                            *
+ *  void asm_store_fp_state_reg(u8 *mem);                                  *
+ *                                                                            *
+ **************************************************************************/
+asm_store_fp_state_reg:
+       stx %fsr,[%o0]
+       retl  /* return from leaf */
+       nop
+       
+/* asm_load_fp_state_reg ***************************************************
+ *                                                                         *
+ * This function loades the 64-bit floating point state register from a    *
+ * memory location. (which needs to be 8-byte aligned)                     *
+ *                                                                         *
+ * C-prototype:                                                            *
+ *  void asm_load_fp_state_reg(u8 *mem);                                   *
+ *                                                                            *
+ **************************************************************************/
+asm_load_fp_state_reg:
+       ldx [%o0],%fsr
+       retl  /* return from leaf */
+       nop
 
 
 /* disable exec-stacks ********************************************************/
index 31cba6edb0681137f9f5117932b9deb4986e0c7f..5504b550c0a6759d2586fc91bd041bdfe20f0995 100644 (file)
@@ -62,6 +62,9 @@
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
 
+
+#define BUILTIN_FLOAT_ARGS 1
+
 /* XXX use something like this for window control ? 
  * #define REG_PV (own_window?REG_PV_CALLEE:REG_PV_CALLER)
  */
@@ -260,17 +263,16 @@ bool codegen_emit(jitdata *jd)
                                /*s2 = rd->argintregs[s1];*/
                                /*s2 = REG_WINDOW_TRANSPOSE(s2);*/
                                
-                               /* need the argument index here, not the register number */
-                               s1 = md->params[p].regoff - abi_registers_integer_argument[0];
+                               /* need the argument index (p) here, not the register number */
                                
                                if (!(var->flags & INMEMORY)) {      /* reg arg -> register   */
                                        /*M_INTMOVE(s2, var->vv.regoff);*/                                      
-                                       M_LDX(var->vv.regoff, REG_SP, JITSTACK + (s1 * 8));
+                                       M_LDX(var->vv.regoff, REG_SP, JITSTACK + (p * 8));
 
                                } else {                             /* reg arg -> spilled    */
                                        /*M_STX(s2, REG_SP, (WINSAVE_CNT + var->vv.regoff) * 8);*/
                                        
-                                       M_LDX(REG_ITMP1, REG_SP, JITSTACK + (s1 * 8));
+                                       M_LDX(REG_ITMP1, REG_SP, JITSTACK + (p * 8));
                                        M_STX(REG_ITMP1, REG_SP, localbase + (var->vv.regoff * 8));
                                }
 
@@ -1114,7 +1116,7 @@ bool codegen_emit(jitdata *jd)
                case ICMD_I2F:
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_FTMP3);
-                       disp = dseg_add_float(cd, 0.0);
+                       disp = dseg_add_unique_float(cd, 0.0);
                        M_IST (s1, REG_PV_CALLEE, disp);
                        M_FLD (d, REG_PV_CALLEE, disp);
                        M_CVTIF (d, d); /* rd gets translated to double target register */
@@ -1124,7 +1126,7 @@ bool codegen_emit(jitdata *jd)
                case ICMD_I2D:
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_FTMP3);
-                       disp = dseg_add_float(cd, 0.0);
+                       disp = dseg_add_unique_float(cd, 0.0);
                        M_IST(s1, REG_PV_CALLEE, disp);
                        M_FLD(REG_FTMP2, REG_PV_CALLEE, disp); /* REG_FTMP2 needs to be a double temp */
                        M_CVTID (REG_FTMP2, d); /* rd gets translated to double target register */
@@ -1134,7 +1136,7 @@ bool codegen_emit(jitdata *jd)
                case ICMD_L2F:
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_FTMP3);
-                       disp = dseg_add_double(cd, 0.0);
+                       disp = dseg_add_unique_double(cd, 0.0);
                        M_STX(s1, REG_PV_CALLEE, disp);
                        M_DLD(REG_FTMP3, REG_PV_CALLEE, disp);
                        M_CVTLF(REG_FTMP3, d);
@@ -1144,7 +1146,7 @@ bool codegen_emit(jitdata *jd)
                case ICMD_L2D:
                        s1 = emit_load_s1(jd, iptr, REG_ITMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_FTMP3);
-                       disp = dseg_add_double(cd, 0.0);
+                       disp = dseg_add_unique_double(cd, 0.0);
                        M_STX(s1, REG_PV_CALLEE, disp);
                        M_DLD(d, REG_PV_CALLEE, disp);
                        M_CVTLD(d, d);
@@ -1154,7 +1156,13 @@ bool codegen_emit(jitdata *jd)
                case ICMD_F2I:       /* ..., value  ==> ..., (int) value              */
                        s1 = emit_load_s1(jd, iptr, REG_FTMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP3);
-                       disp = dseg_add_float(cd, 0.0);
+                       disp = dseg_add_unique_float(cd, 0.0);
+                       
+                       /* check for NaN, SPARC overflow is noncompliant (see V9 spec B.5)  */
+                       M_FCMP(s1, s1);
+                       M_FBU(5);
+                       M_MOV(REG_ZERO, d); /* delay slot */
+                       
                        M_CVTFI(s1, REG_FTMP2);
                        M_FST(REG_FTMP2, REG_PV_CALLEE, disp);
                        M_ILD(d, REG_PV, disp);
@@ -1165,7 +1173,13 @@ bool codegen_emit(jitdata *jd)
                case ICMD_D2I:       /* ..., value  ==> ..., (int) value             */
                        s1 = emit_load_s1(jd, iptr, REG_FTMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP3);
-                       disp = dseg_add_float(cd, 0.0);
+                       disp = dseg_add_unique_float(cd, 0.0);
+                       
+                       /* check for NaN, SPARC overflow is noncompliant (see V9 spec B.5)  */
+                       M_DCMP(s1, s1);
+                       M_FBU(5);
+                       M_MOV(REG_ZERO, d); /* delay slot */
+                       
                        M_CVTDI(s1, REG_FTMP2);
                        M_FST(REG_FTMP2, REG_PV, disp);
                        M_ILD(d, REG_PV, disp);
@@ -1175,7 +1189,13 @@ bool codegen_emit(jitdata *jd)
                case ICMD_F2L:       /* ..., value  ==> ..., (long) value             */
                        s1 = emit_load_s1(jd, iptr, REG_FTMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP3);
-                       disp = dseg_add_double(cd, 0.0);
+                       disp = dseg_add_unique_double(cd, 0.0);
+                       
+                       /* check for NaN, SPARC overflow is noncompliant (see V9 spec B.5)  */
+                       M_FCMP(s1, s1);
+                       M_FBU(5);
+                       M_MOV(REG_ZERO, d); /* delay slot */
+                       
                        M_CVTFL(s1, REG_FTMP2); /* FTMP2 needs to be double reg */
                        M_DST(REG_FTMP2, REG_PV, disp);
                        M_LDX(d, REG_PV, disp);
@@ -1185,7 +1205,13 @@ bool codegen_emit(jitdata *jd)
                case ICMD_D2L:       /* ..., value  ==> ..., (long) value             */
                        s1 = emit_load_s1(jd, iptr, REG_FTMP1);
                        d = codegen_reg_of_dst(jd, iptr, REG_ITMP3);
-                       disp = dseg_add_double(cd, 0.0);
+                       disp = dseg_add_unique_double(cd, 0.0);
+                       
+                       /* check for NaN, SPARC overflow is noncompliant (see V9 spec B.5)  */
+                       M_DCMP(s1, s1);
+                       M_FBU(5);
+                       M_MOV(REG_ZERO, d); /* delay slot */
+                       
                        M_CVTDL(s1, REG_FTMP2); /* FTMP2 needs to be double reg */
                        M_DST(REG_FTMP2, REG_PV, disp);
                        M_LDX(d, REG_PV, disp);
@@ -2309,6 +2335,8 @@ nowperformreturn:
 
                        MCODECHECK((s3 << 1) + 64);
 
+#ifdef BUILTIN_FLOAT_ARGS /* float args for builtins disabled */
+
                        /* copy float arguments according to ABI convention */
 
                        int num_fltregargs = 0;
@@ -2341,6 +2369,10 @@ nowperformreturn:
                                /*printf("builtin float arg to target reg: %d ==> %d\n", s1+16, s1);*/
                        }
                        
+#else
+                       assert(md->argfltreguse == 0);
+#endif
+                       
                        goto gen_method;
 
                case ICMD_INVOKESTATIC: /* ..., [arg1, [arg2 ...]] ==> ...            */
@@ -2385,8 +2417,10 @@ gen_method:
                                        }
                                }
                                else {
+#ifdef BUILTIN_FLOAT_ARGS
                                        if (iptr->opc == ICMD_BUILTIN)
                                                continue;
+#endif
                                                
                                        if (!md->params[s3].inmemory) {
                                                s1 = emit_load(jd, iptr, var, d);
index 03bb05c12e2473a65aa5fcc791d63d776a71086a..9233b2f81418b0de7d10ef6e040a2b7bd8ff602d 100644 (file)
@@ -548,6 +548,14 @@ s4   get_lopart_disp(s4 disp);
 #define M_BUGT(disp)            M_BRACC(0x00,0x1,0xc,disp,0,1,0)      /* br uns a>b  */
 #define M_BULT(disp)            M_BRACC(0x00,0x1,0x5,disp,0,1,0)      /* br uns a<b  */
 
+/* branch on (fcc0) floating point condition codes */
+
+#define M_FBR(disp)             M_BRACC(0x00,0x5,0x8,disp,0,1,0)      /* branch      */
+#define M_FBU(disp)             M_BRACC(0x00,0x5,0x7,disp,0,1,0)      /* unordered   */
+#define M_FBG(disp)             M_BRACC(0x00,0x5,0x6,disp,0,1,0)      /* branch a>b  */
+#define M_FBL(disp)             M_BRACC(0x00,0x5,0x4,disp,0,1,0)      /* branch a<b  */
+#define M_FBO(disp)             M_BRACC(0x00,0x5,0xf,disp,0,1,0)      /* br ordered  */
+
 
 
 #define M_SAVE(rs1,rs2,rd)      M_OP3(0x02,0x3c,rd,rs1,rs2,IMM)
index a65eb8651916fa8a9d97095736820668d7d4f5bb..30f30c12aa15de91b6a62ea2c3bc22e567b674fe 100644 (file)
@@ -743,7 +743,7 @@ void emit_verbosecall_enter(jitdata *jd)
        for (i = 0; i < md->paramcount && i < INT_NATARG_CNT; i++) {
                t = md->paramtypes[i].type;
 
-               /* using all available argument registers, this adds complexity */
+               /* all available argument registers used, which adds a little complexity */
                
                if (IS_INT_LNG_TYPE(t)) {
                        if (i < INT_ARG_CNT) {
@@ -756,20 +756,36 @@ void emit_verbosecall_enter(jitdata *jd)
                        }
                }
                else {
-                       assert(i < 5); /* XXX 5 float reg args right now! */
-                       if (IS_2_WORD_TYPE(t)) {
-                               M_DST(abi_registers_float_argument[i], REG_SP, JITSTACK);
-                               M_LDX(abi_registers_integer_argument[i], REG_SP, JITSTACK);
+                       if (i < FLT_ARG_CNT) {
+                               
+                               /* reg -> mem -> reg */
+                               
+                               if (IS_2_WORD_TYPE(t)) {
+                                       M_DST(abi_registers_float_argument[i], REG_SP, JITSTACK);
+                                       M_LDX(abi_registers_integer_argument[i], REG_SP, JITSTACK);
+                               }
+                               else {
+                                       M_FST(abi_registers_float_argument[i], REG_SP, JITSTACK);
+                                       M_ILD(abi_registers_integer_argument[i], REG_SP, JITSTACK);
+                               }
                        }
                        else {
-                               M_FST(abi_registers_float_argument[i], REG_SP, JITSTACK);
-                               M_ILD(abi_registers_integer_argument[i], REG_SP, JITSTACK);
+                               
+                               /* mem -> reg */
+                               
+                               assert(i == 5);
+                               if (IS_2_WORD_TYPE(t)) {
+                                       M_LDX(REG_OUT5, REG_FP, JITSTACK);
+                               }
+                               else {
+                                       M_ILD(REG_OUT5, REG_FP, JITSTACK);
+                               }
                        }
                }
        }
        
        
-       /* method info pointer is passed in argument register 5 */
+       /* method info pointer is passed via stack */
        disp = dseg_add_address(cd, m);
        M_ALD(REG_ITMP1, REG_PV_CALLEE, disp);
        M_AST(REG_ITMP1, REG_SP, CSTACK);
index 2720a22e3610508e3edfdd345fa8ee46239c996a..efb6f9f21c70df82920ae8df2d423b8ec4238e5a 100644 (file)
 #include "vm/jit/asmpart.h"
 #include "vm/jit/stacktrace.h"
 
+/* assembler function prototypes **********************************************/
+void asm_store_fp_state_reg(u8 *mem);
+void asm_load_fp_state_reg(u8 *mem);
+
+
 
 /* shift away 13-bit immediate,  mask rd and rs1    */
 #define SHIFT_AND_MASK(instr) \
index be19c29f391255bb6ffa61819f7ae7bc62c5b228..1d34fc3372292360dd88747518f28911f1006996 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: stacktrace.c 7667 2007-04-05 00:16:05Z michi $
+   $Id: stacktrace.c 7792 2007-04-22 20:02:05Z tbfg $
 
 */
 
@@ -192,7 +192,7 @@ void stacktrace_create_extern_stackframeinfo(stackframeinfo *sfi, u1 *pv,
 
        if (!opt_intrp) {
 # endif
-# if defined(__I386__) || defined(__X86_64__) || defined(__S390__)
+# if defined(__I386__) || defined(__X86_64__) || defined(__S390__) || defined(__M68K__)
                /* On i386 and x86_64 we always have to get the return address
                   from the stack. */
                /* On S390 we use REG_RA as REG_ITMP3, so we have always to get
@@ -534,7 +534,7 @@ stacktracebuffer *stacktrace_create(stackframeinfo *sfi)
                                        /* Set stack pointer to stackframe of parent Java
                                           function of the current Java function. */
 
-#if defined(__I386__) || defined (__X86_64__)
+#if defined(__I386__) || defined (__X86_64__) || defined (__M68K__)
                                        sp += framesize + SIZEOF_VOID_P;
 #elif defined(__SPARC_64__)
                                        sp = md_get_framepointer(sp);
index 25301d77c3ec1e43b9582c095f534cdb31a38f87..32b064f66fccd765b31943e2a50fb3c601f26b43 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: properties.c 7257 2007-01-29 23:07:40Z twisti $
+   $Id: properties.c 7783 2007-04-20 13:28:27Z twisti $
 
 */
 
 typedef struct list_properties_entry list_properties_entry;
 
 struct list_properties_entry {
-       char     *key;
-       char     *value;
-       listnode linkage;
+       char       *key;
+       char       *value;
+       listnode_t  linkage;
 };
 
 
 /* global variables ***********************************************************/
 
-static list *list_properties = NULL;
+static list_t *list_properties = NULL;
 
 
 /* properties_init *************************************************************
index 096bb0c93a09b8605a67c6e397026f237c5e4ecf..7d5c99ad06a95e747747fdd1c9daafeead52b867 100644 (file)
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: signal.c 7601 2007-03-28 23:02:50Z michi $
+   $Id: signal.c 7797 2007-04-23 20:12:39Z michi $
 
 */
 
 
 #include "config.h"
 
+#include <assert.h>
 #include <errno.h>
 #include <signal.h>
 #include <stdlib.h>
 # include "threads/threads-common.h"
 #endif
 
+#include "vm/exceptions.h"
 #include "vm/signallocal.h"
 #include "vm/vm.h"
 
 #include "vmcore/options.h"
 
+#if defined(ENABLE_STATISTICS)
+# include "vmcore/statistics.h"
+#endif
+
 
 /* global variables ***********************************************************/
 
@@ -89,6 +95,10 @@ void signal_init(void)
 
        (void) memory_mmap_anon(NULL, pagesize, PROT_NONE, MAP_PRIVATE | MAP_FIXED);
 
+       /* check if we get into trouble with our hardware-exceptions */
+
+       assert(OFFSET(java_bytearray, data) > EXCEPTION_HARDWARE_PATCHER);
+
        /* Block the following signals (SIGINT for <ctrl>-c, SIGQUIT for
           <ctrl>-\).  We enable them later in signal_thread, but only for
           this thread. */
@@ -211,14 +221,24 @@ static void signal_thread(void)
        if (sigemptyset(&mask) != 0)
                vm_abort("signal_thread: sigemptyset failed: %s", strerror(errno));
 
-       sigaddset(&mask, SIGINT);
+       if (sigaddset(&mask, SIGINT) != 0)
+               vm_abort("signal_thread: sigaddset failed: %s", strerror(errno));
+
 #if !defined(__FREEBSD__)
-       sigaddset(&mask, SIGQUIT);
+       if (sigaddset(&mask, SIGQUIT) != 0)
+               vm_abort("signal_thread: sigaddset failed: %s", strerror(errno));
 #endif
 
        while (true) {
                /* just wait for a signal */
 
+               /* XXX We don't check for an error here, although the man-page
+                  states sigwait does not return an error (which is wrong!),
+                  but it seems to make problems with Boehm-GC.  We should
+                  revisit this code with our new exact-GC. */
+
+/*             if (sigwait(&mask, &sig) != 0) */
+/*                     vm_abort("signal_thread: sigwait failed: %s", strerror(errno)); */
                (void) sigwait(&mask, &sig);
 
                switch (sig) {
index 5d1cc1e49031606ff24df2ae3298a25e508baf82..1375634ef8e5227f0035e77bdc892d2485d44f23 100644 (file)
@@ -45,8 +45,8 @@
 
 #include "native/jni.h"
 #include "native/native.h"
+#include "native/include/java_lang_String.h" /* required by java_lang_Class.h */
 #include "native/include/java_lang_Class.h"
-#include "native/include/java_lang_String.h"
 
 #if defined(ENABLE_THREADS)
 # include "threads/native/threads.h"
 # include "native/jvmti/cacaodbg.h"
 #endif
 
+#if defined(ENABLE_VMLOG)
+#include <vmlog_cacao.h>
+#endif
+
 
 /* Invocation API variables ***************************************************/
 
@@ -610,6 +614,7 @@ static void version(bool opt_exit)
        printf("  maximum heap size              : %d\n", opt_heapmaxsize);
        printf("  initial heap size              : %d\n", opt_heapstartsize);
        printf("  stack size                     : %d\n", opt_stacksize);
+       printf("  libjvm.so                      : %s\n", cacao_libjvm);
        printf("  java.boot.class.path           : %s\n", _Jv_bootclasspath);
        printf("  gnu.classpath.boot.library.path: %s\n", classpath_libdir);
        printf("  java.class.path                : %s\n", _Jv_classpath);
@@ -739,6 +744,10 @@ bool vm_create(JavaVMInitArgs *vm_args)
        jdwp = agentbypath = false;
 #endif
 
+#if defined(ENABLE_VMLOG)
+       vmlog_cacao_init(vm_args);
+#endif
+
        /* check the JNI version requested */
 
        switch (vm_args->version) {
@@ -1113,6 +1122,10 @@ bool vm_create(JavaVMInitArgs *vm_args)
                                opt_stat = true;
 # endif
                        }
+                       else {
+                               printf("Unknown -verbose option: %s\n", opt_arg);
+                               usage();
+                       }
 #endif
                        break;
                case OPT_DEBUGCOLOR:
index c9631cdccc8c27dee94449260de500fae678e6ab..b734ce17e812d5edd310b7fd039663061bae31ac 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: class.c 7615 2007-03-29 23:10:59Z michi $
+   $Id: class.c 7797 2007-04-23 20:12:39Z michi $
 
 */
 
@@ -66,7 +66,7 @@
 
 /* global variables ***********************************************************/
 
-list unlinkedclasses;                   /* this is only used for eager class  */
+list_t unlinkedclasses;                 /* this is only used for eager class  */
                                         /* loading                            */
 
 
index 68bf1d8e74e4a8a15e400e30a2250f4a73a14088..bf9130f5ad5b38cd9c7e8c6c07a8fe690028cd39 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: class.h 7601 2007-03-28 23:02:50Z michi $
+   $Id: class.h 7797 2007-04-23 20:12:39Z michi $
 
 */
 
@@ -114,7 +114,7 @@ struct classinfo {                /* class structure                          */
        s4          methodscount;     /* number of methods                        */
        methodinfo *methods;          /* method table                             */
 
-       listnode    listnode;         /* linkage                                  */
+       listnode_t  listnode;         /* linkage                                  */
 
        s4          state;            /* current class state                      */
        s4          index;            /* hierarchy depth (classes) or index       */
@@ -177,7 +177,7 @@ struct castinfo {
 
 /* global variables ***********************************************************/
 
-extern list unlinkedclasses;   /* this is only used for eager class loading   */
+extern list_t unlinkedclasses; /* this is only used for eager class loading   */
 
 
 /* frequently used classes ****************************************************/
index 21987f0d6a3571267842e28b853a74920c20e98b..2fb8fee625313e8ba96f456542ff52adbb789ed9 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: suck.c 7272 2007-02-01 15:35:09Z twisti $
+   $Id: suck.c 7783 2007-04-20 13:28:27Z twisti $
 
 */
 
@@ -62,7 +62,7 @@
 
 /* global variables ***********************************************************/
 
-list *list_classpath_entries;
+list_t *list_classpath_entries;
 
 
 /* suck_init *******************************************************************
index 8d24a09552ad7e95213738571279520a4a6aecf0..1913e5f7ff37fade61829a824a8ef65c7f1a9821 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: suck.h 7246 2007-01-29 18:49:05Z twisti $
+   $Id: suck.h 7783 2007-04-20 13:28:27Z twisti $
 
 */
 
@@ -61,7 +61,7 @@ struct list_classpath_entry {
 #if defined(ENABLE_ZLIB)
        hashtable         *htclasses;
 #endif
-       listnode           linkage;
+       listnode_t         linkage;
 };
 
 
@@ -160,7 +160,7 @@ struct list_classpath_entry {
 
 /* export variables ***********************************************************/
 
-extern list *list_classpath_entries;
+extern list_t *list_classpath_entries;
 
 
 /* function prototypes ********************************************************/
index be1af9b322384739a9b47700a2615554f21068fe..09360815e8109995b1120f3e2023e634b6caa7ab 100644 (file)
@@ -73,7 +73,7 @@ JAVAFLAGS = -Xbootclasspath:$(CLASSPATH_CLASSES)
 endif
 
 check: $(HARNESS_CLASS_FILES)
-       @for t in $(TEST_NAMES) ; do echo "TEST $$t" ; { $(JAVAC) -d . $(srcdir)/$$t.java && LD_LIBRARY_PATH=$(top_builddir)/src/cacao/.libs $(JAVA) $$t ; } || exit 1 ; done
+       @for t in $(TEST_NAMES) ; do echo "TEST $$t" ; { $(JAVAC) -d . -classpath . $(srcdir)/$$t.java && LD_LIBRARY_PATH=$(top_builddir)/src/cacao/.libs $(JAVA) $(JAVAFLAGS) $$t ; } || exit 1 ; done
 
 $(HARNESS_CLASS_FILES): $(HARNESS_SOURCE_FILES)
        $(JAVAC) -d . $(HARNESS_SOURCE_FILES)