## 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:
#!/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 ../..
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
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
;;
*)
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:
${GC_ALPHA_VERSION:+alpha=}$GC_ALPHA_VERSION)
])
-sinclude(libtool.m4)
#!/bin/sh
+libtoolize --automake
aclocal
autoheader
automake --add-missing
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
AC_CHECK_TOOL(AR, ar)
AC_CHECK_TOOL(RANLIB, ranlib, :) # :)
+AC_PROG_LIBTOOL
AC_PROG_INSTALL
AM_MAINTAINER_MODE
-/* 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
- 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 <stdlib.h>
#include <string.h>
-#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"
-/* 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
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 */
/*
-/* 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,
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 $
*/
#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 ******************************************************/
-/* 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,
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 $
*/
#include <ucontext.h>
#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 *********/
-/* 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,
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 $
*/
#include "toolbox/chain.h"
+#include "vm/global.h"
/* export variables */
## 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:
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 $
*/
#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? */
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 $
*/
#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;
};
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 $
*/
#include <unistd.h>
#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 *********/
-/* 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,
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 <string.h>
-#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
-/* 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,
Authors: ?
- $Id: jni.h 1424 2004-10-30 11:15:23Z motse $
+ $Id: jni.h 1621 2004-11-30 13:06:55Z twisti $
*/
#define _JNI_H
#include <stdarg.h>
-#include "global.h"
+
#include "types.h"
+#include "vm/global.h"
#define JNI_VERSION 0x00010002
-/* natcalls.h -
+/* native/natcalls.h -
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Institut f. Computersprachen, TU Wien
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 $
*/
#ifndef _NATCALLS_H
#define _NATCALLS_H
-#include "global.h"
+#include "vm/global.h"
/*---------- Define Constants ---------------------------*/
-/* 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,
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 $
*/
#include <sys/time.h>
#include <utime.h>
-#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 <fcntl.h>
#endif
#include <sys/stat.h>
+#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"
-/* 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,
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 $
*/
#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 */
Changes:
- $Id: gennativetable.c 1429 2004-11-02 08:58:26Z jowenn $
+ $Id: gennativetable.c 1621 2004-11-30 13:06:55Z twisti $
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
#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)
/* 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);
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 */
-/* 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,
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 <string.h>
-#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"
/*
-/* 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,
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"
/*
## 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 \
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:
-/* 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,
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"
/*
-/* 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,
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"
/*
-/* 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,
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 <string.h>
-#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 */
-/* 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,
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"
/*
-/* 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,
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 <stdlib.h>
#include <string.h>
-#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
/*
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;
memcpy(new, this, c->instancesize);
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
- initObjectLock(new);
+ initObjectLock((java_objectheader *) new);
#endif
return new;
-/* 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,
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 $
*/
#include <unistd.h>
#include <sys/utsname.h>
+#if !defined(STATIC_CLASSPATH)
+#include <dlfcn.h>
+#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 <dlfcn.h>
-#endif
/* this should work on BSD */
/*
-/* 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,
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__
-/* 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,
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 <stdlib.h>
-#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"
/*
-/* 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,
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 <string.h>
#include <time.h>
-#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"
/*
-/* 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,
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"
/*
-/* 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,
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"
/*
## 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:
-#include "global.h"
-
-#if defined(NATIVE_THREADS)
-
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <time.h>
#include <errno.h>
-#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 <pthread.h>
#include <semaphore.h>
#elif defined(__MIPS__)
#define GC_IRIX_THREADS
#endif
-#include "../mm/boehm-gc/include/gc.h"
+#include "boehm-gc/include/gc.h"
#endif
#ifdef MUTEXSIM
notifyOneOrAll(t, o, false);
}
-#endif
-
/*
* These are local overrides for various environment variables in Emacs.
+/* 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 <semaphore.h>
-#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 <mach/mach.h>
#define MUTEXSIM
#endif
+
+typedef struct {
+ s4 super_baseval;
+ s4 super_diffval;
+ s4 sub_baseval;
+} castinfo;
+
struct _threadobject;
#define THREADINFO (&threadobj->info)
#endif
-#include "builtin.h"
+/*#include "builtin.h"*/
/* This must not be changed, it is used in asm_criticalsections */
typedef struct {
## 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:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
#include "toolbox/avl.h"
+
/* Creates and returns a new table
with comparison function |compare| using parameter |param|
and memory allocator |allocator|.
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 $
*/
#include <stdlib.h>
#include <assert.h>
-#include "global.h"
-#include "toolbox/memory.h"
+#include "mm/memory.h"
#include "toolbox/chain.h"
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 <stdlib.h>
-#include "global.h"
#include "toolbox/list.h"
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 $
*/
#include <stdlib.h>
#include <string.h>
-#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"
/***************************************************************************
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 $
*/
#include <sys/mman.h>
/* #define panic cacao_panic */
-#include "global.h"
+#include "vm/global.h"
#define MAXLOGTEXT 500
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 $
*/
#include <stdio.h>
#include <assert.h>
-#include "global.h"
-#include "toolbox/memory.h"
+#include "mm/memory.h"
#include "toolbox/tree.h"
-/* 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,
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 $
*/
#include <assert.h>
#include <string.h>
#include <math.h>
-#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*/
-/* 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,
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 $
*/
#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 */
-/* 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,
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 $
*/
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
-#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 */
-/* 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,
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 $
*/
#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 */
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 $
*/
#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)
#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 {
#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 *******************************************************
/* field, method and class structures *****************************************/
-#include "jit/sets.h"
typedef struct xtafldinfo {
bool fieldChecked;
classinfo *fldClassType;
## 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:
-/* 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,
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 $
*/
#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)
-/* 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
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 <string.h>
-#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 <dlfcn.h>
+#endif
+
+#include "mm/memory.h"
#include "toolbox/avl.h"
-#include "threads/thread.h"
-#ifndef STATIC_CLASSPATH
-#include <dlfcn.h>
+#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;
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 $
*/
#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 */
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 <stdio.h>
#include <string.h>
-#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
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 $
*/
#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*/
} 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*/
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 $
*/
#include <stdio.h>
#include <string.h>
-#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;
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 */
-/* 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,
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 <stdio.h>
+
#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;
-/* jit/sets.c -
+/* vm/jit/inline/sets.c -
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Institut f. Computersprachen, TU Wien
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 <stdio.h>
-#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"
/*
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 $
*/
#ifndef _SET_H
#define _SET_H
-#include "types.h"
-
typedef struct methSet methSet;
typedef struct methSetNode methSetNode;
typedef struct fldSet fldSet;
typedef struct classSetNode classSetNode;
-#include "global.h"
+#include "types.h"
+#include "vm/global.h"
/*------------ Method /Class Used Markers -------------------------------*/
-/* 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,
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 <stdlib.h>
-#include <string.h>
-#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 <stdio.h>
-#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 ************************************************************/
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 $
*/
#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;
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 **************************/
## 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
-/* 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,
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 $
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#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
-/* 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,
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 $
*/
#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);
-/* 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,
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 <stdio.h>
-#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)
-/* 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,
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 <stdio.h>
-#include <stdlib.h>
-#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 <stdio.h> */
+/* #include <stdlib.h> */
+#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"
/*
-/* 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,
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 $
*/
#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 */
-/* 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,
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 <stdio.h>
-#include "jit/loop/tracing.h"
-#include "jit/loop/loop.h"
-#include "toolbox/memory.h"
+/* #include <stdio.h> */
+
+#include "mm/memory.h"
+#include "vm/jit/loop/loop.h"
+#include "vm/jit/loop/tracing.h"
/* Test function -> will be removed in final release
-/* 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,
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 $
*/
#ifndef _TRACING_H
#define _TRACING_H
-
-#include "jit/jit.h"
+#include "vm/jit/jit.h"
typedef struct Trace Trace;
};
-/* function protoypes */
+/* function protoypes *********************************************************/
Trace* create_trace(int type, int var, int constant, int nr);
Trace* add(Trace* a, Trace* b);
-/* 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
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 $
*/
/* #define LSRA_PRINTLIFETIMES */
+#include <stdio.h>
+#include <stdlib.h>
+
#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 <stdio.h>
-#include <stdlib.h>
void lsra(methodinfo *m, codegendata *cd, registerdata *rd, loopdata *ld, t_inlining_globals *id)
{
-/* 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,
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 $
*/
#include <string.h>
#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) \
{ \
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 $
*/
#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 */
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 $
*/
#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 **************************/
-/* 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
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 */
-/* 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,
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 <stdio.h>
#include <string.h>
-#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"
/**********************************************************************/
-/* 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,
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 $
*/
#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"
/**********************************************************************/
-/* 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,
Changes:
- $Id: genoffsets.c 1296 2004-07-10 17:02:15Z stefan $
+ $Id: genoffsets.c 1621 2004-11-30 13:06:55Z twisti $
*/
#include <stdio.h>
+
#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)
-/* 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,
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 <string.h>
+
+#include "vm/global.h" /* must be here because of CACAO_TYPECHECK */
#ifdef CACAO_TYPECHECK
-#include <string.h>
-#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 */
-/* 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,
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 $
*/
#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);
-/* 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,
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 <stdlib.h>
#include <string.h>
-#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) \
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 $
*/
#ifndef _TYPEINFO_H
#define _TYPEINFO_H
-#include "global.h"
+#include "vm/global.h"
/* resolve typedef cycles *****************************************************/
## 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 \
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:
-/* 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
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
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 <stdio.h>
-#include <signal.h>
-#include <sys/ucontext.h>
-#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 <ucontext.h>
+
+#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 ************************************************/
*******************************************************************************/
-#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)
-/* 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,
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 $
*/
#include <ucontext.h>
-#include "jit/jit.h"
+#include "vm/jit/jit.h"
/* macros to create code ******************************************************/
-/* 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
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 */
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 $
*/
#ifndef _EMITFUNCS_H
#define _EMITFUNCS_H
-#include "jit/x86_64/types.h"
+#include "vm/jit/x86_64/types.h"
/* code generation prototypes */
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 $
*/
#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 */
-/* 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,
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 $
*/
#include <string.h>
#include <assert.h>
#include <sys/stat.h>
-#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
-/* 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
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 $
*/
#define _OPTIONS_H
-#include "global.h"
+#include "vm/global.h"
/* reserved option numbers ****************************************************/
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;
-/* 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,
- 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 <string.h>
#include <stdlib.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <unistd.h>
-#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 */