From 7d8c359a29e6cd2db255619a11bb131f6d490557 Mon Sep 17 00:00:00 2001 From: twisti Date: Tue, 30 Nov 2004 13:06:55 +0000 Subject: [PATCH] New source tree. --- Makefile.am | 257 +----------------------------- autogen.sh | 8 +- configure.in | 85 +++++----- src/boehm-gc/acinclude.m4 | 1 - src/boehm-gc/autogen.sh | 1 + src/boehm-gc/configure.in | 3 +- src/cacao/cacao.c | 34 ++-- src/cacao/cacao.h | 16 +- src/cacaoh/cacaoh.c | 26 +-- src/cacaoh/headers.c | 20 +-- src/cacaoh/headers.h | 5 +- src/mm/Makefile.am | 12 +- src/mm/boehm.c | 31 ++-- src/mm/boehm.h | 12 +- src/mm/memory.c | 20 ++- src/native/jni.c | 62 ++++--- src/native/jni.h | 7 +- src/native/natcalls.h | 6 +- src/native/native.c | 45 +++--- src/native/native.h | 12 +- src/native/tools/gennativetable.c | 70 ++++---- src/native/vm/Constructor.c | 27 ++-- src/native/vm/Field.c | 22 +-- src/native/vm/Makefile.am | 162 ++----------------- src/native/vm/Method.c | 18 +-- src/native/vm/Proxy.c | 10 +- src/native/vm/VMClass.c | 39 ++--- src/native/vm/VMClassLoader.c | 22 +-- src/native/vm/VMObject.c | 37 +++-- src/native/vm/VMRuntime.c | 40 ++--- src/native/vm/VMSecurityManager.c | 14 +- src/native/vm/VMString.c | 11 +- src/native/vm/VMSystem.c | 15 +- src/native/vm/VMThread.c | 37 +++-- src/native/vm/VMThrowable.c | 25 ++- src/threads/green/Makefile.am | 17 +- src/threads/native/threads.c | 42 ++--- src/threads/native/threads.h | 52 +++++- src/toolbox/Makefile.am | 15 +- src/toolbox/avl.c | 2 + src/toolbox/chain.c | 5 +- src/toolbox/list.c | 3 +- src/toolbox/logging.c | 8 +- src/toolbox/logging.h | 4 +- src/toolbox/tree.c | 5 +- src/vm/builtin.c | 39 +++-- src/vm/builtin.h | 15 +- src/vm/exceptions.c | 23 +-- src/vm/exceptions.h | 8 +- src/vm/global.h | 62 +++---- src/vm/jit/Makefile.am | 39 ++--- src/vm/jit/asmpart.h | 18 ++- src/vm/jit/codegen.inc | 37 +++-- src/vm/jit/codegen.inc.h | 8 +- src/vm/jit/inline/inline.c | 22 +-- src/vm/jit/inline/inline.h | 39 +++-- src/vm/jit/inline/parseRT.c | 25 +-- src/vm/jit/inline/parseRT.h | 5 +- src/vm/jit/inline/parseRTstats.c | 19 ++- src/vm/jit/inline/sets.c | 15 +- src/vm/jit/inline/sets.h | 7 +- src/vm/jit/jit.c | 61 +++---- src/vm/jit/jit.h | 13 +- src/vm/jit/loop/Makefile.am | 20 +-- src/vm/jit/loop/analyze.c | 17 +- src/vm/jit/loop/analyze.h | 8 +- src/vm/jit/loop/graph.c | 13 +- src/vm/jit/loop/loop.c | 22 +-- src/vm/jit/loop/loop.h | 8 +- src/vm/jit/loop/tracing.c | 13 +- src/vm/jit/loop/tracing.h | 9 +- src/vm/jit/lsra.inc | 22 +-- src/vm/jit/parse.c | 33 ++-- src/vm/jit/parse.h | 8 +- src/vm/jit/reg.h | 7 +- src/vm/jit/reg.inc | 8 +- src/vm/jit/stack.c | 27 ++-- src/vm/jit/stack.h | 10 +- src/vm/jit/tools/genoffsets.c | 18 ++- src/vm/jit/verify/typecheck.c | 28 ++-- src/vm/jit/verify/typecheck.h | 8 +- src/vm/jit/verify/typeinfo.c | 16 +- src/vm/jit/verify/typeinfo.h | 4 +- src/vm/jit/x86_64/Makefile.am | 9 +- src/vm/jit/x86_64/asmpart.S | 8 +- src/vm/jit/x86_64/codegen.c | 41 ++--- src/vm/jit/x86_64/codegen.h | 6 +- src/vm/jit/x86_64/emitfuncs.c | 13 +- src/vm/jit/x86_64/emitfuncs.h | 4 +- src/vm/jit/x86_64/types.h | 4 +- src/vm/loader.c | 47 +++--- src/vm/options.h | 8 +- src/vm/tables.c | 27 ++-- 93 files changed, 1018 insertions(+), 1268 deletions(-) diff --git a/Makefile.am b/Makefile.am index b59781d95..1eda8cac2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,264 +1,15 @@ ## Process this file with automake to produce Makefile.in -# $Id: Makefile.am 1572 2004-11-23 16:05:40Z twisti $ - -@SET_MAKE@ +# $Id: Makefile.am 1621 2004-11-30 13:06:55Z twisti $ MAINTAINERCLEANFILES = Makefile.in configure -ALLSUBDIRS = mm toolbox threads jit nat tst doc jvmtst classpath -SUBDIRS = $(ALLSUBDIRS) -DIST_SUBDIRS = $(ALLSUBDIRS) + +SUBDIRS = doc src tests EXTRA_DIST = \ html/cacaoinstall.html \ html/cacaoman.html \ - html/index.html \ - main.h \ - natcalls.h \ - nativecalls.h - -CLEANFILES = \ - nativetable.inc - -bin_PROGRAMS = cacao cacaoh -noinst_PROGRAMS = gennativetable genoffsets - -INCLUDES = -I$(top_srcdir)/jit/@ARCH_DIR@ - -BOEHM_LIBS = mm/libboehm.a mm/boehm-gc/.libs/libgc.a - -if USE_ZLIB -ZLIB_OBJ = unzip.c -endif - -cacao_SOURCES = \ - builtin.c \ - exceptions.c \ - jni.c \ - loader.c \ - main.c \ - native.c \ - options.c \ - statistics.c \ - tables.c \ - typeinfo.c \ - $(ZLIB_OBJ) - -cacao_LDADD = \ - jit/libjit.a \ - jit/loop/libloop.a \ - jit/@ARCH_DIR@/libarch.a \ - nat/libnat.a \ - $(BOEHM_LIBS) \ - @THREAD_OBJ@ \ - toolbox/libtoolbox.a \ - @STATIC_CLASSPATH_LIBS@ \ - @DYNAMIC_CLASSPATH_LIBS@ \ - @AWT_OBJS@ - - -cacao_DEPENDENCIES = \ - jit/libjit.a \ - jit/loop/libloop.a \ - jit/@ARCH_DIR@/libarch.a \ - nat/libnat.a \ - $(BOEHM_LIBS) \ - @THREAD_OBJ@ \ - toolbox/libtoolbox.a \ - @STATIC_CLASSPATH_LIBS@ \ - nativetable.inc \ - @AWT_OBJS@ - -cacaoh_SOURCES = \ - builtin.c \ - cacaoh.c \ - exceptions.c \ - headers.c \ - loader.c \ - options.c \ - statistics.c \ - tables.c \ - $(ZLIB_OBJ) - -cacaoh_LDADD = \ - $(BOEHM_LIBS) \ - classpath/native/jni/java-lang/.libs/libjavalang.a \ - @THREAD_OBJ@ \ - toolbox/libtoolbox.a - -cacaoh_DEPENDENCIES = \ - $(BOEHM_LIBS) \ - classpath/native/jni/java-lang/.libs/libjavalang.a \ - @THREAD_OBJ@ \ - toolbox/libtoolbox.a - -gennativetable_SOURCES = \ - builtin.c \ - exceptions.c \ - gennativetable.c \ - headers.c \ - loader.c \ - options.c \ - tables.c \ - statistics.c \ - $(ZLIB_OBJ) - -gennativetable_LDADD = \ - $(BOEHM_LIBS) \ - classpath/native/jni/java-lang/.libs/libjavalang.a \ - @THREAD_OBJ@ \ - toolbox/libtoolbox.a - -gennativetable_DEPENDENCIES = \ - $(BOEHM_LIBS) \ - classpath/native/jni/java-lang/.libs/libjavalang.a \ - @THREAD_OBJ@ \ - toolbox/libtoolbox.a - -all: cacaoh genoffsets gennativetable cacao - -mm/libboehm.a: - make -C mm - -classpath/native/jni/java-lang/.libs/libjavalang.a: - make -C classpath/native/ - -threads/libthreads.a: - make -C threads - -toolbox/libtoolbox.a: - make -C toolbox - -jit/libjit.a: - make -C jit - -nat/libnat.a: - make -C nat - -natheaders: cacaoh - CLASSPATH=$(top_srcdir)/classpath/lib/bootstrap.zip \ - ./cacaoh -d nat/ \ - $(CLASSES) - -nativetable.inc: gennativetable nat/implementednatives.data - CLASSPATH=$(top_srcdir)/classpath/lib/bootstrap.zip \ - $(top_srcdir)/gennativetable \ - $(NOGEN_CLASSES) \ - $(CLASSES) \ - > nativetable.inc - -nat/implementednatives.data: - make -C nat implementednatives - -native.c: nativetable.inc - -CLASSES= \ - java.lang.JOWENNTest1 \ - \ - java.lang.reflect.Field \ - java.lang.SecurityManager \ - java.net.DatagramPacket \ - java.net.InetAddress \ - java.net.SocketImpl \ - java.util.Properties \ - \ - gnu.classpath.Configuration \ - gnu.classpath.RawData \ - gnu.java.lang.reflect.TypeSignature \ - gnu.java.math.MPN \ - gnu.java.net.PlainDatagramSocketImpl \ - gnu.java.net.PlainSocketImpl \ - gnu.java.nio.FileLockImpl \ - gnu.java.nio.SelectorImpl \ - gnu.java.nio.channels.FileChannelImpl \ - gnu.java.security.x509.X509Certificate \ - java.beans.PropertyEditor \ - java.io.DataInput \ - java.io.DataInputStream \ - java.io.File \ - java.io.FileDescriptor \ - java.io.FileInputStream \ - java.io.FileWriter \ - java.io.ObjectInputStream \ - java.io.OutputStream \ - java.io.OutputStreamWriter \ - java.io.PrintStream \ - java.io.PrintWriter \ - java.io.RandomAccessFile \ - java.io.VMFile \ - java.io.VMObjectStreamClass \ - java.io.Writer \ - java.lang.Boolean \ - java.lang.Byte \ - java.lang.Character \ - java.lang.Class \ - java.lang.Compiler \ - java.lang.Double \ - java.lang.Float \ - java.lang.Integer \ - java.lang.Long \ - java.lang.Math \ - java.lang.Process \ - java.lang.Runtime \ - java.lang.RuntimePermission \ - java.lang.Short \ - java.lang.StackTraceElement \ - java.lang.StrictMath \ - java.lang.StringBuffer \ - java.lang.System \ - java.lang.UnsatisfiedLinkError \ - java.lang.VMClass \ - java.lang.VMClassLoader \ - java.lang.VMDouble \ - java.lang.VMFloat \ - java.lang.VMRuntime \ - java.lang.VMSecurityManager \ - java.lang.VMString \ - java.lang.VMSystem \ - java.lang.VMThrowable \ - java.lang.reflect.Array \ - java.lang.reflect.Constructor \ - java.lang.reflect.Method \ - java.lang.reflect.Modifier \ - java.lang.reflect.Proxy \ - java.net.DatagramSocketImpl \ - java.net.NetworkInterface \ - java.nio.ByteOrder \ - java.nio.CharBufferImpl \ - java.nio.DirectByteBufferImpl \ - java.nio.DoubleBufferImpl \ - java.nio.FloatBufferImpl \ - java.nio.IntBufferImpl \ - java.nio.LongBufferImpl \ - java.nio.ShortBufferImpl \ - java.security.AccessController \ - java.security.ProtectionDomain \ - java.security.cert.Certificate \ - java.security.cert.X509Certificate \ - java.sql.Connection \ - java.text.Collator \ - java.util.Hashtable \ - java.util.Locale \ - java.util.TimeZone \ - java.util.VMTimeZone \ - java.util.zip.Deflater \ - java.util.zip.Inflater \ - javax.swing.Popup \ - javax.swing.UIManager \ - @AWTPEERS@ - -NOGEN_CLASSES = \ - java.lang.ClassLoader \ - java.lang.Cloneable \ - java.lang.Object \ - java.lang.String \ - java.lang.ThreadGroup \ - java.lang.Throwable \ - java.lang.VMObject \ - java.lang.VMThread - -checkjvm: - $(MAKE) -C jvmtst $@ + html/index.html ## Local variables: diff --git a/autogen.sh b/autogen.sh index 86ba59ebd..82ac9ae0f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,9 +1,13 @@ #!/bin/sh +libtoolize --automake aclocal autoheader automake --add-missing autoconf -cd mm/boehm-gc && ./autogen.sh && cd ../.. -cd classpath && ./autogen.sh && cd ../.. +#echo "boehm-gc" +cd src/boehm-gc && ./autogen.sh && cd ../.. + +#echo "classpath" +cd src/classpath && ./autogen.sh && cd ../.. diff --git a/configure.in b/configure.in index 415d88bd2..cb1ae68bc 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ dnl autoconf; autoheader; automake dnl Process this file with autoconf to produce a configure script. AC_INIT(cacao, 0.40, cacao@complang.tuwien.ac.at) -AC_CONFIG_SRCDIR(main.c) +AC_CONFIG_SRCDIR(src/cacao/cacao.c) AC_CANONICAL_HOST AC_PREREQ(2.59) AM_INIT_AUTOMAKE @@ -179,34 +179,34 @@ no | none | single) AC_MSG_RESULT(no) dnl no threads for boehm ac_configure_args="$ac_configure_args --disable-boehm-threads" + AM_CONDITIONAL([USE_THREADS], [false]) ;; + green | native | posix | pthreads) AC_DEFINE([USE_THREADS], 1, [use threads]) AC_DEFINE([EXTERNAL_OVERFLOW], 1, [external overflow]) AC_DEFINE([DONT_FREE_FIRST], 1, [don't free first]) - LIBTHREAD="libthreads.a" - THREAD_OBJ="threads/libthreads.a" - AC_SUBST(LIBTHREAD) - AC_SUBST(THREAD_OBJ) + AM_CONDITIONAL([USE_THREADS], [true]) if test x"$enable_threads" != "xgreen"; then - AC_DEFINE([NATIVE_THREADS], 1, [use pthreads]) - THREAD_LIB="-lpthread" - AC_SUBST(THREAD_LIB) AC_MSG_RESULT(yes, native) AC_CHECK_LIB(pthread, main) + AC_DEFINE([NATIVE_THREADS], 1, [use pthreads]) CFLAGS="$CFLAGS -D_REENTRANT" dnl tell boehm to support threads as well and classpath to dnl synchronize VM threads portably ac_configure_args="$ac_configure_args --enable-boehm-threads=posix --enable-portable-native-sync" + AM_CONDITIONAL([NATIVE_THREADS], [true]) + else AC_MSG_RESULT(yes, green) dnl no threads for boehm ac_configure_args="$ac_configure_args --disable-boehm-threads" + AM_CONDITIONAL([NATIVE_THREADS], [false]) fi ;; *) @@ -324,48 +324,55 @@ fi if test "x1" == "x$STATIC_CLASSPATH"; then - STATIC_CLASSPATH_LIBS=" \ - classpath/native/jni/java-io/.libs/libjavaio.a \ - classpath/native/jni/java-nio/.libs/libjavanio.a \ - classpath/native/jni/java-net/.libs/libjavanet.a \ - classpath/native/jni/java-util/.libs/libjavautil.a \ - classpath/native/jni/java-lang/.libs/libjavalang.a \ - classpath/native/jni/java-lang/.libs/libjavalangreflect.a" - DYNAMIC_CLASSPATH_LIBS="" - AC_SUBST(STATIC_CLASSPATH_LIBS) - AC_SUBST(DYNAMIC_CLASSPATH_LIBS) AC_DEFINE([STATIC_CLASSPATH], 1, [use classpath statically linked]) + AM_CONDITIONAL([STATIC_CLASSPATH], [true]) else - DYNAMIC_CLASSPATH_LIBS="-ldl -Wl,--export-dynamic" - STATIC_CLASSPATH_LIBS="" - AC_SUBST(STATIC_CLASSPATH_LIBS) - AC_SUBST(DYNAMIC_CLASSPATH_LIBS) + AM_CONDITIONAL([STATIC_CLASSPATH], [false]) fi - - dnl now configure boehm gc and gnu classpath dnl the export is not my favorite (is there another way?) export CFLAGS export CACAO_GTK -AC_CONFIG_SUBDIRS(mm/boehm-gc classpath) +AC_CONFIG_SUBDIRS(src/boehm-gc src/classpath) AC_OUTPUT(Makefile \ - mm/Makefile \ - toolbox/Makefile \ - threads/Makefile \ - jit/Makefile \ - jit/loop/Makefile \ - jit/alpha/Makefile \ - jit/i386/Makefile \ - jit/mips/Makefile \ - jit/powerpc/Makefile \ - jit/x86_64/Makefile \ - nat/Makefile \ doc/Makefile \ - tst/Makefile \ - tst/kaffe/Makefile \ - jvmtst/Makefile ) + src/Makefile \ + src/cacao/Makefile \ + src/cacaoh/Makefile \ + src/mm/Makefile \ + src/native/Makefile \ + src/native/include/Makefile \ + src/native/tools/Makefile \ + src/native/vm/Makefile \ + src/threads/Makefile \ + src/threads/green/Makefile \ + src/threads/native/Makefile \ + src/toolbox/Makefile \ + src/vm/Makefile \ + src/vm/jit/Makefile \ + src/vm/jit/alpha/Makefile \ + src/vm/jit/i386/Makefile \ + src/vm/jit/inline/Makefile \ + src/vm/jit/loop/Makefile \ + src/vm/jit/mips/Makefile \ + src/vm/jit/powerpc/Makefile \ + src/vm/jit/tools/Makefile \ + src/vm/jit/verify/Makefile \ + src/vm/jit/x86_64/Makefile \ + tests/Makefile \ + tests/jvm98/Makefile \ + tests/kaffe/Makefile ) + + +## Local variables: +## mode: m4 +## indent-tabs-mode: t +## c-basic-offset: 4 +## tab-width: 8 +## compile-command: "automake --add-missing" +## End: diff --git a/src/boehm-gc/acinclude.m4 b/src/boehm-gc/acinclude.m4 index e32c0d45c..0529d6ebe 100644 --- a/src/boehm-gc/acinclude.m4 +++ b/src/boehm-gc/acinclude.m4 @@ -46,4 +46,3 @@ AC_DEFUN([GC_SET_VERSION], [ ${GC_ALPHA_VERSION:+alpha=}$GC_ALPHA_VERSION) ]) -sinclude(libtool.m4) diff --git a/src/boehm-gc/autogen.sh b/src/boehm-gc/autogen.sh index 842e07a43..b97a7c902 100755 --- a/src/boehm-gc/autogen.sh +++ b/src/boehm-gc/autogen.sh @@ -1,5 +1,6 @@ #!/bin/sh +libtoolize --automake aclocal autoheader automake --add-missing diff --git a/src/boehm-gc/configure.in b/src/boehm-gc/configure.in index b671a474e..f1b4216ab 100644 --- a/src/boehm-gc/configure.in +++ b/src/boehm-gc/configure.in @@ -22,7 +22,7 @@ AC_INIT(gc,6.3,Hans.Boehm@hp.com) AC_CONFIG_SRCDIR(gcj_mlc.c) AC_CANONICAL_TARGET AC_PREREQ(2.53) -AC_REVISION($Revision: 1589 $) +AC_REVISION($Revision: 1621 $) GC_SET_VERSION AM_INIT_AUTOMAKE @@ -40,6 +40,7 @@ AM_PROG_AS AC_CHECK_TOOL(AR, ar) AC_CHECK_TOOL(RANLIB, ranlib, :) # :) +AC_PROG_LIBTOOL AC_PROG_INSTALL AM_MAINTAINER_MODE diff --git a/src/cacao/cacao.c b/src/cacao/cacao.c index 0b906a45c..0eb0e4c69 100644 --- a/src/cacao/cacao.c +++ b/src/cacao/cacao.c @@ -1,4 +1,4 @@ -/* main.c - contains main() and variables for the global options +/* cacao/cacao.c - contains main() of cacao Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Institut f. Computersprachen, TU Wien @@ -37,33 +37,27 @@ - Calling the class loader - Running the main method - $Id: cacao.c 1590 2004-11-25 13:24:49Z christian $ + $Id: cacao.c 1621 2004-11-30 13:06:55Z twisti $ */ #include #include -#include "exceptions.h" -#include "main.h" -#include "options.h" -#include "global.h" -#include "tables.h" -#include "loader.h" -#include "jit/jit.h" -#include "asmpart.h" -#include "builtin.h" -#include "native.h" -#include "statistics.h" + +#include "cacao/cacao.h" #include "mm/boehm.h" -#include "threads/thread.h" +#include "mm/memory.h" +#include "native/native.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "jit/parseRTstats.h" -#include "nat/java_io_File.h" /* required by java_lang_Runtime.h */ -#include "nat/java_util_Properties.h" /* required by java_lang_Runtime.h */ -#include "nat/java_lang_Runtime.h" -#include "nat/java_lang_Throwable.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/statistics.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" +#include "vm/jit/jit.h" #ifdef TYPEINFO_DEBUG_TEST #include "typeinfo.h" diff --git a/src/cacao/cacao.h b/src/cacao/cacao.h index 47abd97d7..6dfe6db32 100644 --- a/src/cacao/cacao.h +++ b/src/cacao/cacao.h @@ -1,4 +1,4 @@ -/* main.h - main header, contains global variables +/* cacao/cacao.h - main header, contains global variables Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Institut f. Computersprachen, TU Wien @@ -27,29 +27,29 @@ Authors: Christian Thalinger - $Id: cacao.h 1359 2004-07-28 10:48:36Z twisti $ + $Id: cacao.h 1621 2004-11-30 13:06:55Z twisti $ */ -#ifndef _MAIN_H -#define _MAIN_H +#ifndef _CACAO_H +#define _CACAO_H -#include "global.h" +#include "vm/global.h" -/* global variables */ +/* global variables ***********************************************************/ extern char *classpath; extern char *mainstring; /* class.method with main method */ -/* function prototypes */ +/* function prototypes ********************************************************/ void cacao_exit(s4 status); void cacao_shutdown(s4 status); -#endif /* _MAIN_H */ +#endif /* _CACAO_H */ /* diff --git a/src/cacaoh/cacaoh.c b/src/cacaoh/cacaoh.c index 6acb457b9..eeef09d52 100644 --- a/src/cacaoh/cacaoh.c +++ b/src/cacaoh/cacaoh.c @@ -1,4 +1,4 @@ -/* cacaoh.c - main for header generation (cacaoh) +/* cacaoh/cacaoh.c - main for header generation (cacaoh) Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -30,7 +30,7 @@ Philipp Tomsich Christian Thalinger - $Id: cacaoh.c 1543 2004-11-18 12:20:19Z twisti $ + $Id: cacaoh.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -41,15 +41,23 @@ #include "config.h" #include "types.h" -#include "global.h" -#include "headers.h" -#include "loader.h" -#include "options.h" -#include "tables.h" +#include "cacaoh/headers.h" #include "mm/boehm.h" -#include "threads/thread.h" +#include "mm/memory.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif +#endif + #include "toolbox/logging.h" -#include "toolbox/memory.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/tables.h" /* define cacaoh options ******************************************************/ diff --git a/src/cacaoh/headers.c b/src/cacaoh/headers.c index 5dc9c9b40..9bc8ffec5 100644 --- a/src/cacaoh/headers.c +++ b/src/cacaoh/headers.c @@ -1,4 +1,4 @@ -/* headers.c - functions for header generation +/* vm/headers.c - functions for header generation Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -30,7 +30,7 @@ Philipp Tomsich Christian Thalinger - $Id: headers.c 1570 2004-11-23 16:04:33Z twisti $ + $Id: headers.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -41,17 +41,17 @@ #include #include "config.h" -#include "global.h" -#include "tables.h" -#include "loader.h" -#include "options.h" -#include "builtin.h" #include "mm/boehm.h" +#include "mm/memory.h" +#include "native/include/java_lang_String.h" +#include "native/include/java_lang_Throwable.h" #include "toolbox/chain.h" -#include "toolbox/memory.h" #include "toolbox/logging.h" -#include "nat/java_lang_String.h" -#include "nat/java_lang_Throwable.h" +#include "vm/global.h" +#include "vm/tables.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/builtin.h" /******* replace some external functions *********/ diff --git a/src/cacaoh/headers.h b/src/cacaoh/headers.h index d3426dc34..4ee6383cf 100644 --- a/src/cacaoh/headers.h +++ b/src/cacaoh/headers.h @@ -1,4 +1,4 @@ -/* headers.h - export functions for header generation +/* cacaoh/headers.h - export functions for header generation Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: headers.h 1529 2004-11-17 17:19:14Z twisti $ + $Id: headers.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -35,6 +35,7 @@ #include "toolbox/chain.h" +#include "vm/global.h" /* export variables */ diff --git a/src/mm/Makefile.am b/src/mm/Makefile.am index b0fea78b9..74eb15049 100644 --- a/src/mm/Makefile.am +++ b/src/mm/Makefile.am @@ -1,16 +1,14 @@ ## Process this file with automake to produce Makefile.in -# $Id: Makefile.am 1225 2004-06-30 19:26:19Z twisti $ +# $Id: Makefile.am 1621 2004-11-30 13:06:55Z twisti $ -SUBDIRS = boehm-gc +INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/@ARCH_DIR@ -noinst_LIBRARIES = libboehm.a +noinst_LIBRARIES = libmm.a -noinst_HEADERS = boehm.h +noinst_HEADERS = boehm.h memory.h -libboehm_a_SOURCES = boehm.c - -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/jit/@ARCH_DIR@ +libmm_a_SOURCES = boehm.c memory.c ## Local variables: diff --git a/src/mm/boehm.c b/src/mm/boehm.c index 56fc1ec1a..030ec23ad 100644 --- a/src/mm/boehm.c +++ b/src/mm/boehm.c @@ -26,7 +26,7 @@ Authors: Stefan Ring - $Id: boehm.c 1378 2004-08-01 22:34:16Z stefan $ + $Id: boehm.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -37,18 +37,25 @@ #define GC_IRIX_THREADS #endif -#include "options.h" -#include "asmpart.h" -#include "boehm.h" -#include "builtin.h" -#include "exceptions.h" -#include "global.h" -#include "loader.h" -#include "native.h" -#include "tables.h" -#include "threads/thread.h" -#include "toolbox/logging.h" #include "boehm-gc/include/gc.h" +#include "mm/boehm.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif +#endif + +#include "toolbox/logging.h" +#include "vm/options.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" static bool in_gc_out_of_memory = false; /* is GC out of memory? */ diff --git a/src/mm/boehm.h b/src/mm/boehm.h index c8fa1631c..fe704ef13 100644 --- a/src/mm/boehm.h +++ b/src/mm/boehm.h @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: boehm.h 1143 2004-06-05 23:53:24Z twisti $ + $Id: boehm.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,16 +34,18 @@ #ifndef _BOEHM_H #define _BOEHM_H -#include "global.h" +#include "types.h" +#include "vm/global.h" + struct otherstackcall; typedef void *(*calltwoargs)(void *, u4); struct otherstackcall { - calltwoargs p2; - void *p; - u4 l; + calltwoargs p2; + void *p; + u4 l; }; diff --git a/src/mm/memory.c b/src/mm/memory.c index 236cda971..85ea79ea8 100644 --- a/src/mm/memory.c +++ b/src/mm/memory.c @@ -26,7 +26,7 @@ Authors: Reinhard Grafl - $Id: memory.c 1599 2004-11-28 17:11:50Z twisti $ + $Id: memory.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -45,14 +45,18 @@ #include #include "config.h" -#include "exceptions.h" -#include "global.h" -#include "native.h" -#include "options.h" -#include "statistics.h" -#include "threads/nativethread.h" +#include "mm/memory.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/options.h" +#include "vm/statistics.h" +#include "native/native.h" + +#if defined(USE_THREADS) && defined(NATIVE_THREADS) +# include "threads/native/threads.h" +#endif + #include "toolbox/logging.h" -#include "toolbox/memory.h" /********* general types, variables and auxiliary functions *********/ diff --git a/src/native/jni.c b/src/native/jni.c index 7fa2d28e0..c2787d454 100644 --- a/src/native/jni.c +++ b/src/native/jni.c @@ -1,4 +1,4 @@ -/* jni.c - implementation of the Java Native Interface functions +/* native/jni.c - implementation of the Java Native Interface functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,37 +28,47 @@ Changes: Joseph Wenninger, Martin Platter - $Id: jni.c 1494 2004-11-12 13:34:26Z twisti $ + $Id: jni.c 1621 2004-11-30 13:06:55Z twisti $ */ #include -#include "exceptions.h" -#include "main.h" -#include "jni.h" -#include "global.h" -#include "loader.h" -#include "tables.h" -#include "native.h" -#include "builtin.h" -#include "options.h" -#include "statistics.h" -#include "threads/thread.h" -#include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "nat/java_lang_Byte.h" -#include "nat/java_lang_Character.h" -#include "nat/java_lang_Short.h" -#include "nat/java_lang_Integer.h" -#include "nat/java_lang_Boolean.h" -#include "nat/java_lang_Long.h" -#include "nat/java_lang_Float.h" -#include "nat/java_lang_Double.h" -#include "nat/java_lang_Throwable.h" -#include "jit/jit.h" -#include "asmpart.h" + #include "mm/boehm.h" +#include "mm/memory.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Byte.h" +#include "native/include/java_lang_Character.h" +#include "native/include/java_lang_Short.h" +#include "native/include/java_lang_Integer.h" +#include "native/include/java_lang_Boolean.h" +#include "native/include/java_lang_Long.h" +#include "native/include/java_lang_Float.h" +#include "native/include/java_lang_Double.h" +#include "native/include/java_lang_Throwable.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif +#endif + +#include "toolbox/logging.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/statistics.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" +#include "vm/jit/jit.h" + + #define JNI_VERSION 0x00010002 diff --git a/src/native/jni.h b/src/native/jni.h index cd804c2aa..29a6f207e 100644 --- a/src/native/jni.h +++ b/src/native/jni.h @@ -1,4 +1,4 @@ -/* jni.h - JNI types and data structures +/* native/jni.h - JNI types and data structures Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: ? - $Id: jni.h 1424 2004-10-30 11:15:23Z motse $ + $Id: jni.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -35,8 +35,9 @@ #define _JNI_H #include -#include "global.h" + #include "types.h" +#include "vm/global.h" #define JNI_VERSION 0x00010002 diff --git a/src/native/natcalls.h b/src/native/natcalls.h index 8e69ac7e0..834939c66 100644 --- a/src/native/natcalls.h +++ b/src/native/natcalls.h @@ -1,4 +1,4 @@ -/* natcalls.h - +/* native/natcalls.h - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Institut f. Computersprachen, TU Wien @@ -27,7 +27,7 @@ Authors: Carolyn Oates - $Id: natcalls.h 664 2003-11-21 18:24:01Z jowenn $ + $Id: natcalls.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -35,7 +35,7 @@ #ifndef _NATCALLS_H #define _NATCALLS_H -#include "global.h" +#include "vm/global.h" /*---------- Define Constants ---------------------------*/ diff --git a/src/native/native.c b/src/native/native.c index 1a0ecb8fe..7d6bfbd4a 100644 --- a/src/native/native.c +++ b/src/native/native.c @@ -1,4 +1,4 @@ -/* native.c - table of native functions +/* native/native.c - table of native functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -31,7 +31,7 @@ The .hh files created with the header file generator are all included here as are the C functions implementing these methods. - $Id: native.c 1567 2004-11-23 16:01:51Z twisti $ + $Id: native.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -45,26 +45,6 @@ #include #include -#include "config.h" -#include "exceptions.h" -#include "global.h" -#include "options.h" -#include "jni.h" -#include "native.h" -#include "builtin.h" -#include "asmpart.h" -#include "tables.h" -#include "loader.h" -#include "jni.h" -#include "jit/jit.h" -#include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "threads/thread.h" -#include "threads/threadio.h" -#include "threads/locks.h" -#include "nat/java_lang_Throwable.h" - - /* Include files for IO functions */ #include @@ -75,9 +55,28 @@ #endif #include +#include "config.h" +#include "mm/memory.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Throwable.h" +#include "toolbox/logging.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" +#include "vm/jit/jit.h" +#if 0 +#include "threads/thread.h" #include "threads/threadio.h" +#include "threads/locks.h" +#endif + -/* include table of native functions */ +/* include table of native functions ******************************************/ #include "nativetable.inc" diff --git a/src/native/native.h b/src/native/native.h index c8df4259d..d2e766987 100644 --- a/src/native/native.h +++ b/src/native/native.h @@ -1,4 +1,4 @@ -/* native.h - table of native functions +/* native/native.h - table of native functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: Reinhard Grafl - $Id: native.h 1465 2004-11-08 11:09:01Z twisti $ + $Id: native.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -35,10 +35,10 @@ #define _NATIVE_H -#include "jni.h" -#include "nat/java_lang_String.h" -#include "nat/java_lang_ClassLoader.h" -#include "nat/java_lang_Throwable.h" +#include "native/jni.h" +#include "native/include/java_lang_String.h" +#include "native/include/java_lang_ClassLoader.h" +#include "native/include/java_lang_Throwable.h" /* table for locating native methods */ diff --git a/src/native/tools/gennativetable.c b/src/native/tools/gennativetable.c index 66a5f511c..50d448e96 100644 --- a/src/native/tools/gennativetable.c +++ b/src/native/tools/gennativetable.c @@ -28,7 +28,7 @@ Changes: - $Id: gennativetable.c 1429 2004-11-02 08:58:26Z jowenn $ + $Id: gennativetable.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -36,17 +36,26 @@ #include #include #include + #include "config.h" #include "types.h" -#include "global.h" -#include "headers.h" -#include "loader.h" -#include "tables.h" +#include "cacaoh/headers.h" #include "mm/boehm.h" -#include "threads/locks.h" -#include "threads/thread.h" +#include "mm/memory.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif +#endif + #include "toolbox/chain.h" -#include "toolbox/memory.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/tables.h" int main(int argc, char **argv) @@ -154,27 +163,23 @@ int main(int argc, char **argv) /* create table of native-methods */ -/* file = fopen("nativetable.h", "w"); */ file = stdout; - if (!file) - panic("Can not open file 'nativetable' to store native-link-table"); - fprintf(file, "/* Table of native methods: nativetables.inc */\n"); - fprintf(file, "/* This file is machine generated, don't edit it !*/\n\n"); + fprintf(file, "/* This file is machine generated, don't edit it! */\n\n"); - fprintf(file, "#include \"config.h\"\n"); + fprintf(file, "#include \"config.h\"\n"); c = chain_first(nativeclass_chain); while (c) { gen_header_filename(classname, c->name); - fprintf(file, "#include \"nat/%s.h\"\n", classname); + fprintf(file, "#include \"native/include/%s.h\"\n", classname); c = chain_next(nativeclass_chain); } chain_free(nativeclass_chain); - fprintf(file, "\n\n#include \"native.h\"\n\n"); - fprintf(file, "#ifdef STATIC_CLASSPATH\n\n"); + fprintf(file, "\n\n#include \"native/native.h\"\n\n"); + fprintf(file, "#if defined(STATIC_CLASSPATH)\n\n"); fprintf(file, "static nativeref nativetable[] = {\n"); m = chain_first(nativemethod_chain); @@ -185,26 +190,35 @@ int main(int argc, char **argv) chain_free(nativemethod_chain); fprintf(file, "};\n"); - fprintf(file,"\n#else\n"); - fprintf(file, "/*ensure that symbols for functions implemented within cacao are used and exported to dlopen*/\n"); - fprintf(file, "static functionptr dummynativetable[]={\n"); + fprintf(file,"\n#else\n"); + fprintf(file, "/*ensure that symbols for functions implemented within cacao are used and exported to dlopen*/\n"); + fprintf(file, "static functionptr dummynativetable[]={\n"); + { - FILE *implData=fopen("nat/implementednatives.data","r"); - if (!implData) {fclose(file); exit(3);} + FILE *implData; + + implData = fopen("vm/implementednatives.data", "r"); + + if (!implData) { + fclose(file); + throw_cacao_exception_exit(string_java_lang_InternalError, + "Could not find file"); + } + while (!feof(implData)) { char functionLine[1024]; - functionLine[0]='\0'; + functionLine[0]='\0'; fgets(functionLine,1024,implData); - if (strlen(functionLine)<2) continue; + if (strlen(functionLine)<2) continue; if (functionLine[strlen(functionLine)-1]!='\n') { fclose(implData); fclose(file); exit(4);} - functionLine[strlen(functionLine)-1]=','; + functionLine[strlen(functionLine)-1]=','; fprintf(file,"\t(functionptr) %s\n",functionLine); } fprintf(file,"\t(functionptr)0"); - fclose(implData); + fclose(implData); } - fprintf(file, "};\n"); - fprintf(file,"\n#endif\n"); + fprintf(file, "};\n"); + fprintf(file,"\n#endif\n"); fclose(file); /* release all resources */ diff --git a/src/native/vm/Constructor.c b/src/native/vm/Constructor.c index 1290fe98d..0fc86e2ae 100644 --- a/src/native/vm/Constructor.c +++ b/src/native/vm/Constructor.c @@ -1,4 +1,4 @@ -/* nat/Constructor.c - java/lang/reflect/Constructor +/* native/vm/Constructor.c - java/lang/reflect/Constructor Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,24 +28,25 @@ Changes: Joseph Wenninger - $Id: Constructor.c 1537 2004-11-18 12:12:05Z twisti $ + $Id: Constructor.c 1621 2004-11-30 13:06:55Z twisti $ */ #include -#include "jni.h" -#include "builtin.h" -#include "exceptions.h" -#include "loader.h" -#include "native.h" -#include "tables.h" -#include "asmpart.h" -#include "options.h" + +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Class.h" +#include "native/include/java_lang_Object.h" +#include "native/include/java_lang_reflect_Constructor.h" #include "toolbox/logging.h" -#include "nat/java_lang_Object.h" -#include "nat/java_lang_Class.h" -#include "nat/java_lang_reflect_Constructor.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" /* diff --git a/src/native/vm/Field.c b/src/native/vm/Field.c index 0764f9537..cc2ba02f7 100644 --- a/src/native/vm/Field.c +++ b/src/native/vm/Field.c @@ -1,4 +1,4 @@ -/* nat/Field.c - java/lang/reflect/Field +/* native/vm/Field.c - java/lang/reflect/Field Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,20 +28,20 @@ Changes: Joseph Wenninger - $Id: Field.c 1537 2004-11-18 12:12:05Z twisti $ + $Id: Field.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include "jni.h" -#include "builtin.h" -#include "exceptions.h" -#include "loader.h" -#include "native.h" -#include "tables.h" -#include "nat/java_lang_Object.h" -#include "nat/java_lang_Class.h" -#include "nat/java_lang_reflect_Field.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Object.h" +#include "native/include/java_lang_Class.h" +#include "native/include/java_lang_reflect_Field.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/loader.h" +#include "vm/tables.h" /* diff --git a/src/native/vm/Makefile.am b/src/native/vm/Makefile.am index 0d273f645..67f23e238 100644 --- a/src/native/vm/Makefile.am +++ b/src/native/vm/Makefile.am @@ -1,161 +1,25 @@ ## Process this file with automake to produce Makefile.in -# $Id: Makefile.am 1538 2004-11-18 12:13:36Z twisti $ +# $Id: Makefile.am 1621 2004-11-30 13:06:55Z twisti $ +INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/@ARCH_DIR@ -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/jit/@ARCH_DIR@ +noinst_LIBRARIES = libnativevm.a -EXTRA_DIST = - -noinst_LIBRARIES = libnat.a - -CLEANFILES = \ - implementednatives.data \ - gnu_classpath_Configuration.h \ - gnu_classpath_RawData.h \ - gnu_java_awt_image_GdkPixbufDecoder.h \ - gnu_java_awt_peer_gtk_GdkFontMetrics.h \ - gnu_java_awt_peer_gtk_GdkGraphics.h \ - gnu_java_awt_peer_gtk_GdkPixbufDecoder.h \ - gnu_java_awt_peer_gtk_GtkButtonPeer.h \ - gnu_java_awt_peer_gtk_GtkCanvasPeer.h \ - gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer.h \ - gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.h \ - gnu_java_awt_peer_gtk_GtkCheckboxPeer.h \ - gnu_java_awt_peer_gtk_GtkChoicePeer.h \ - gnu_java_awt_peer_gtk_GtkClipboard.h \ - gnu_java_awt_peer_gtk_GtkComponentPeer.h \ - gnu_java_awt_peer_gtk_GtkFileDialogPeer.h \ - gnu_java_awt_peer_gtk_GtkFramePeer.h \ - gnu_java_awt_peer_gtk_GtkGenericPeer.h \ - gnu_java_awt_peer_gtk_GtkImagePainter.h \ - gnu_java_awt_peer_gtk_GtkLabelPeer.h \ - gnu_java_awt_peer_gtk_GtkListPeer.h \ - gnu_java_awt_peer_gtk_GtkMainThread.h \ - gnu_java_awt_peer_gtk_GtkMenuBarPeer.h \ - gnu_java_awt_peer_gtk_GtkMenuItemPeer.h \ - gnu_java_awt_peer_gtk_GtkMenuPeer.h \ - gnu_java_awt_peer_gtk_GtkPanelPeer.h \ - gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h \ - gnu_java_awt_peer_gtk_GtkScrollPanePeer.h \ - gnu_java_awt_peer_gtk_GtkScrollbarPeer.h \ - gnu_java_awt_peer_gtk_GtkTextAreaPeer.h \ - gnu_java_awt_peer_gtk_GtkTextComponentPeer.h \ - gnu_java_awt_peer_gtk_GtkTextFieldPeer.h \ - gnu_java_awt_peer_gtk_GtkToolkit.h \ - gnu_java_awt_peer_gtk_GtkWindowPeer.h \ - gnu_java_lang_reflect_TypeSignature.h \ - gnu_java_math_MPN.h \ - gnu_java_net_PlainDatagramSocketImpl.h \ - gnu_java_net_PlainSocketImpl.h \ - gnu_java_nio_FileLockImpl.h \ - gnu_java_nio_SelectorImpl.h \ - gnu_java_nio_channels_FileChannelImpl.h \ - gnu_java_security_x509_X509Certificate.h \ - java_awt_peer_ComponentPeer.h \ - java_awt_peer_MenuItemPeer.h \ - java_awt_peer_MenuPeer.h \ - java_beans_PropertyEditor.h \ - java_io_DataInput.h \ - java_io_DataInputStream.h \ - java_io_File.h \ - java_io_FileDescriptor.h \ - java_io_FileInputStream.h \ - java_io_FileWriter.h \ - java_io_ObjectInputStream.h \ - java_io_OutputStream.h \ - java_io_OutputStreamWriter.h \ - java_io_PrintStream.h \ - java_io_PrintWriter.h \ - java_io_RandomAccessFile.h \ - java_io_VMFile.h \ - java_io_VMObjectStreamClass.h \ - java_io_Writer.h \ - java_lang_Boolean.h \ - java_lang_Byte.h \ - java_lang_Character.h \ - java_lang_Class.h \ - java_lang_Compiler.h \ - java_lang_Double.h \ - java_lang_Float.h \ - java_lang_Integer.h \ - java_lang_JOWENNTest1.h \ - java_lang_Long.h \ - java_lang_Math.h \ - java_lang_Process.h \ - java_lang_Runtime.h \ - java_lang_RuntimePermission.h \ - java_lang_SecurityManager.h \ - java_lang_Short.h \ - java_lang_StackTraceElement.h \ - java_lang_StrictMath.h \ - java_lang_StringBuffer.h \ - java_lang_System.h \ - java_lang_UnsatisfiedLinkError.h \ - java_lang_VMClass.h \ - java_lang_VMClassLoader.h \ - java_lang_VMDouble.h \ - java_lang_VMFloat.h \ - java_lang_VMRuntime.h \ - java_lang_VMSecurityManager.h \ - java_lang_VMString.h \ - java_lang_VMSystem.h \ - java_lang_VMThrowable.h \ - java_lang_reflect_Array.h \ - java_lang_reflect_Constructor.h \ - java_lang_reflect_Field.h \ - java_lang_reflect_Method.h \ - java_lang_reflect_Modifier.h \ - java_lang_reflect_Proxy.h \ - java_net_DatagramPacket.h \ - java_net_DatagramSocketImpl.h \ - java_net_InetAddress.h \ - java_net_NetworkInterface.h \ - java_net_PlainDatagramSocketImpl.h \ - java_net_PlainSocketImpl.h \ - java_net_SocketImpl.h \ - java_net_URL.h \ - java_nio_ByteOrder.h \ - java_nio_CharBufferImpl.h \ - java_nio_DirectByteBufferImpl.h \ - java_nio_DoubleBufferImpl.h \ - java_nio_FloatBufferImpl.h \ - java_nio_IntBufferImpl.h \ - java_nio_LongBufferImpl.h \ - java_nio_ShortBufferImpl.h \ - java_nio_channels_FileChannelImpl.h \ - java_security_AccessController.h \ - java_security_ProtectionDomain.h \ - java_security_cert_Certificate.h \ - java_security_cert_X509Certificate.h \ - java_sql_Connection.h \ - java_text_Collator.h \ - java_util_Hashtable.h \ - java_util_Locale.h \ - java_util_Properties.h \ - java_util_TimeZone.h \ - java_util_VMTimeZone.h \ - java_util_zip_Deflater.h \ - java_util_zip_Inflater.h \ - javax_swing_Popup.h \ - javax_swing_UIManager.h - -libnat_a_SOURCES = \ +libnativevm_a_SOURCES = \ Constructor.c \ Field.c \ Method.c \ Proxy.c \ - Runtime.c \ - Thread.c \ VMClass.c \ VMClassLoader.c \ VMObject.c \ + VMRuntime.c \ VMSecurityManager.c \ VMString.c \ VMSystem.c \ - VMThrowable.c \ - JOWENNTest1.c \ - classcontextnativeTest.c + VMThread.c \ + VMThrowable.c #libgtk_a_SOURCES = \ GdkGraphics.c \ @@ -165,14 +29,16 @@ libnat_a_SOURCES = \ GtkLabelPeer.c \ GtkScrollPanePeer.c +all: libnativevm.a implementednatives + implementednatives: - echo "">implementednatives.data - grep "JNICALL Java_" *.c | perl -p -i -e "s/.*JNICALL\s//" | perl -p -i -e"s/\(.*//" | (\ + echo "" > implementednatives.data + grep "JNICALL Java_" *.c | perl -p -i -e "s/.*JNICALL\s//" | perl -p -i -e"s/\(.*//" | ( \ while read line; do \ - grep $$line *.h >/dev/null ; \ + grep $$line $(top_srcdir)/src/native/include/*.h > /dev/null; \ if test $$? == 0; then \ - echo $$line >>implementednatives.data ;\ - fi ;\ + echo $$line >> implementednatives.data; \ + fi ; \ done ) ## Local variables: diff --git a/src/native/vm/Method.c b/src/native/vm/Method.c index c3936f2aa..8205bd9ae 100644 --- a/src/native/vm/Method.c +++ b/src/native/vm/Method.c @@ -1,4 +1,4 @@ -/* nat/Method.c - java/lang/reflect/Method +/* native/vm/Method.c - java/lang/reflect/Method Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,22 +28,18 @@ Changes: Joseph Wenninger - $Id: Method.c 1537 2004-11-18 12:12:05Z twisti $ + $Id: Method.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include "jni.h" -#include "loader.h" -#include "global.h" -#include "tables.h" #include "types.h" -#include "builtin.h" -#include "native.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Object.h" +#include "native/include/java_lang_Class.h" +#include "native/include/java_lang_reflect_Method.h" #include "toolbox/logging.h" -#include "nat/java_lang_Object.h" -#include "nat/java_lang_Class.h" -#include "nat/java_lang_reflect_Method.h" /* diff --git a/src/native/vm/Proxy.c b/src/native/vm/Proxy.c index 5057fcca5..efdb85777 100644 --- a/src/native/vm/Proxy.c +++ b/src/native/vm/Proxy.c @@ -1,4 +1,4 @@ -/* nat/Proxy.c - java/lang/reflect/Proxy +/* native/vm/Proxy.c - java/lang/reflect/Proxy Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,15 +28,15 @@ Changes: Joseph Wenninger - $Id: Proxy.c 1537 2004-11-18 12:12:05Z twisti $ + $Id: Proxy.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include "jni.h" +#include "native/jni.h" +#include "native/include/java_lang_Class.h" +#include "native/include/java_lang_ClassLoader.h" #include "toolbox/logging.h" -#include "nat/java_lang_Class.h" -#include "nat/java_lang_ClassLoader.h" /* diff --git a/src/native/vm/VMClass.c b/src/native/vm/VMClass.c index d0c62e963..80de48f16 100644 --- a/src/native/vm/VMClass.c +++ b/src/native/vm/VMClass.c @@ -1,4 +1,4 @@ -/* nat/VMClass.c - java/lang/Class +/* native/vm/VMClass.c - java/lang/Class Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,31 +28,32 @@ Changes: Joseph Wenninger - $Id: VMClass.c 1516 2004-11-17 11:53:56Z twisti $ + $Id: VMClass.c 1621 2004-11-30 13:06:55Z twisti $ */ #include -#include "jni.h" + #include "types.h" -#include "exceptions.h" -#include "global.h" -#include "builtin.h" -#include "loader.h" -#include "native.h" -#include "tables.h" +#include "mm/memory.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Object.h" +#include "native/include/java_lang_Class.h" +#include "native/include/java_lang_ClassLoader.h" +#include "native/include/java_security_ProtectionDomain.h" +#include "native/include/java_lang_reflect_Constructor.h" +#include "native/include/java_lang_reflect_Field.h" +#include "native/include/java_lang_reflect_Method.h" +#include "native/include/java_lang_Throwable.h" /* java_lang_VMClass.h */ +#include "native/include/java_lang_VMClass.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "java_lang_Object.h" -#include "java_lang_Class.h" -#include "java_lang_ClassLoader.h" -#include "java_security_ProtectionDomain.h" -#include "java_lang_reflect_Constructor.h" -#include "java_lang_reflect_Field.h" -#include "java_lang_reflect_Method.h" -#include "java_lang_Throwable.h" /* needed for java_lang_VMClass.h */ -#include "java_lang_VMClass.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/builtin.h" /* for selecting public members */ diff --git a/src/native/vm/VMClassLoader.c b/src/native/vm/VMClassLoader.c index 9a7f710cd..8b6a0dabe 100644 --- a/src/native/vm/VMClassLoader.c +++ b/src/native/vm/VMClassLoader.c @@ -1,4 +1,4 @@ -/* nat/VMClassLoader.c - java/lang/ClassLoader +/* native/vm/VMClassLoader.c - java/lang/VMClassLoader Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,21 +28,21 @@ Changes: Joseph Wenninger - $Id: VMClassLoader.c 1536 2004-11-18 10:40:43Z twisti $ + $Id: VMClassLoader.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include "exceptions.h" -#include "jni.h" -#include "loader.h" -#include "native.h" -#include "builtin.h" -#include "tables.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Class.h" +#include "native/include/java_lang_String.h" +#include "native/include/java_lang_ClassLoader.h" #include "toolbox/logging.h" -#include "nat/java_lang_Class.h" -#include "nat/java_lang_String.h" -#include "nat/java_lang_ClassLoader.h" +#include "vm/exceptions.h" +#include "vm/builtin.h" +#include "vm/loader.h" +#include "vm/tables.h" /* diff --git a/src/native/vm/VMObject.c b/src/native/vm/VMObject.c index 316bbe5c3..c47b9f440 100644 --- a/src/native/vm/VMObject.c +++ b/src/native/vm/VMObject.c @@ -1,4 +1,4 @@ -/* nat/VMObject.c - java/lang/Object +/* native/vm/VMObject.c - java/lang/Object Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,25 +28,34 @@ Changes: Joseph Wenninger - $Id: VMObject.c 1517 2004-11-17 11:54:13Z twisti $ + $Id: VMObject.c 1621 2004-11-30 13:06:55Z twisti $ */ #include #include -#include "exceptions.h" -#include "jni.h" -#include "builtin.h" -#include "loader.h" -#include "native.h" -#include "options.h" + #include "mm/boehm.h" -#include "threads/locks.h" +#include "mm/memory.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "nat/java_lang_Cloneable.h" -#include "nat/java_lang_Object.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Cloneable.h" +#include "native/include/java_lang_Object.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/loader.h" +#include "vm/options.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# include "threads/green/locks.h" +# endif +#endif /* @@ -68,7 +77,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_VMObject_clone(JNIEnv *env, j new = (java_lang_Object *) heap_allocate(size, (desc->arraytype == ARRAYTYPE_OBJECT), NULL); memcpy(new, this, size); #if defined(USE_THREADS) && defined(NATIVE_THREADS) - initObjectLock(new); + initObjectLock((java_objectheader *) new); #endif return new; @@ -90,7 +99,7 @@ JNIEXPORT java_lang_Object* JNICALL Java_java_lang_VMObject_clone(JNIEnv *env, j memcpy(new, this, c->instancesize); #if defined(USE_THREADS) && defined(NATIVE_THREADS) - initObjectLock(new); + initObjectLock((java_objectheader *) new); #endif return new; diff --git a/src/native/vm/VMRuntime.c b/src/native/vm/VMRuntime.c index cd5226c5c..5cf652e48 100644 --- a/src/native/vm/VMRuntime.c +++ b/src/native/vm/VMRuntime.c @@ -1,4 +1,4 @@ -/* nat/Runtime.c - java/lang/Runtime +/* native/vm/VMRuntime.c - java/lang/VMRuntime Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -29,7 +29,7 @@ Changes: Joseph Wenninger Christian Thalinger - $Id: VMRuntime.c 1514 2004-11-17 11:52:46Z twisti $ + $Id: VMRuntime.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -39,28 +39,28 @@ #include #include +#if !defined(STATIC_CLASSPATH) +#include +#endif + #include "config.h" -#include "exceptions.h" -#include "main.h" -#include "jni.h" -#include "builtin.h" -#include "exceptions.h" -#include "loader.h" -#include "native.h" -#include "tables.h" -#include "asmpart.h" +#include "cacao/cacao.h" #include "mm/boehm.h" +#include "mm/memory.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_io_File.h" +#include "native/include/java_lang_String.h" +#include "native/include/java_lang_Process.h" +#include "native/include/java_util_Properties.h" /* java_lang_VMRuntime.h */ +#include "native/include/java_lang_VMRuntime.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "nat/java_io_File.h" -#include "nat/java_lang_String.h" -#include "nat/java_lang_Process.h" -#include "nat/java_util_Properties.h" /* needed for java_lang_VMRuntime.h */ -#include "nat/java_lang_VMRuntime.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" -#ifndef STATIC_CLASSPATH -#include -#endif /* this should work on BSD */ /* diff --git a/src/native/vm/VMSecurityManager.c b/src/native/vm/VMSecurityManager.c index 0188f30e7..d2f122095 100644 --- a/src/native/vm/VMSecurityManager.c +++ b/src/native/vm/VMSecurityManager.c @@ -1,4 +1,4 @@ -/* nat/SecurityManager.c - java/lang/SecurityManager +/* native/vm/VMSecurityManager.c - java/lang/VMSecurityManager Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,17 +28,17 @@ Changes: Joseph Wenninger - $Id: VMSecurityManager.c 1208 2004-06-25 12:20:52Z twisti $ + $Id: VMSecurityManager.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include "jni.h" -#include "builtin.h" -#include "native.h" -#include "tables.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_ClassLoader.h" #include "toolbox/logging.h" -#include "java_lang_ClassLoader.h" +#include "vm/builtin.h" +#include "vm/tables.h" #ifndef __I386__ diff --git a/src/native/vm/VMString.c b/src/native/vm/VMString.c index 4c69f5e2e..4fd1ad52f 100644 --- a/src/native/vm/VMString.c +++ b/src/native/vm/VMString.c @@ -1,4 +1,4 @@ -/* nat/VMString.c - java/lang/String +/* native/vm/VMString.c - java/lang/VMString Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,15 +28,16 @@ Changes: Christian Thalinger - $Id: VMString.c 1518 2004-11-17 11:54:55Z twisti $ + $Id: VMString.c 1621 2004-11-30 13:06:55Z twisti $ */ #include -#include "jni.h" -#include "native.h" -#include "nat/java_lang_String.h" + +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_String.h" /* diff --git a/src/native/vm/VMSystem.c b/src/native/vm/VMSystem.c index a78e43419..17a083f5c 100644 --- a/src/native/vm/VMSystem.c +++ b/src/native/vm/VMSystem.c @@ -1,4 +1,4 @@ -/* nat/VMSystem.c - java/lang/System +/* native/vm/VMSystem.c - java/lang/VMSystem Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,19 +28,20 @@ Changes: Joseph Wenninger - $Id: VMSystem.c 1344 2004-07-21 17:12:53Z twisti $ + $Id: VMSystem.c 1621 2004-11-30 13:06:55Z twisti $ */ #include #include -#include "exceptions.h" -#include "jni.h" -#include "builtin.h" -#include "native.h" + +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Object.h" #include "toolbox/logging.h" -#include "java_lang_Object.h" +#include "vm/exceptions.h" +#include "vm/builtin.h" /* diff --git a/src/native/vm/VMThread.c b/src/native/vm/VMThread.c index 88dbfc7c0..d4899e441 100644 --- a/src/native/vm/VMThread.c +++ b/src/native/vm/VMThread.c @@ -1,4 +1,4 @@ -/* nat/Thread.c - java/lang/Thread +/* native/vm/VMThread.c - java/lang/VMThread Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,27 +28,34 @@ Changes: Joseph Wenninger - $Id: VMThread.c 1573 2004-11-23 16:06:03Z twisti $ + $Id: VMThread.c 1621 2004-11-30 13:06:55Z twisti $ */ #include "config.h" -#include "jni.h" -#include "builtin.h" -#include "exceptions.h" #include "types.h" -#include "native.h" -#include "loader.h" -#include "options.h" -#include "tables.h" -#include "threads/thread.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_ThreadGroup.h" +#include "native/include/java_lang_Object.h" /* java_lang_Thread.h */ +#include "native/include/java_lang_Throwable.h" /* java_lang_Thread.h */ +#include "native/include/java_lang_VMThread.h" +#include "native/include/java_lang_Thread.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif +#endif + #include "toolbox/logging.h" -#include "nat/java_lang_ThreadGroup.h" -#include "nat/java_lang_Object.h" /* needed for java_lang_Thread.h */ -#include "nat/java_lang_Throwable.h" /* needed for java_lang_Thread.h */ -#include "nat/java_lang_VMThread.h" -#include "nat/java_lang_Thread.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/options.h" +#include "vm/tables.h" /* diff --git a/src/native/vm/VMThrowable.c b/src/native/vm/VMThrowable.c index 0b7263651..f2a3a4b79 100644 --- a/src/native/vm/VMThrowable.c +++ b/src/native/vm/VMThrowable.c @@ -1,4 +1,4 @@ -/* nat/VMThrowable.c - java/lang/Throwable +/* native/vm/VMThrowable.c - java/lang/VMThrowable Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,22 +26,21 @@ Authors: Joseph Wenninger - $Id: VMThrowable.c 1574 2004-11-23 16:07:11Z twisti $ + $Id: VMThrowable.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include "global.h" -#include "jni.h" -#include "asmpart.h" -#include "loader.h" -#include "builtin.h" -#include "tables.h" -#include "native.h" -#include "nat/java_lang_Class.h" -#include "nat/java_lang_Throwable.h" -#include "nat/java_lang_VMClass.h" -#include "nat/java_lang_VMThrowable.h" +#include "native/jni.h" +#include "native/native.h" +#include "native/include/java_lang_Class.h" +#include "native/include/java_lang_Throwable.h" +#include "native/include/java_lang_VMClass.h" +#include "native/include/java_lang_VMThrowable.h" +#include "vm/builtin.h" +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" /* diff --git a/src/threads/green/Makefile.am b/src/threads/green/Makefile.am index 522770aec..6b2be3761 100644 --- a/src/threads/green/Makefile.am +++ b/src/threads/green/Makefile.am @@ -1,22 +1,13 @@ ## Process this file with automake to produce Makefile.in -# $Id: Makefile.am 1255 2004-06-30 20:56:08Z twisti $ +# $Id: Makefile.am 1621 2004-11-30 13:06:55Z twisti $ - -noinst_LIBRARIES = @LIBTHREAD@ -EXTRA_LIBRARIES = libthreads.a +noinst_LIBRARIES = libthreads.a libthreads_a_SOURCES = \ locks.c \ - locks.h \ - thread.c \ - thread.h \ - nativethread.c \ - nativethread.h \ - threadio.c \ - threadio.h - -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/jit/@ARCH_DIR@ + threads.c \ + threadio.c ## Local variables: diff --git a/src/threads/native/threads.c b/src/threads/native/threads.c index cb10f505b..067dcef0e 100644 --- a/src/threads/native/threads.c +++ b/src/threads/native/threads.c @@ -1,7 +1,3 @@ -#include "global.h" - -#if defined(NATIVE_THREADS) - #include #include #include @@ -12,26 +8,24 @@ #include #include -#include "config.h" -#include "thread.h" #include "codegen.h" -#include "locks.h" -#include "tables.h" -#include "native.h" -#include "loader.h" -#include "builtin.h" -#include "asmpart.h" -#include "exceptions.h" -#include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "toolbox/avl.h" +#include "config.h" #include "mm/boehm.h" - -#include "nat/java_lang_Object.h" -#include "nat/java_lang_Throwable.h" -#include "nat/java_lang_Thread.h" -#include "nat/java_lang_ThreadGroup.h" -#include "nat/java_lang_VMThread.h" +#include "mm/memory.h" +#include "native/native.h" +#include "native/include/java_lang_Object.h" +#include "native/include/java_lang_Throwable.h" +#include "native/include/java_lang_Thread.h" +#include "native/include/java_lang_ThreadGroup.h" +#include "native/include/java_lang_VMThread.h" +#include "threads/native/threads.h" +#include "toolbox/avl.h" +#include "toolbox/logging.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" #include #include @@ -42,7 +36,7 @@ #elif defined(__MIPS__) #define GC_IRIX_THREADS #endif -#include "../mm/boehm-gc/include/gc.h" +#include "boehm-gc/include/gc.h" #endif #ifdef MUTEXSIM @@ -1099,8 +1093,6 @@ void broadcast_cond_for_object(java_objectheader *o) notifyOneOrAll(t, o, false); } -#endif - /* * These are local overrides for various environment variables in Emacs. diff --git a/src/threads/native/threads.h b/src/threads/native/threads.h index 261835cee..0f63e6e51 100644 --- a/src/threads/native/threads.h +++ b/src/threads/native/threads.h @@ -1,13 +1,46 @@ +/* threads/native/threads.h - native threads header + + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, + M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck, + P. Tomsich, J. Wenninger + + This file is part of CACAO. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + + Contact: cacao@complang.tuwien.ac.at + + Authors: Stefan Ring + + $Id: threads.h 1621 2004-11-30 13:06:55Z twisti $ + +*/ + + #ifndef _NATIVETHREAD_H #define _NATIVETHREAD_H #include -#include "jni.h" -#include "nat/java_lang_Object.h" /* required by java/lang/VMThread */ -#include "nat/java_lang_Thread.h" -#include "nat/java_lang_VMThread.h" -#include "toolbox/memory.h" +#include "mm/memory.h" +#include "native/jni.h" +#include "native/include/java_lang_Object.h" /* required by java/lang/VMThread*/ +#include "native/include/java_lang_Thread.h" +#include "native/include/java_lang_VMThread.h" #if defined(__DARWIN__) #include @@ -16,6 +49,13 @@ #define MUTEXSIM #endif + +typedef struct { + s4 super_baseval; + s4 super_diffval; + s4 sub_baseval; +} castinfo; + struct _threadobject; @@ -127,7 +167,7 @@ extern __thread threadobject *threadobj; #define THREADINFO (&threadobj->info) #endif -#include "builtin.h" +/*#include "builtin.h"*/ /* This must not be changed, it is used in asm_criticalsections */ typedef struct { diff --git a/src/toolbox/Makefile.am b/src/toolbox/Makefile.am index 7279fe699..7fbe098fa 100644 --- a/src/toolbox/Makefile.am +++ b/src/toolbox/Makefile.am @@ -1,24 +1,17 @@ ## Process this file with automake to produce Makefile.in -# $Id: Makefile.am 1141 2004-06-05 23:19:24Z twisti $ +# $Id: Makefile.am 1621 2004-11-30 13:06:55Z twisti $ + +INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/@ARCH_DIR@ noinst_LIBRARIES = libtoolbox.a libtoolbox_a_SOURCES = \ avl.c \ - avl.h \ - memory.c \ - memory.h \ logging.c \ - logging.h \ chain.c \ - chain.h \ tree.c \ - tree.h \ - list.c \ - list.h - -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/jit/@ARCH_DIR@ + list.c ## Local variables: diff --git a/src/toolbox/avl.c b/src/toolbox/avl.c index 7bdae27b5..5ea308793 100644 --- a/src/toolbox/avl.c +++ b/src/toolbox/avl.c @@ -27,8 +27,10 @@ #include #include #include + #include "toolbox/avl.h" + /* Creates and returns a new table with comparison function |compare| using parameter |param| and memory allocator |allocator|. diff --git a/src/toolbox/chain.c b/src/toolbox/chain.c index 92652d2b5..d8f7c5c47 100644 --- a/src/toolbox/chain.c +++ b/src/toolbox/chain.c @@ -27,7 +27,7 @@ Authors: Reinhard Grafl - $Id: chain.c 1141 2004-06-05 23:19:24Z twisti $ + $Id: chain.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -36,8 +36,7 @@ #include #include -#include "global.h" -#include "toolbox/memory.h" +#include "mm/memory.h" #include "toolbox/chain.h" diff --git a/src/toolbox/list.c b/src/toolbox/list.c index e2c000b18..ce57bc6a0 100644 --- a/src/toolbox/list.c +++ b/src/toolbox/list.c @@ -27,14 +27,13 @@ Authors: Reinhard Grafl - $Id: list.c 1552 2004-11-19 15:14:58Z twisti $ + $Id: list.c 1621 2004-11-30 13:06:55Z twisti $ */ #include -#include "global.h" #include "toolbox/list.h" diff --git a/src/toolbox/logging.c b/src/toolbox/logging.c index bdb6843ef..6da47dae9 100644 --- a/src/toolbox/logging.c +++ b/src/toolbox/logging.c @@ -27,7 +27,7 @@ Authors: Reinhard Grafl - $Id: logging.c 1273 2004-07-04 11:12:11Z stefan $ + $Id: logging.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -37,10 +37,10 @@ #include #include -#include "global.h" -#include "tables.h" #include "toolbox/logging.h" -#include "statistics.h" +#include "vm/global.h" +#include "vm/tables.h" +#include "vm/statistics.h" /*************************************************************************** diff --git a/src/toolbox/logging.h b/src/toolbox/logging.h index b09ad3805..6545292b8 100644 --- a/src/toolbox/logging.h +++ b/src/toolbox/logging.h @@ -27,7 +27,7 @@ Authors: Reinhard Grafl - $Id: logging.h 1434 2004-11-05 09:46:07Z twisti $ + $Id: logging.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -41,7 +41,7 @@ #include /* #define panic cacao_panic */ -#include "global.h" +#include "vm/global.h" #define MAXLOGTEXT 500 diff --git a/src/toolbox/tree.c b/src/toolbox/tree.c index c7502a2a0..a47401e74 100644 --- a/src/toolbox/tree.c +++ b/src/toolbox/tree.c @@ -27,7 +27,7 @@ Authors: Reinhard Grafl - $Id: tree.c 1141 2004-06-05 23:19:24Z twisti $ + $Id: tree.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -35,8 +35,7 @@ #include #include -#include "global.h" -#include "toolbox/memory.h" +#include "mm/memory.h" #include "toolbox/tree.h" diff --git a/src/vm/builtin.c b/src/vm/builtin.c index 38c434483..5f5bdf664 100644 --- a/src/vm/builtin.c +++ b/src/vm/builtin.c @@ -1,4 +1,4 @@ -/* builtin.c - functions for unsupported operations +/* vm/builtin.c - functions for unsupported operations Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -34,7 +34,7 @@ calls instead of machine instructions, using the C calling convention. - $Id: builtin.c 1542 2004-11-18 12:19:49Z twisti $ + $Id: builtin.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -42,21 +42,30 @@ #include #include #include -#include "exceptions.h" -#include "global.h" -#include "options.h" -#include "builtin.h" -#include "native.h" -#include "loader.h" -#include "tables.h" -#include "asmpart.h" + #include "mm/boehm.h" -#include "threads/thread.h" -#include "threads/locks.h" +#include "mm/memory.h" +#include "native/native.h" +#include "native/include/java_lang_Cloneable.h" +#include "native/include/java_lang_VMObject.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# include "threads/green/locks.h" +# endif +#endif + #include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "nat/java_lang_Cloneable.h" -#include "nat/java_lang_VMObject.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" #undef DEBUG /*define DEBUG 1*/ diff --git a/src/vm/builtin.h b/src/vm/builtin.h index d734fd286..2d086220a 100644 --- a/src/vm/builtin.h +++ b/src/vm/builtin.h @@ -1,4 +1,4 @@ -/* builtin.h - prototypes of builtin functions +/* vm/builtin.h - prototypes of builtin functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,7 +28,7 @@ Changes: Edwin Steiner - $Id: builtin.h 1571 2004-11-23 16:05:04Z twisti $ + $Id: builtin.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -36,10 +36,17 @@ #ifndef _BUILTIN_H #define _BUILTIN_H +#include "arch.h" #include "config.h" #include "toolbox/logging.h" -#include "threads/thread.h" -#include "arch.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif +#endif /* define infinity for floating point numbers */ diff --git a/src/vm/exceptions.c b/src/vm/exceptions.c index 9bba20589..2091b548f 100644 --- a/src/vm/exceptions.c +++ b/src/vm/exceptions.c @@ -1,4 +1,4 @@ -/* exceptions.c - exception related functions +/* vm/exceptions.c - exception related functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: exceptions.c 1578 2004-11-24 13:31:00Z twisti $ + $Id: exceptions.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,16 +34,17 @@ #include #include #include -#include "asmpart.h" -#include "global.h" -#include "loader.h" -#include "native.h" -#include "tables.h" -#include "jit/jit.h" + +#include "mm/memory.h" +#include "native/native.h" +#include "native/include/java_lang_String.h" +#include "native/include/java_lang_Throwable.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "nat/java_lang_String.h" -#include "nat/java_lang_Throwable.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" +#include "vm/jit/jit.h" /* system exception classes required in cacao */ diff --git a/src/vm/exceptions.h b/src/vm/exceptions.h index ce7eaa1e6..10f75ad93 100644 --- a/src/vm/exceptions.h +++ b/src/vm/exceptions.h @@ -1,4 +1,4 @@ -/* exceptions.h - exception related functions prototypes +/* vm/exceptions.h - exception related functions prototypes Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: exceptions.h 1578 2004-11-24 13:31:00Z twisti $ + $Id: exceptions.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -36,8 +36,8 @@ #include "global.h" -#include "nat/java_lang_String.h" -#include "nat/java_lang_Throwable.h" +#include "native/include/java_lang_String.h" +#include "native/include/java_lang_Throwable.h" /* system exception classes required in cacao */ diff --git a/src/vm/global.h b/src/vm/global.h index 5679647df..2b3b55a2a 100644 --- a/src/vm/global.h +++ b/src/vm/global.h @@ -31,7 +31,7 @@ Philipp Tomsich Edwin Steiner - $Id: global.h 1510 2004-11-17 11:33:44Z twisti $ + $Id: global.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -39,10 +39,40 @@ #ifndef _GLOBAL_H #define _GLOBAL_H - #include "config.h" #include "types.h" + + +/* resolve typedef cycles *****************************************************/ + +typedef struct utf utf; +typedef struct literalstring literalstring; +typedef struct java_objectheader java_objectheader; +typedef struct classinfo classinfo; +typedef struct _vftbl vftbl_t; +typedef u1* methodptr; +typedef struct fieldinfo fieldinfo; +typedef struct exceptiontable exceptiontable; +typedef struct methodinfo methodinfo; +typedef struct lineinfo lineinfo; +typedef struct arraydescriptor arraydescriptor; + + +/* additional data types ******************************************************/ + +typedef void *voidptr; /* generic pointer */ +typedef void (*functionptr) (); /* generic function pointer */ + +typedef int bool; /* boolean data type */ + +#define true 1 +#define false 0 + + +/* additional includes ********************************************************/ + #include "toolbox/list.h" +#include "vm/jit/inline/sets.h" #if defined(USE_THREADS) && defined(NATIVE_THREADS) @@ -93,17 +123,6 @@ #endif -/* additional data types ******************************************************/ - -typedef void *voidptr; /* generic pointer */ -typedef void (*functionptr) (); /* generic function pointer */ - -typedef int bool; /* boolean data type */ - -#define true 1 -#define false 0 - - /* immediate data union */ typedef union { @@ -180,21 +199,7 @@ typedef union { #define ACC_NATIVE 0x0100 #define ACC_INTERFACE 0x0200 #define ACC_ABSTRACT 0x0400 -#define ACC_STRICT 0x0800 - -/* resolve typedef cycles *****************************************************/ - -typedef struct utf utf; -typedef struct literalstring literalstring; -typedef struct java_objectheader java_objectheader; -typedef struct classinfo classinfo; -typedef struct _vftbl vftbl_t; -typedef u1* methodptr; -typedef struct fieldinfo fieldinfo; -typedef struct exceptiontable exceptiontable; -typedef struct methodinfo methodinfo; -typedef struct lineinfo lineinfo; -typedef struct arraydescriptor arraydescriptor; +#define ACC_STRICT 0x0800 /* constant pool entries ******************************************************* @@ -490,7 +495,6 @@ typedef struct primitivetypeinfo { /* field, method and class structures *****************************************/ -#include "jit/sets.h" typedef struct xtafldinfo { bool fieldChecked; classinfo *fldClassType; diff --git a/src/vm/jit/Makefile.am b/src/vm/jit/Makefile.am index 377429c73..49b00bdd0 100644 --- a/src/vm/jit/Makefile.am +++ b/src/vm/jit/Makefile.am @@ -1,39 +1,24 @@ ## Process this file with automake to produce Makefile.in -# $Id: Makefile.am 1251 2004-06-30 20:24:06Z twisti $ +# $Id: Makefile.am 1621 2004-11-30 13:06:55Z twisti $ +INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/@ARCH_DIR@ -SUBDIRS = . loop @ARCH_DIR@ -DIST_SUBDIRS = loop alpha i386 mips powerpc x86_64 +SUBDIRS = inline loop verify tools @ARCH_DIR@ -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/jit/@ARCH_DIR@ +DIST_SUBDIRS = inline loop verify tools alpha i386 mips powerpc x86_64 -EXTRA_DIST = \ +noinst_LIBRARIES = libjit.a + +libjit_a_SOURCES = \ jit.c \ - jit.h \ - codegen.inc \ parse.c \ - reg.inc \ - stack.c \ - inline.c \ - sets.c \ - sets.h \ - parseRT.c \ - parseRTprint.h \ - parseRTstats.c \ - typecheck.c - -noinst_HEADERS = \ - parse.h \ - stack.h \ - reg.h \ - inline.h \ - parseRT.h \ - parseRTstats.h - -noinst_LIBRARIES = libjit.a + stack.c -libjit_a_SOURCES = jit.c parse.c stack.c inline.c sets.c parseRT.c parseRTstats.c typecheck.c +libjit_a_LIBADD = \ + inline/libinline.a \ + loop/libloop.a \ + verify/libverify.a ## Local variables: diff --git a/src/vm/jit/asmpart.h b/src/vm/jit/asmpart.h index 0ce6e85e7..dac76f6d8 100644 --- a/src/vm/jit/asmpart.h +++ b/src/vm/jit/asmpart.h @@ -1,4 +1,4 @@ -/* asmpart.h - prototypes for machine specfic functions +/* vm/jit/asmpart.h - prototypes for machine specfic functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -29,7 +29,7 @@ Changes: Christian Thalinger - $Id: asmpart.h 1296 2004-07-10 17:02:15Z stefan $ + $Id: asmpart.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -37,9 +37,17 @@ #ifndef _ASMPART_H #define _ASMPART_H -#include "global.h" -#include "jni.h" -#include "threads/thread.h" +#include "native/jni.h" +#include "vm/global.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif +#endif + /* determines if the byte support instruction set (21164a and higher) diff --git a/src/vm/jit/codegen.inc b/src/vm/jit/codegen.inc index dd4943360..254c16246 100644 --- a/src/vm/jit/codegen.inc +++ b/src/vm/jit/codegen.inc @@ -1,4 +1,4 @@ -/* jit/codegen.inc - architecture independent code generator +/* vm/jit/codegen.inc - architecture independent code generator Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Institut f. Computersprachen, TU Wien @@ -48,26 +48,37 @@ memory. All functions writing values into the data area return the offset relative the begin of the code area (start of procedure). - $Id: codegen.inc 1565 2004-11-23 15:56:37Z twisti $ + $Id: codegen.inc 1621 2004-11-30 13:06:55Z twisti $ */ #include -#include "exceptions.h" -#include "native.h" -#include "options.h" -#include "statistics.h" -#include "jit/codegen.inc.h" -#include "toolbox/memory.h" -#include "toolbox/logging.h" + +#if !defined(STATIC_CLASSPATH) +# include +#endif + +#include "mm/memory.h" #include "toolbox/avl.h" -#include "threads/thread.h" -#ifndef STATIC_CLASSPATH -#include +#include "toolbox/logging.h" +#include "native/native.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif #endif -/* in this tree we store all method addresses */ +#include "vm/exceptions.h" +#include "vm/options.h" +#include "vm/statistics.h" +#include "vm/jit/codegen.inc.h" + + +/* in this tree we store all method addresses *********************************/ #if defined(__I386__) || defined(__X86_64__) static struct avl_table *methodtree = NULL; diff --git a/src/vm/jit/codegen.inc.h b/src/vm/jit/codegen.inc.h index fdb5400bb..0728522e5 100644 --- a/src/vm/jit/codegen.inc.h +++ b/src/vm/jit/codegen.inc.h @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: codegen.inc.h 1605 2004-11-29 10:06:02Z twisti $ + $Id: codegen.inc.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -47,9 +47,9 @@ typedef struct threadcritnodetemp threadcritnodetemp; #include "types.h" -#include "global.h" -#include "jit/inline.h" -#include "jit/reg.h" +#include "vm/global.h" +#include "vm/jit/reg.h" +#include "vm/jit/inline/inline.h" #define MCODEINITSIZE (1<<15) /* 32 Kbyte code area initialization size */ diff --git a/src/vm/jit/inline/inline.c b/src/vm/jit/inline/inline.c index 5b117003b..a09e3c514 100644 --- a/src/vm/jit/inline/inline.c +++ b/src/vm/jit/inline/inline.c @@ -28,23 +28,25 @@ globals moved to structure and passed as parameter Authors: Dieter Thuernbeck - $Id: inline.c 1557 2004-11-22 12:01:16Z carolyn $ + $Id: inline.c 1621 2004-11-30 13:06:55Z twisti $ */ #include #include -#include "global.h" -#include "loader.h" -#include "tables.h" -#include "options.h" -#include "jit/inline.h" -#include "jit/jit.h" -#include "jit/parse.h" + +#include "mm/memory.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "sets.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/options.h" +#include "vm/jit/jit.h" +#include "vm/jit/parse.h" +#include "vm/jit/inline/inline.h" +#include "vm/jit/inline/sets.h" + #define INVIRTDEBUG #undef INVIRTDEBUG diff --git a/src/vm/jit/inline/inline.h b/src/vm/jit/inline/inline.h index 7efa06966..11bf2f5c9 100644 --- a/src/vm/jit/inline/inline.h +++ b/src/vm/jit/inline/inline.h @@ -26,7 +26,7 @@ Authors: Dieter Thuernbeck - $Id: inline.h 1557 2004-11-22 12:01:16Z carolyn $ + $Id: inline.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,8 +34,14 @@ #ifndef _INLINE_H #define _INLINE_H -#include "global.h" +/* resolve typedef cycles *****************************************************/ + +typedef struct t_inlining_globals t_inlining_globals; + + #include "toolbox/list.h" +#include "vm/global.h" + #define INLINING_MAXDEPTH 2 /*1*/ #define INLINING_MAXCODESIZE 128 /*32*/ @@ -99,21 +105,22 @@ typedef struct { } t_inlining_stacknode; -typedef struct t_inlining_globals { /* try in parse.h with struct not include */ - bool isinlinedmethod; - int cumjcodelength; /* cumulative immediate intruction length */ - int cummaxstack; - int cumextablelength; - int cumlocals; /* was static */ - int cummethods; /* was static */ - list *inlining_stack; /* was static */ - inlining_methodinfo *inlining_rootinfo; - methodinfo *method; - classinfo *class; - int jcodelength; - u1 *jcode; + +struct t_inlining_globals { /* try in parse.h with struct not include */ + bool isinlinedmethod; + int cumjcodelength; /* cumulative immediate intruction length */ + int cummaxstack; + int cumextablelength; + int cumlocals; /* was static */ + int cummethods; /* was static */ + list *inlining_stack; /* was static */ + inlining_methodinfo *inlining_rootinfo; + methodinfo *method; + classinfo *class; + int jcodelength; + u1 *jcode; bool isleafmethod; -} t_inlining_globals; +}; /* function prototypes*/ diff --git a/src/vm/jit/inline/parseRT.c b/src/vm/jit/inline/parseRT.c index 5011dbff9..861d45dfc 100644 --- a/src/vm/jit/inline/parseRT.c +++ b/src/vm/jit/inline/parseRT.c @@ -26,7 +26,7 @@ Authors: Carolyn Oates - $Id: parseRT.c 1557 2004-11-22 12:01:16Z carolyn $ + $Id: parseRT.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -60,18 +60,19 @@ Results: (currently) with -stat see # methods marked used #include #include -#include "tables.h" - -#include "statistics.h" -#include "loader.h" -#include "main.h" -#include "options.h" -#include "jit/jit.h" -#include "jit/parse.h" + +#include "cacao/cacao.h" +#include "mm/memory.h" #include "toolbox/list.h" -#include "toolbox/memory.h" -#include "parseRT.h" -#include "parseRTstats.h" +#include "vm/tables.h" +#include "vm/statistics.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/jit/jit.h" +#include "vm/jit/parse.h" +#include "vm/jit/inline/parseRT.h" +#include "vm/jit/inline/parseRTstats.h" + static bool firstCall= true; static list *rtaWorkList; diff --git a/src/vm/jit/inline/parseRT.h b/src/vm/jit/inline/parseRT.h index 4674ba146..2a1b07131 100644 --- a/src/vm/jit/inline/parseRT.h +++ b/src/vm/jit/inline/parseRT.h @@ -26,14 +26,15 @@ Authors: Carolyn Oates - $Id: parseRT.h 1557 2004-11-22 12:01:16Z carolyn $ + $Id: parseRT.h 1621 2004-11-30 13:06:55Z twisti $ */ #ifndef _PARSERT_H #define _PARSERT_H -#include "global.h" +#include "vm/global.h" + extern FILE *rtMissed; /* Methods missed during RTA parse of Main */ diff --git a/src/vm/jit/inline/parseRTstats.c b/src/vm/jit/inline/parseRTstats.c index 225c1cd3f..4bd4919c8 100644 --- a/src/vm/jit/inline/parseRTstats.c +++ b/src/vm/jit/inline/parseRTstats.c @@ -1,4 +1,4 @@ -/* jit/parseRTstats.c - +/* vm/jit/inline/parseRTstats.c - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,17 +26,20 @@ Authors: Carolyn Oates - $Id: parseRTstats.c 1553 2004-11-19 15:47:13Z carolyn $ + $Id: parseRTstats.c 1621 2004-11-30 13:06:55Z twisti $ */ + #include + #include "toolbox/list.h" -#include "options.h" -#include "tables.h" -#include "statistics.h" -#include "loader.h" -#include "parseRT.h" -#include "parseRTstats.h" +#include "vm/options.h" +#include "vm/tables.h" +#include "vm/statistics.h" +#include "vm/loader.h" +#include "vm/jit/inline/parseRT.h" +#include "vm/jit/inline/parseRTstats.h" + int pClassHeirStatsOnly = 2; int pClassHeir = 2; diff --git a/src/vm/jit/inline/sets.c b/src/vm/jit/inline/sets.c index 6f1f111c4..3824aa3a1 100644 --- a/src/vm/jit/inline/sets.c +++ b/src/vm/jit/inline/sets.c @@ -1,4 +1,4 @@ -/* jit/sets.c - +/* vm/jit/inline/sets.c - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Institut f. Computersprachen, TU Wien @@ -27,18 +27,19 @@ Authors: Carolyn Oates - $Id: sets.c 1296 2004-07-10 17:02:15Z stefan $ + $Id: sets.c 1621 2004-11-30 13:06:55Z twisti $ */ #include -#include "sets.h" + #include "types.h" -#include "global.h" -#include "loader.h" -#include "tables.h" -#include "toolbox/memory.h" +#include "mm/memory.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/jit/inline/sets.h" /* diff --git a/src/vm/jit/inline/sets.h b/src/vm/jit/inline/sets.h index 2ae2e15c4..35b7aa519 100644 --- a/src/vm/jit/inline/sets.h +++ b/src/vm/jit/inline/sets.h @@ -27,7 +27,7 @@ Authors: Carolyn Oates - $Id: sets.h 665 2003-11-21 18:36:43Z jowenn $ + $Id: sets.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -35,8 +35,6 @@ #ifndef _SET_H #define _SET_H -#include "types.h" - typedef struct methSet methSet; typedef struct methSetNode methSetNode; typedef struct fldSet fldSet; @@ -45,7 +43,8 @@ typedef struct classSet classSet; typedef struct classSetNode classSetNode; -#include "global.h" +#include "types.h" +#include "vm/global.h" /*------------ Method /Class Used Markers -------------------------------*/ diff --git a/src/vm/jit/jit.c b/src/vm/jit/jit.c index 5cf779bed..406b7246a 100644 --- a/src/vm/jit/jit.c +++ b/src/vm/jit/jit.c @@ -1,4 +1,4 @@ -/* jit/jit.c - calls the code generation functions +/* vm/jit/jit.c - calls the code generation functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -29,41 +29,44 @@ Changes: Edwin Steiner - $Id: jit.c 1590 2004-11-25 13:24:49Z christian $ + $Id: jit.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include -#include -#include "global.h" -#include "tables.h" -#include "loader.h" -#include "builtin.h" -#include "native.h" -#include "asmpart.h" #include "codegen.h" -#include "types.h" -#include "options.h" -#include "statistics.h" -#include "jit/codegen.inc.h" -#include "jit/inline.h" -#include "jit/jit.h" -#include "jit/parseRT.h" -#include "jit/parse.h" -#include "jit/stack.h" -#include "jit/reg.h" -#include "jit/typecheck.h" -#include "threads/thread.h" #include "disass.h" -#include "loop/loop.h" -#include "loop/graph.h" -#include "loop/analyze.h" -#include "toolbox/logging.h" -#include "toolbox/memory.h" #include "types.h" -#include -#include "jit/lsra.h" +#include "mm/memory.h" +#include "toolbox/logging.h" +#include "vm/builtin.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/statistics.h" +#include "vm/tables.h" +#include "vm/jit/codegen.inc.h" +#include "vm/jit/jit.h" +#include "vm/jit/lsra.h" +#include "vm/jit/parse.h" +#include "vm/jit/reg.h" +#include "vm/jit/stack.h" +#include "vm/jit/inline/inline.h" +#include "vm/jit/inline/parseRT.h" +#include "vm/jit/loop/analyze.h" +#include "vm/jit/loop/graph.h" +#include "vm/jit/loop/loop.h" +#include "vm/jit/verify/typecheck.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif +#endif + + /* global switches ************************************************************/ diff --git a/src/vm/jit/jit.h b/src/vm/jit/jit.h index 142b3a2df..92c5f740b 100644 --- a/src/vm/jit/jit.h +++ b/src/vm/jit/jit.h @@ -29,7 +29,7 @@ Changes: Christian Thalinger - $Id: jit.h 1593 2004-11-25 15:14:48Z twisti $ + $Id: jit.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -37,8 +37,7 @@ #ifndef _JIT_H #define _JIT_H -/* We typedef these structures before #includes to resolve circular */ -/* dependencies. */ +/* resolve typedef cycles *****************************************************/ typedef struct stackelement stackelement; typedef stackelement *stackptr; @@ -47,11 +46,11 @@ typedef struct instruction instruction; typedef struct subroutineinfo subroutineinfo; -#include "global.h" -#include "builtin.h" -#include "typeinfo.h" -#include "jit/codegen.inc.h" #include "toolbox/chain.h" +#include "vm/global.h" +#include "vm/builtin.h" +#include "vm/jit/codegen.inc.h" +#include "vm/jit/verify/typeinfo.h" /**************************** resolve typedef-cycles **************************/ diff --git a/src/vm/jit/loop/Makefile.am b/src/vm/jit/loop/Makefile.am index 13588bf71..29ab8c4b8 100644 --- a/src/vm/jit/loop/Makefile.am +++ b/src/vm/jit/loop/Makefile.am @@ -1,25 +1,17 @@ ## Process this file with automake to produce Makefile.in -# $Id: Makefile.am 1141 2004-06-05 23:19:24Z twisti $ +# $Id: Makefile.am 1621 2004-11-30 13:06:55Z twisti $ -INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/jit/@ARCH_DIR@ +INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/@ARCH_DIR@ -EXTRA_DIST = \ +noinst_LIBRARIES = libloop.a + +libloop_a_SOURCES = \ + analyze.c \ graph.c \ loop.c \ - loop.h \ - analyze.c \ tracing.c -noinst_HEADERS = \ - graph.h \ - analyze.h \ - tracing.h - -noinst_LIBRARIES = libloop.a - -libloop_a_SOURCES = loop.c analyze.c graph.c tracing.c - ## Local variables: ## mode: Makefile diff --git a/src/vm/jit/loop/analyze.c b/src/vm/jit/loop/analyze.c index 64daa2819..fafc95c5f 100644 --- a/src/vm/jit/loop/analyze.c +++ b/src/vm/jit/loop/analyze.c @@ -1,4 +1,4 @@ -/* jit/loop/analyze.c - bound check removal functions +/* vm/jit/loop/analyze.c - bound check removal functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -32,7 +32,7 @@ bounds are never violated. The function to call is optimize_loops(). - $Id: analyze.c 1531 2004-11-17 20:45:56Z christian $ + $Id: analyze.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -40,13 +40,14 @@ #include #include #include -#include "jit/loop/analyze.h" -#include "jit/jit.h" -#include "jit/loop/loop.h" -#include "jit/loop/graph.h" -#include "jit/loop/tracing.h" + +#include "mm/memory.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" +#include "vm/jit/jit.h" +#include "vm/jit/loop/analyze.h" +#include "vm/jit/loop/graph.h" +#include "vm/jit/loop/loop.h" +#include "vm/jit/loop/tracing.h" #ifdef LOOP_DEBUG diff --git a/src/vm/jit/loop/analyze.h b/src/vm/jit/loop/analyze.h index 75bc98eb4..9a38775e1 100644 --- a/src/vm/jit/loop/analyze.h +++ b/src/vm/jit/loop/analyze.h @@ -1,4 +1,4 @@ -/* jit/loop/analyze.h - bound check removal header +/* vm/jit/loop/analyze.h - bound check removal header Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: analyze.h 1531 2004-11-17 20:45:56Z christian $ + $Id: analyze.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,8 +34,8 @@ #ifndef _ANALYZE_H #define _ANALYZE_H -#include "global.h" -#include "jit/loop/loop.h" +#include "vm/global.h" +#include "vm/jit/loop/loop.h" void optimize_loops(methodinfo *m, codegendata *cd, loopdata *ld); diff --git a/src/vm/jit/loop/graph.c b/src/vm/jit/loop/graph.c index 924334dc1..3bb8fd53f 100644 --- a/src/vm/jit/loop/graph.c +++ b/src/vm/jit/loop/graph.c @@ -1,4 +1,4 @@ -/* jit/loop/graph.c - control flow graph +/* vm/jit/loop/graph.c - control flow graph Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -31,16 +31,15 @@ Contains the functions which build a list, that represents the control flow graph of the procedure, that is being analyzed. - $Id: graph.c 1531 2004-11-17 20:45:56Z christian $ + $Id: graph.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include -#include "jit/jit.h" -#include "jit/loop/graph.h" -#include "jit/loop/loop.h" -#include "toolbox/memory.h" +#include "mm/memory.h" +#include "vm/jit/jit.h" +#include "vm/jit/loop/graph.h" +#include "vm/jit/loop/loop.h" void LoopContainerInit(methodinfo *m, struct LoopContainer *lc, int i) diff --git a/src/vm/jit/loop/loop.c b/src/vm/jit/loop/loop.c index c6bf4507f..1d37f5d9b 100644 --- a/src/vm/jit/loop/loop.c +++ b/src/vm/jit/loop/loop.c @@ -1,4 +1,4 @@ -/* jit/loop/loop.c - array bound removal +/* vm/jit/loop/loop.c - array bound removal Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -30,21 +30,21 @@ algorithm that uses dominator trees (found eg. in modern compiler implementation by a.w. appel) - $Id: loop.c 1454 2004-11-05 14:19:32Z twisti $ + $Id: loop.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include -#include -#include "global.h" -#include "jit/jit.h" -#include "jit/loop/loop.h" -#include "jit/loop/graph.h" -#include "jit/loop/tracing.h" -#include "toolbox/logging.h" -#include "toolbox/memory.h" +/* #include */ +/* #include */ +#include "mm/memory.h" +#include "toolbox/logging.h" +#include "vm/global.h" +#include "vm/jit/jit.h" +#include "vm/jit/loop/loop.h" +#include "vm/jit/loop/graph.h" +#include "vm/jit/loop/tracing.h" /* diff --git a/src/vm/jit/loop/loop.h b/src/vm/jit/loop/loop.h index b86868b36..eb1d45ab0 100644 --- a/src/vm/jit/loop/loop.h +++ b/src/vm/jit/loop/loop.h @@ -1,4 +1,4 @@ -/* jit/loop/loop.h - array bound removal header +/* vm/jit/loop/loop.h - array bound removal header Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: Christopher Kruegel - $Id: loop.h 1454 2004-11-05 14:19:32Z twisti $ + $Id: loop.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,8 +34,8 @@ #ifndef _LOOP_H #define _LOOP_H -#include "global.h" -#include "jit/jit.h" +#include "vm/global.h" +#include "vm/jit/jit.h" /* Different types for struct Trace */ diff --git a/src/vm/jit/loop/tracing.c b/src/vm/jit/loop/tracing.c index e8c69136a..a0a647d13 100644 --- a/src/vm/jit/loop/tracing.c +++ b/src/vm/jit/loop/tracing.c @@ -1,4 +1,4 @@ -/* jit/loop/tracing.c - trace functions +/* vm/jit/loop/tracing.c - trace functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -31,15 +31,16 @@ instruction. For more details see function tracing(basicblock, int, int) below. - $Id: tracing.c 1454 2004-11-05 14:19:32Z twisti $ + $Id: tracing.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include -#include "jit/loop/tracing.h" -#include "jit/loop/loop.h" -#include "toolbox/memory.h" +/* #include */ + +#include "mm/memory.h" +#include "vm/jit/loop/loop.h" +#include "vm/jit/loop/tracing.h" /* Test function -> will be removed in final release diff --git a/src/vm/jit/loop/tracing.h b/src/vm/jit/loop/tracing.h index fee73f4ba..0679daddb 100644 --- a/src/vm/jit/loop/tracing.h +++ b/src/vm/jit/loop/tracing.h @@ -1,4 +1,4 @@ -/* jit/loop/tracing.h - trace functions header +/* vm/jit/loop/tracing.h - trace functions header Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: tracing.h 1454 2004-11-05 14:19:32Z twisti $ + $Id: tracing.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,8 +34,7 @@ #ifndef _TRACING_H #define _TRACING_H - -#include "jit/jit.h" +#include "vm/jit/jit.h" typedef struct Trace Trace; @@ -58,7 +57,7 @@ struct Trace { }; -/* function protoypes */ +/* function protoypes *********************************************************/ Trace* create_trace(int type, int var, int constant, int nr); Trace* add(Trace* a, Trace* b); diff --git a/src/vm/jit/lsra.inc b/src/vm/jit/lsra.inc index ba756aa7a..65c7a6644 100644 --- a/src/vm/jit/lsra.inc +++ b/src/vm/jit/lsra.inc @@ -1,4 +1,4 @@ -/* jit/lsra.inc - linear scan register allocator +/* vm/jit/lsra.inc - linear scan register allocator Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Institut f. Computersprachen, TU Wien @@ -27,7 +27,7 @@ Authors: Christian Ullrich - $Id: lsra.inc 1597 2004-11-28 16:37:23Z christian $ + $Id: lsra.inc 1621 2004-11-30 13:06:55Z twisti $ */ @@ -37,20 +37,20 @@ /* #define LSRA_PRINTLIFETIMES */ +#include +#include + #ifdef LSRA_DEBUG #define LSRA_PRINTLIFETIMES #endif -#include "lsra.h" -#include "loop/graph.h" -#include "loop/loop.h" -#include "toolbox/memory.h" -#include "reg.h" -#include "options.h" -#include "string.h" +#include "mm/memory.h" +#include "vm/options.h" +#include "vm/jit/lsra.h" +#include "vm/jit/reg.h" +#include "vm/jit/loop/graph.h" +#include "vm/jit/loop/loop.h" -#include -#include void lsra(methodinfo *m, codegendata *cd, registerdata *rd, loopdata *ld, t_inlining_globals *id) { diff --git a/src/vm/jit/parse.c b/src/vm/jit/parse.c index fe47de4cb..f10214592 100644 --- a/src/vm/jit/parse.c +++ b/src/vm/jit/parse.c @@ -1,4 +1,4 @@ -/* jit/parse.c - parser for JavaVM to intermediate code translation +/* vm/jit/parse.c - parser for JavaVM to intermediate code translation Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -29,7 +29,7 @@ Changes: Carolyn Oates Edwin Steiner - $Id: parse.c 1588 2004-11-24 14:30:21Z twisti $ + $Id: parse.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -37,22 +37,23 @@ #include #include "config.h" -#include "parse.h" -#include "global.h" -#include "jit.h" -#include "parseRT.h" -#include "inline.h" -#include "loop/loop.h" #include "types.h" -#include "builtin.h" -#include "exceptions.h" -#include "tables.h" -#include "native.h" -#include "loader.h" -#include "options.h" -#include "statistics.h" -#include "toolbox/memory.h" +#include "mm/memory.h" +#include "native/native.h" #include "toolbox/logging.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/statistics.h" +#include "vm/tables.h" +#include "vm/jit/jit.h" +#include "vm/jit/parse.h" +#include "vm/jit/inline/parseRT.h" +#include "vm/jit/inline/inline.h" +#include "vm/jit/loop/loop.h" + #define METHINFO(mm) \ { \ diff --git a/src/vm/jit/parse.h b/src/vm/jit/parse.h index 76cef308f..bcce152cd 100644 --- a/src/vm/jit/parse.h +++ b/src/vm/jit/parse.h @@ -26,7 +26,7 @@ Author: Christian Thalinger - $Id: parse.h 1510 2004-11-17 11:33:44Z twisti $ + $Id: parse.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,9 +34,9 @@ #ifndef _PARSE_H #define _PARSE_H -#include "global.h" -#include "jit/inline.h" -#include "jit/codegen.inc.h" +#include "vm/global.h" +#include "vm/jit/codegen.inc.h" +#include "vm/jit/inline/inline.h" /* intermediate code generating macros */ diff --git a/src/vm/jit/reg.h b/src/vm/jit/reg.h index 1e0cd4e1f..a61971dc7 100644 --- a/src/vm/jit/reg.h +++ b/src/vm/jit/reg.h @@ -27,7 +27,7 @@ Authors: Christian Thalinger - $Id: reg.h 1494 2004-11-12 13:34:26Z twisti $ + $Id: reg.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -36,8 +36,9 @@ #define _REG_H #include "types.h" -#include "jit/codegen.inc.h" -#include "jit/jit.h" +#include "vm/jit/codegen.inc.h" +#include "vm/jit/jit.h" +#include "vm/jit/inline/inline.h" /************************* pseudo variable structure **************************/ diff --git a/src/vm/jit/reg.inc b/src/vm/jit/reg.inc index a05f2e315..b189c6163 100644 --- a/src/vm/jit/reg.inc +++ b/src/vm/jit/reg.inc @@ -1,4 +1,4 @@ -/* jit/reg.inc - register allocator +/* vm/jit/reg.inc - register allocator Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Institut f. Computersprachen, TU Wien @@ -30,13 +30,13 @@ Changes: Stefan Ring Christian Thalinger - $Id: reg.inc 1506 2004-11-14 14:48:49Z jowenn $ + $Id: reg.inc 1621 2004-11-30 13:06:55Z twisti $ */ -#include "jit/reg.h" -#include "toolbox/memory.h" +#include "mm/memory.h" +#include "vm/jit/reg.h" /* function prototypes for this file */ diff --git a/src/vm/jit/stack.c b/src/vm/jit/stack.c index 3c1f6068a..fb4555c7a 100644 --- a/src/vm/jit/stack.c +++ b/src/vm/jit/stack.c @@ -1,4 +1,4 @@ -/* jit/stack.c - stack analysis +/* vm/jit/stack.c - stack analysis Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,27 +28,28 @@ Changes: Edwin Steiner - $Id: stack.c 1594 2004-11-25 15:15:15Z twisti $ + $Id: stack.c 1621 2004-11-30 13:06:55Z twisti $ */ #include #include -#include "global.h" -#include "native.h" -#include "builtin.h" + #include "disass.h" -#include "tables.h" #include "types.h" -#include "options.h" -#include "statistics.h" -#include "jit/codegen.inc.h" -#include "jit/jit.h" -#include "jit/stack.h" -#include "jit/reg.h" +#include "mm/memory.h" +#include "native/native.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" +#include "vm/global.h" +#include "vm/builtin.h" +#include "vm/options.h" +#include "vm/statistics.h" +#include "vm/tables.h" +#include "vm/jit/codegen.inc.h" +#include "vm/jit/jit.h" +#include "vm/jit/reg.h" +#include "vm/jit/stack.h" /**********************************************************************/ diff --git a/src/vm/jit/stack.h b/src/vm/jit/stack.h index 4bcb89681..49aee25e1 100644 --- a/src/vm/jit/stack.h +++ b/src/vm/jit/stack.h @@ -1,4 +1,4 @@ -/* jit/stack.h - stack analysis header +/* vm/jit/stack.h - stack analysis header Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: stack.h 1456 2004-11-05 14:33:14Z twisti $ + $Id: stack.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,9 +34,9 @@ #ifndef _STACK_H #define _STACK_H -#include "exceptions.h" -#include "global.h" -#include "jit/reg.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/jit/reg.h" /**********************************************************************/ diff --git a/src/vm/jit/tools/genoffsets.c b/src/vm/jit/tools/genoffsets.c index 7a0ffcadb..ff81425db 100644 --- a/src/vm/jit/tools/genoffsets.c +++ b/src/vm/jit/tools/genoffsets.c @@ -1,4 +1,4 @@ -/* genoffsets.c - generate asmpart offsets of structures +/* vm/jit/tools/genoffsets.c - generate asmpart offsets of structures Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -28,17 +28,25 @@ Changes: - $Id: genoffsets.c 1296 2004-07-10 17:02:15Z stefan $ + $Id: genoffsets.c 1621 2004-11-30 13:06:55Z twisti $ */ #include + #include "config.h" #include "types.h" -#include "global.h" -#include "threads/thread.h" -#include "toolbox/memory.h" +#include "mm/memory.h" +#include "vm/global.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# endif +#endif int main(int argc, char **argv) diff --git a/src/vm/jit/verify/typecheck.c b/src/vm/jit/verify/typecheck.c index 4c69685ec..95e81de0b 100644 --- a/src/vm/jit/verify/typecheck.c +++ b/src/vm/jit/verify/typecheck.c @@ -1,4 +1,4 @@ -/* jit/typecheck.c - typechecking (part of bytecode verification) +/* vm/jit/verify/typecheck.c - typechecking (part of bytecode verification) Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,26 +26,28 @@ Authors: Edwin Steiner - $Id: typecheck.c 1550 2004-11-19 14:26:31Z twisti $ + $Id: typecheck.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include "global.h" /* must be here because of CACAO_TYPECHECK */ +#include + +#include "vm/global.h" /* must be here because of CACAO_TYPECHECK */ #ifdef CACAO_TYPECHECK -#include -#include "main.h" -#include "builtin.h" -#include "tables.h" -#include "loader.h" -#include "native.h" #include "types.h" -#include "jit/jit.h" -#include "jit/stack.h" +/* #include "main.h" */ +#include "mm/memory.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "options.h" +#include "native/native.h" +#include "vm/builtin.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/tables.h" +#include "vm/jit/jit.h" +#include "vm/jit/stack.h" + /****************************************************************************/ /* DEBUG HELPERS */ diff --git a/src/vm/jit/verify/typecheck.h b/src/vm/jit/verify/typecheck.h index cb448635c..155e33da8 100644 --- a/src/vm/jit/verify/typecheck.h +++ b/src/vm/jit/verify/typecheck.h @@ -1,4 +1,4 @@ -/* jit/typecheck.h - type checking header +/* vm/jit/verify/typecheck.h - type checking header Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: typecheck.h 1456 2004-11-05 14:33:14Z twisti $ + $Id: typecheck.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,10 +34,10 @@ #ifndef _TYPECHECK_H #define _TYPECHECK_H -#include "jit/codegen.inc.h" +#include "vm/jit/codegen.inc.h" -/* function prototypes */ +/* function prototypes ********************************************************/ methodinfo *typecheck(methodinfo *m, codegendata *cd, registerdata *rd); diff --git a/src/vm/jit/verify/typeinfo.c b/src/vm/jit/verify/typeinfo.c index 258ca1cd5..f678467a2 100644 --- a/src/vm/jit/verify/typeinfo.c +++ b/src/vm/jit/verify/typeinfo.c @@ -1,4 +1,4 @@ -/* typeinfo.c - type system used by the type checker +/* vm/jit/verify/typeinfo.c - type system used by the type checker Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -26,19 +26,19 @@ Authors: Edwin Steiner - $Id: typeinfo.c 1296 2004-07-10 17:02:15Z stefan $ + $Id: typeinfo.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include #include -#include "typeinfo.h" -#include "tables.h" -#include "loader.h" + +#include "mm/memory.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" -#include "jit/jit.h" /* XXX move typeinfo.* into jit/ */ +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/jit/jit.h" +#include "vm/jit/verify/typeinfo.h" #define CLASS_IMPLEMENTS_INTERFACE(cls,index) \ diff --git a/src/vm/jit/verify/typeinfo.h b/src/vm/jit/verify/typeinfo.h index 302a7e4b5..8b95af711 100644 --- a/src/vm/jit/verify/typeinfo.h +++ b/src/vm/jit/verify/typeinfo.h @@ -26,7 +26,7 @@ Authors: Edwin Steiner - $Id: typeinfo.h 887 2004-01-19 12:14:39Z edwin $ + $Id: typeinfo.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,7 +34,7 @@ #ifndef _TYPEINFO_H #define _TYPEINFO_H -#include "global.h" +#include "vm/global.h" /* resolve typedef cycles *****************************************************/ diff --git a/src/vm/jit/x86_64/Makefile.am b/src/vm/jit/x86_64/Makefile.am index edb2b97ad..e50dbff65 100644 --- a/src/vm/jit/x86_64/Makefile.am +++ b/src/vm/jit/x86_64/Makefile.am @@ -1,9 +1,9 @@ ## Process this file with automake to produce Makefile.in -# $Id: Makefile.am 1284 2004-07-07 15:56:17Z twisti $ +# $Id: Makefile.am 1621 2004-11-30 13:06:55Z twisti $ -INCLUDES = -I$(top_srcdir) +INCLUDES = -I$(top_srcdir)/src EXTRA_DIST = \ asmpart.S \ @@ -32,9 +32,8 @@ libarch_a_SOURCES = \ asmpart.o: asmpart.S $(top_srcdir)/config.h offsets.h $(COMPILE) -c $< -offsets.h: $(top_srcdir)/config.h $(top_srcdir)/global.h $(top_srcdir)/threads/thread.h - $(COMPILE) -o $(top_srcdir)/genoffsets $(top_srcdir)/genoffsets.c - $(top_srcdir)/genoffsets > offsets.h +offsets.h: $(top_srcdir)/config.h $(top_srcdir)/src/vm/global.h $(top_srcdir)/src/threads/native/threads.h + $(top_srcdir)/src/vm/jit/tools/genoffsets > offsets.h ## Local variables: diff --git a/src/vm/jit/x86_64/asmpart.S b/src/vm/jit/x86_64/asmpart.S index 8effc38ec..cec1b9e43 100644 --- a/src/vm/jit/x86_64/asmpart.S +++ b/src/vm/jit/x86_64/asmpart.S @@ -1,4 +1,4 @@ -/* jit/x86_64/asmpart.S - Java-C interface functions for x86_64 +/* vm/jit/x86_64/asmpart.S - Java-C interface functions for x86_64 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Institut f. Computersprachen, TU Wien @@ -29,14 +29,14 @@ Reinhard Grafl Christian Thalinger - $Id: asmpart.S 1581 2004-11-24 13:57:02Z twisti $ + $Id: asmpart.S 1621 2004-11-30 13:06:55Z twisti $ */ #include "config.h" -#include "jit/x86_64/arch.h" -#include "jit/x86_64/offsets.h" +#include "vm/jit/x86_64/arch.h" +#include "vm/jit/x86_64/offsets.h" #define MethodPointer -8 diff --git a/src/vm/jit/x86_64/codegen.c b/src/vm/jit/x86_64/codegen.c index 3f4a9d220..36cf5371c 100644 --- a/src/vm/jit/x86_64/codegen.c +++ b/src/vm/jit/x86_64/codegen.c @@ -28,29 +28,30 @@ Authors: Andreas Krall Christian Thalinger - $Id: codegen.c 1607 2004-11-29 10:11:03Z twisti $ + $Id: codegen.c 1621 2004-11-30 13:06:55Z twisti $ */ + #define _GNU_SOURCE -#include "global.h" #include -#include -#include -#include "builtin.h" -#include "asmpart.h" -#include "jni.h" -#include "loader.h" -#include "tables.h" -#include "native.h" -#include "jit/jit.h" -#include "jit/reg.h" -#include "jit/parse.h" -#include "jit/x86_64/arch.h" -#include "jit/x86_64/codegen.h" -#include "jit/x86_64/emitfuncs.h" -#include "jit/x86_64/types.h" +#include + +#include "native/native.h" +/* #include "native/jni.h" */ +#include "vm/global.h" +#include "vm/builtin.h" +#include "vm/loader.h" +#include "vm/tables.h" +#include "vm/jit/asmpart.h" +#include "vm/jit/jit.h" +#include "vm/jit/reg.h" +#include "vm/jit/parse.h" +#include "vm/jit/x86_64/arch.h" +#include "vm/jit/x86_64/codegen.h" +#include "vm/jit/x86_64/emitfuncs.h" +#include "vm/jit/x86_64/types.h" /* register descripton - array ************************************************/ @@ -87,9 +88,9 @@ static int nregdescfloat[] = { *******************************************************************************/ -#include "jit/codegen.inc" -#include "jit/reg.inc" -#include "jit/lsra.inc" +#include "vm/jit/codegen.inc" +#include "vm/jit/reg.inc" +#include "vm/jit/lsra.inc" #if defined(USE_THREADS) && defined(NATIVE_THREADS) diff --git a/src/vm/jit/x86_64/codegen.h b/src/vm/jit/x86_64/codegen.h index 05c49cb7b..1bca63e0f 100644 --- a/src/vm/jit/x86_64/codegen.h +++ b/src/vm/jit/x86_64/codegen.h @@ -1,4 +1,4 @@ -/* jit/x86_64/codegen.h - code generation macros and definitions for x86_64 +/* vm/jit/x86_64/codegen.h - code generation macros and definitions for x86_64 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -27,7 +27,7 @@ Authors: Andreas Krall Christian Thalinger - $Id: codegen.h 1579 2004-11-24 13:56:06Z twisti $ + $Id: codegen.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -37,7 +37,7 @@ #include -#include "jit/jit.h" +#include "vm/jit/jit.h" /* macros to create code ******************************************************/ diff --git a/src/vm/jit/x86_64/emitfuncs.c b/src/vm/jit/x86_64/emitfuncs.c index e1943989a..e64db8be1 100644 --- a/src/vm/jit/x86_64/emitfuncs.c +++ b/src/vm/jit/x86_64/emitfuncs.c @@ -1,4 +1,4 @@ -/* jit/x86_64/emitfuncs.c - x86_64 code emitter functions +/* vm/jit/x86_64/emitfuncs.c - x86_64 code emitter functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Institut f. Computersprachen, TU Wien @@ -27,16 +27,15 @@ Authors: Christian Thalinger - $Id: emitfuncs.c 1526 2004-11-17 15:50:27Z twisti $ + $Id: emitfuncs.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include "jit/jit.h" -#include "jit/x86_64/arch.h" -#include "jit/x86_64/emitfuncs.h" -#include "jit/x86_64/codegen.h" -#include "jit/x86_64/types.h" +#include "vm/jit/jit.h" +#include "vm/jit/x86_64/codegen.h" +#include "vm/jit/x86_64/emitfuncs.h" +#include "vm/jit/x86_64/types.h" /* code generation functions */ diff --git a/src/vm/jit/x86_64/emitfuncs.h b/src/vm/jit/x86_64/emitfuncs.h index 1dc64cfac..94bd50480 100644 --- a/src/vm/jit/x86_64/emitfuncs.h +++ b/src/vm/jit/x86_64/emitfuncs.h @@ -27,7 +27,7 @@ Authors: Andreas Krall Christian Thalinger - $Id: emitfuncs.h 1451 2004-11-05 14:14:15Z twisti $ + $Id: emitfuncs.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -35,7 +35,7 @@ #ifndef _EMITFUNCS_H #define _EMITFUNCS_H -#include "jit/x86_64/types.h" +#include "vm/jit/x86_64/types.h" /* code generation prototypes */ diff --git a/src/vm/jit/x86_64/types.h b/src/vm/jit/x86_64/types.h index 5e9ad14d5..7763e56f1 100644 --- a/src/vm/jit/x86_64/types.h +++ b/src/vm/jit/x86_64/types.h @@ -26,7 +26,7 @@ Authors: Christian Thalinger - $Id: types.h 1580 2004-11-24 13:56:44Z twisti $ + $Id: types.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -34,7 +34,7 @@ #ifndef _CACAO_TYPES_H #define _CACAO_TYPES_H -#include "jit/x86_64/arch.h" +#include "vm/jit/x86_64/arch.h" /* define the sizes of the integer types used internally by cacao */ diff --git a/src/vm/loader.c b/src/vm/loader.c index dafe80ed9..b1af3f553 100644 --- a/src/vm/loader.c +++ b/src/vm/loader.c @@ -1,4 +1,4 @@ -/* loader.c - class loader functions +/* vm/loader.c - class loader functions Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -32,7 +32,7 @@ Edwin Steiner Christian Thalinger - $Id: loader.c 1553 2004-11-19 15:47:13Z carolyn $ + $Id: loader.c 1621 2004-11-30 13:06:55Z twisti $ */ @@ -41,26 +41,37 @@ #include #include #include -#include "exceptions.h" -#include "global.h" -#include "loader.h" -#include "options.h" -#include "native.h" -#include "tables.h" -#include "builtin.h" -#include "jit/jit.h" -#include "asmpart.h" -#include "statistics.h" -#include "toolbox/memory.h" + +#include "mm/memory.h" +#include "native/native.h" +#include "native/include/java_lang_Throwable.h" + +#if defined(USE_THREADS) +# if defined(NATIVE_THREADS) +# include "threads/native/threads.h" +# else +# include "threads/green/threads.h" +# include "threads/green/locks.h" +# endif +#endif + #include "toolbox/logging.h" -#include "threads/thread.h" -#include "threads/locks.h" -#include "nat/java_lang_Throwable.h" +#include "vm/exceptions.h" +#include "vm/builtin.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/statistics.h" +#include "vm/tables.h" -#ifdef USE_ZLIB -#include "unzip.h" +#if defined(USE_ZLIB) +#include "vm/unzip.h" #endif +#include "vm/jit/asmpart.h" +#include "vm/jit/jit.h" + + #undef JOWENN_DEBUG #undef JOWENN_DEBUG1 #undef JOWENN_DEBUG2 diff --git a/src/vm/options.h b/src/vm/options.h index 82cbec2af..9bea53485 100644 --- a/src/vm/options.h +++ b/src/vm/options.h @@ -1,4 +1,4 @@ -/* options.h - define global options extern +/* vm/options.h - define global options extern Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Institut f. Computersprachen, TU Wien @@ -27,7 +27,7 @@ Authors: Christian Thalinger - $Id: options.h 1590 2004-11-25 13:24:49Z christian $ + $Id: options.h 1621 2004-11-30 13:06:55Z twisti $ */ @@ -36,7 +36,7 @@ #define _OPTIONS_H -#include "global.h" +#include "vm/global.h" /* reserved option numbers ****************************************************/ @@ -83,7 +83,7 @@ extern bool showdisassemble; extern bool showddatasegment; extern bool showintermediate; -/*#undef INAFTERMAIN /*use to inline system methods before main is called*/ +/*#undef INAFTERMAIN*/ /*use to inline system methods before main is called*/ #define INAFTERMAIN T /*use to turn off inlining before main called */ extern bool useinliningm; extern bool useinlining; diff --git a/src/vm/tables.c b/src/vm/tables.c index 9cbd95e9a..9a6195210 100644 --- a/src/vm/tables.c +++ b/src/vm/tables.c @@ -1,4 +1,4 @@ -/* tables.c - +/* vm/tables.c - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser, @@ -35,31 +35,28 @@ - the heap - additional support functions - $Id: tables.c 1482 2004-11-11 14:39:13Z twisti $ + $Id: tables.c 1621 2004-11-30 13:06:55Z twisti $ */ -#include "global.h" - #include #include #include #include #include #include -#include "builtin.h" -#include "exceptions.h" + #include "types.h" -#include "native.h" -#include "options.h" -#include "tables.h" -#include "loader.h" -#include "asmpart.h" -#include "statistics.h" -#include "threads/thread.h" -#include "threads/locks.h" +#include "mm/memory.h" +#include "native/native.h" #include "toolbox/logging.h" -#include "toolbox/memory.h" +#include "vm/builtin.h" +#include "vm/exceptions.h" +#include "vm/global.h" +#include "vm/loader.h" +#include "vm/options.h" +#include "vm/statistics.h" +#include "vm/tables.h" hashtable utf_hash; /* hashtable for utf8-symbols */ -- 2.25.1