This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Kresten's interpreter - patches



Here are patches for supporting Kresten's interpreter.  There are also
several new files, all of which I am about to commit:

 interpret.cc
 resolve.cc
 defineclass.cc
 gij.cc
 gnu/gcj/runtime
 gnu/gcj/util/path
 include/java-interp.h
 include/java-cpool.h
 include/java-insns.h
 java/lang/runtime
 java/lang/natClassLoader.cc
 java/lang/VMClassLoader.java


These changes require libffi, which I have just imported.  Rather than
add yet another library, the libffi object files are included directly
in libgcj.

You must configure with --enable-interpreter for everything to work.

1999-08-09  Anthony Green  <green@cygnus.com>

	* gij.cc: New file.

	* include/config.h.in: Rebuilt.
	* acconfig.h: Add INTERPRETER.

	* configure: Rebuilt.

	* Makefile.in: Rebuilt.
	* Makefile.am (libffi_files): Identify the libffi object files for
	inclusion in libgcj.
	(LIBFFIINCS): Define.

	* interpret.cc (gnu::gcj::runtime::MethodInvocation::continue1):
	Dummy definition for configurations without an interpreter.
	
	* java/net/natPlainSocketImpl.cc (getOption): Disamiguate call to
	java::lang::Boolean constructor.

	* include/java-interp.h: Always include java-cpool.h.

	* java/lang/natClassLoader.cc (getVMClassLoader0): Always return 0
	when INTERPRETER not defined.

	* java/lang/Class.h (finalize): Define.

	* gnu/gcj/util/path/DirectoryPathEntry.java (getURL): Catch
	IOException from File.getCanonicalPath.
	(getStream): Likewise.

	* NEWS: More news.
	* THANKS: More thanks.

1999-08-09  Kresten Krab Thorup  <krab@gnu.org>

	* resolve.cc (get_ffi_type_from_signature): Generate uint16 for
	jchar type.
	(_Jv_PrepareClass): Allow non-abstract classes to
	have abstract subclasses.
	(_Jv_ResolvePoolEntry): Revert subclass check for protected
	fields and methods.
	* interpret.cc (continue1/perform_invoke): Don't sign extend
	uint16 return val. 
	(continue1/lshl,lshr): Push long, not int.
	(continue1/ulshr): Use UINT64, not long long.
 	* defineclass.cc (handleFieldsEnd): Handle case when all fields
	are static.
	* java/lang/natClass.cc (forName): Add call to _Jv_InitClass.
 	* java/lang/FirstThread.java (run): Add top-level exception
	handler. 
	(run0): Renamed from run.

1999-08-08  Kresten Krab Thorup  <krab@gnu.org>
 
 	* configure.in (--with-interpreter): Added.
 	* include/config.h.in (INTERPRETER): Added.
 
 	* java/lang/ClassLoader.java: File replaced.
 	* java/lang/VMClassLoader.java: New file.
 	* java/lang/natClassLoader.cc: New file.
 	* gnu/gcj/runtime/MethodInvocation.java: New file.
 	* gnu/gcj/util/path/SearchPath.java: New file.
 	* gnu/gcj/util/path/PathEntry.java: New file.
 	* gnu/gcj/util/path/DirectoryPathEntry.java: New file.
 	* gnu/gcj/util/path/ZipPathEntry.java: New file.
 	* gnu/gcj/util/path/URLPathEntry.java: New file.
 	* gnu/gcj/util/path/CacheEntry.java: New file. 
 	* include/java-interp.h: New file.
 	* include/java-cpool.h: New file.
 	* include/java-insns.h: New file.
 	* defineclass.cc: New file.
 	* interpret.cc: New file.
 	* resolve.cc: New file.
 
 	* java/lang/natClass.cc (loaded_classes, _Jv_RegisterClass,
 	_Jv_RegisterClasses, _Jv_FindClassInCache, _Jv_FindClass,
 	_Jv_NewClass, _Jv_FindArrayClass): Moved to natClassLoader.cc.
 	(finalize): New.
 	(STATE_NOTHING, STATE_RESOLVED, STATE_IN_PROGRESS, STATE_DONE,
 	STATE_ERROR): Moved to java/lang/Class.h and renamed with JV_
 	prefix. 
 	(initializeClass): Use new JV_ prefixed names.  Also, call
 	ClassLoader::resolveClass instead of _Jv_ResolveClass.
 		
 	* java/lang/Class.h (JV_STATE_PRELOADING, JV_STATE_LOADING,
 	JV_STATE_LOADED, JV_STATE_COMPILED, JV_STATE_PREPARED,
 	JV_STATE_LINKED): New.
 	(_Jv_WaitForState, _Jv_RegisterInitiatingLoader,
 	_Jv_UnregisterClass, _Jv_InternClassStrings): New friends.
 	(_Jv_IsInterpretedClass, _Jv_InitField, _Jv_LookupDeclaredMethod,
 	_Jv_DetermineVTableIndex, _Jv_ResolvePoolEntry, _Jv_PrepareClass,
 	_Jv_ClassReader, _Jv_InterpClass, _Jv_InterpMethod,
 	_Jv_InterpMethodInvocation): New friends for interpreter.
 	(finalize): New.
 	(CONSTANT_Class, CONSTANT_String, etc.): Moved to
 	include/java-cpool.h and renamed with JV_ prefix.
 	
 	* include/jvm.h (_Jv_makeUtf8Const, _Jv_makeUtf8TypeConst): New
 	decls.
 	(_Jv_UnregisterClass): New decl.
 
 	* java/lang/natClassLoader.cc (_Jv_FindArrayClass): Added
 	class loader argument. 
 	(_Jv_FindClass): Use class loader.
 	
 	* prims.cc (_Jv_makeUtf8Const): New function.
 	(_Jv_NewObjectArray): Change use of _Jv_FindArrayClass.
 	(_Jv_NewPrimArray): Ditto.
 	(_Jv_FindClassFromSignature): Ditto.
 	* java/lang/reflect/natArray.cc (newInstance): Ditto.
 	* java/lang/reflect/natMethod.cc (getType): Ditto.
 
 	* include/java-field.h (_Jv_Field::isRef): Make robust for
 	non-resolved contexts. 
 
 	* boehm.cc (_Jv_MarkObj): Mark interpreter-related fields. 
 	Also, don't mark class->next field.
 
 	* java/lang/VirtualMachineError.java: Added FIXME note.
 
 	* configure.in (INTERPSPEC): New spec.
 	* libgcj.spec.in: Added INTERPSPEC.
 	* Makefile.am: Added gcjh friends for java/lang/VMClassLoader and
 	gnu/gcj/runtime/MethodInvocation.
 	(libgcj_la_SOURCES): Added resolve.cc defineclass.cc interpret.cc.
 	(ordinary_java_source_files): Added above mentioned java classes.
 
 	* configure: Rebuilt.
 	* Makefile.in: Rebuilt.


Index: Makefile.am
===================================================================
RCS file: /cvs/java/libgcj/libjava/Makefile.am,v
retrieving revision 1.25
diff -u -r1.25 Makefile.am
--- Makefile.am	1999/07/21 15:11:52	1.25
+++ Makefile.am	1999/08/08 13:46:21
@@ -27,7 +27,7 @@
 
 ## For now, only on native systems.
 if NATIVE
-bin_PROGRAMS = jv-convert
+bin_PROGRAMS = jv-convert gij
 endif
 
 ## ################################################################
@@ -77,8 +77,10 @@
 JCFLAGS = -g
 JC1FLAGS = -g @LIBGCJ_JAVAFLAGS@
 
+LIBFFIINCS = -I$(top_srcdir)/../libffi/include -I../libffi/include
+
 INCLUDES = -Iinclude -I$(top_srcdir)/include $(GCINCS) $(THREADINCS) \
-	$(EH_COMMON_INCLUDE) $(ZINCS)
+	$(EH_COMMON_INCLUDE) $(ZINCS) $(LIBFFIINCS)
 
 DIVIDESPEC = @DIVIDESPEC@
 
@@ -96,14 +98,18 @@
 ## Objects from Java sources in subdirs.
 javao_files = $(java_source_files:.java=.lo) \
 	$(built_java_source_files:.java=.lo)
+
+## Extract the libffi object file names.
+libffi_files = `$(AR) t ../libffi/.libs/libffi.a 2>/dev/null | sed 's/\.o/\.lo/g' | sed 's/^/..\/libffi\//g'`
 
-libgcj_la_SOURCES = prims.cc jni.cc exception.cc
+libgcj_la_SOURCES = prims.cc jni.cc exception.cc \
+	resolve.cc defineclass.cc interpret.cc
 EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc \
 	$(c_source_files) $(java_source_files) $(built_java_source_files)
 libgcj_la_DEPENDENCIES = libgcj.zip $(javao_files) $(nat_files) \
 	$(c_files) $(GCOBJS) $(THREADOBJS)
 libgcj_la_LIBADD = $(javao_files) $(nat_files) $(c_files) $(GCOBJS) \
-	$(THREADOBJS)
+	$(THREADOBJS) $(libffi_files)
 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) \
 ## The mysterious backslash is consumed by make.
 	-version-info `grep -v '^\#' $(srcdir)/libtool-version`
@@ -230,7 +236,17 @@
 	    -friend 'java::lang::Class;' \
 	    $(basename $<)
 
+java/lang/VMClassLoader.h: java/lang/VMClassLoader.class libgcj.zip
+	$(GCJH) -classpath $(top_builddir) \
+	    -friend 'java::lang::ClassLoader;' \
+	    $(basename $<)
 
+gnu/gcj/runtime/MethodInvocation.h: gnu/gcj/runtime/MethodInvocation.class libgcj.zip
+	$(GCJH) -classpath $(top_builddir) \
+	    -friend 'class _Jv_InterpMethod;' \
+	    $(basename $<)
+
+
 ## ################################################################
 
 ##
@@ -299,6 +315,26 @@
 jv_convert_DEPENDENCIES = $(convert_source_files:.java=.lo) \
 	$(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
 
+gij_SOURCES =
+EXTRA_gij_SOURCES = gij.cc
+## We need -nodefaultlibs because we want to avoid gcj's `-lgcj'.  We
+## need this because we are explicitly using libtool to link using the
+## `.la' file.
+gij_LDFLAGS = -rpath $(toolexeclibdir)
+gij_LINK = $(LIBTOOL) --mode=link $(GCJ) $(JC1FLAGS) $(LDFLAGS) \
+	-o gij
+## We explicitly link in the libraries we need.  This way we don't
+## need -nodefaultlibs, so we can still rely on gcj picking up the
+## system libraries we need (via the specs file).
+## We need the -L so that gcj can find libgcj with `-lgcj'.
+## FIXME: should be _libs on some systems.
+gij_LDADD = gij.lo libgcj.la \
+	$(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
+## Depend on the spec file to make sure it is up to date before
+## linking this program.
+gij_DEPENDENCIES = gij.lo \
+	$(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+
 # The Unicode consortium does not permit re-distributing the file JIS0201.TXT.
 # You can get it from ftp://ftp.unicode.org/Public/MAPPINGS/EASTASIA/JIS/.
 
@@ -444,6 +480,13 @@
 ## convert_source_files.  If the .java file has a hand-maintained
 ## header, please list it in special_java_source_files.
 ordinary_java_source_files =  $(convert_source_files) \
+gnu/gcj/runtime/MethodInvocation.java \
+gnu/gcj/util/path/SearchPath.java \
+gnu/gcj/util/path/PathEntry.java \
+gnu/gcj/util/path/DirectoryPathEntry.java \
+gnu/gcj/util/path/ZipPathEntry.java \
+gnu/gcj/util/path/URLPathEntry.java \
+gnu/gcj/util/path/CacheEntry.java \
 gnu/gcj/text/BaseBreakIterator.java \
 gnu/gcj/text/CharacterBreakIterator.java \
 gnu/gcj/text/LineBreakIterator.java \
@@ -522,6 +565,7 @@
 java/lang/ClassCircularityError.java \
 java/lang/ClassFormatError.java	\
 java/lang/ClassLoader.java \
+java/lang/VMClassLoader.java \
 java/lang/ClassNotFoundException.java \
 java/lang/CloneNotSupportedException.java \
 java/lang/Cloneable.java \
@@ -719,6 +763,7 @@
 java/io/natFileDescriptor.cc \
 java/lang/natCharacter.cc \
 java/lang/natClass.cc \
+java/lang/natClassLoader.cc \
 java/lang/natConcreteProcess.cc \
 java/lang/natDouble.cc \
 java/lang/natFirstThread.cc \
Index: Makefile.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/Makefile.in,v
retrieving revision 1.28
diff -u -r1.28 Makefile.in
--- Makefile.in	1999/08/03 03:07:03	1.28
+++ Makefile.in	1999/08/08 13:46:24
@@ -78,6 +78,7 @@
 GCLIBS = @GCLIBS@
 GCOBJS = @GCOBJS@
 GCSPEC = @GCSPEC@
+INTERPSPEC = @INTERPSPEC@
 LD = @LD@
 LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
 LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@
@@ -120,7 +121,7 @@
 data_DATA = libgcj.zip
 
 @NATIVE_TRUE@bin_PROGRAMS = \
-@NATIVE_TRUE@jv-convert
+@NATIVE_TRUE@jv-convert gij
 @CANADIAN_TRUE@@NULL_TARGET_TRUE@GCJ = \
 @CANADIAN_TRUE@@NULL_TARGET_TRUE@gcj
 @CANADIAN_TRUE@@NULL_TARGET_FALSE@GCJ = \
@@ -156,8 +157,10 @@
 JCFLAGS = -g
 JC1FLAGS = -g @LIBGCJ_JAVAFLAGS@
 
+LIBFFIINCS = -I$(top_srcdir)/../libffi/include -I../libffi/include
+
 INCLUDES = -Iinclude -I$(top_srcdir)/include $(GCINCS) $(THREADINCS) \
-	$(EH_COMMON_INCLUDE) $(ZINCS)
+	$(EH_COMMON_INCLUDE) $(ZINCS) $(LIBFFIINCS)
 
 
 DIVIDESPEC = @DIVIDESPEC@
@@ -167,8 +170,12 @@
 javao_files = $(java_source_files:.java=.lo) \
 	$(built_java_source_files:.java=.lo)
 
+
+libffi_files = `$(AR) t ../libffi/.libs/libffi.a 2>/dev/null | sed 's/\.o/\.lo/g' | sed 's/^/..\/libffi\//g'`
 
-libgcj_la_SOURCES = prims.cc jni.cc exception.cc
+libgcj_la_SOURCES = prims.cc jni.cc exception.cc \
+	resolve.cc defineclass.cc interpret.cc
+
 EXTRA_libgcj_la_SOURCES = boehm.cc nogc.cc posix-threads.cc no-threads.cc \
 	$(c_source_files) $(java_source_files) $(built_java_source_files)
 
@@ -176,7 +183,7 @@
 	$(c_files) $(GCOBJS) $(THREADOBJS)
 
 libgcj_la_LIBADD = $(javao_files) $(nat_files) $(c_files) $(GCOBJS) \
-	$(THREADOBJS)
+	$(THREADOBJS) $(libffi_files)
 
 libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) \
 	-version-info `grep -v '^\#' $(srcdir)/libtool-version`
@@ -217,6 +224,19 @@
 	$(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
 
 
+gij_SOURCES = 
+EXTRA_gij_SOURCES = gij.cc
+gij_LDFLAGS = -rpath $(toolexeclibdir)
+gij_LINK = $(LIBTOOL) --mode=link $(GCJ) $(JC1FLAGS) $(LDFLAGS) \
+	-o gij
+
+gij_LDADD = gij.lo libgcj.la \
+	$(GCLIBS) $(THREADLIBS) $(ZLIBS) -L$(here)/.libs
+
+gij_DEPENDENCIES = gij.lo \
+	$(GCDEPS) $(THREADDEPS) $(ZDEPS) libgcj.la libgcj.spec
+
+
 gen_from_JIS_SOURCES = 
 EXTRA_gen_from_JIS_SOURCES = $(srcdir)/$(CONVERT_DIR)/gen-from-JIS.c \
 		$(srcdir)/$(CONVERT_DIR)/make-trie.c \
@@ -294,6 +314,13 @@
 built_java_source_files = java/lang/ConcreteProcess.java
 
 ordinary_java_source_files = $(convert_source_files) \
+gnu/gcj/runtime/MethodInvocation.java \
+gnu/gcj/util/path/SearchPath.java \
+gnu/gcj/util/path/PathEntry.java \
+gnu/gcj/util/path/DirectoryPathEntry.java \
+gnu/gcj/util/path/ZipPathEntry.java \
+gnu/gcj/util/path/URLPathEntry.java \
+gnu/gcj/util/path/CacheEntry.java \
 gnu/gcj/text/BaseBreakIterator.java \
 gnu/gcj/text/CharacterBreakIterator.java \
 gnu/gcj/text/LineBreakIterator.java \
@@ -372,6 +399,7 @@
 java/lang/ClassCircularityError.java \
 java/lang/ClassFormatError.java	\
 java/lang/ClassLoader.java \
+java/lang/VMClassLoader.java \
 java/lang/ClassNotFoundException.java \
 java/lang/CloneNotSupportedException.java \
 java/lang/Cloneable.java \
@@ -569,6 +597,7 @@
 java/io/natFileDescriptor.cc \
 java/lang/natCharacter.cc \
 java/lang/natClass.cc \
+java/lang/natClassLoader.cc \
 java/lang/natConcreteProcess.cc \
 java/lang/natDouble.cc \
 java/lang/natFirstThread.cc \
@@ -655,13 +684,15 @@
 CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
 LIBS = @LIBS@
-libgcj_la_OBJECTS =  prims.lo jni.lo exception.lo
-@NATIVE_TRUE@bin_PROGRAMS =  jv-convert$(EXEEXT)
+libgcj_la_OBJECTS =  prims.lo jni.lo exception.lo resolve.lo \
+defineclass.lo interpret.lo
+@NATIVE_TRUE@bin_PROGRAMS =  jv-convert$(EXEEXT) gij$(EXEEXT)
 @NATIVE_TRUE@@MAINTAINER_MODE_TRUE@noinst_PROGRAMS =  \
 @NATIVE_TRUE@@MAINTAINER_MODE_TRUE@gen-from-JIS$(EXEEXT)
 PROGRAMS =  $(bin_PROGRAMS) $(noinst_PROGRAMS)
 
 jv_convert_OBJECTS = 
+gij_OBJECTS = 
 gen_from_JIS_OBJECTS = 
 gen_from_JIS_LDFLAGS = 
 CXXFLAGS = @CXXFLAGS@
@@ -688,9 +719,9 @@
 DIST_SUBDIRS =  testsuite
 DEP_FILES =  .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
 .deps/$(srcdir)/$(CONVERT_DIR)/make-trie.P .deps/boehm.P \
-.deps/exception.P .deps/gnu/gcj/RawData.P \
-.deps/gnu/gcj/convert/BytesToUnicode.P .deps/gnu/gcj/convert/Convert.P \
-.deps/gnu/gcj/convert/Input_8859_1.P \
+.deps/defineclass.P .deps/exception.P .deps/gij.P \
+.deps/gnu/gcj/RawData.P .deps/gnu/gcj/convert/BytesToUnicode.P \
+.deps/gnu/gcj/convert/Convert.P .deps/gnu/gcj/convert/Input_8859_1.P \
 .deps/gnu/gcj/convert/Input_EUCJIS.P \
 .deps/gnu/gcj/convert/Input_JavaSrc.P \
 .deps/gnu/gcj/convert/Input_SJIS.P .deps/gnu/gcj/convert/Input_UTF8.P \
@@ -703,6 +734,7 @@
 .deps/gnu/gcj/protocol/file/Handler.P \
 .deps/gnu/gcj/protocol/http/Connection.P \
 .deps/gnu/gcj/protocol/http/Handler.P \
+.deps/gnu/gcj/runtime/MethodInvocation.P \
 .deps/gnu/gcj/text/BaseBreakIterator.P \
 .deps/gnu/gcj/text/CharacterBreakIterator.P \
 .deps/gnu/gcj/text/LineBreakIterator.P \
@@ -711,6 +743,12 @@
 .deps/gnu/gcj/text/SentenceBreakIterator.P \
 .deps/gnu/gcj/text/WordBreakIterator.P \
 .deps/gnu/gcj/util/EnumerationChain.P \
+.deps/gnu/gcj/util/path/CacheEntry.P \
+.deps/gnu/gcj/util/path/DirectoryPathEntry.P \
+.deps/gnu/gcj/util/path/PathEntry.P \
+.deps/gnu/gcj/util/path/SearchPath.P \
+.deps/gnu/gcj/util/path/URLPathEntry.P \
+.deps/gnu/gcj/util/path/ZipPathEntry.P .deps/interpret.P \
 .deps/java/io/BufferedInputStream.P \
 .deps/java/io/BufferedOutputStream.P .deps/java/io/BufferedReader.P \
 .deps/java/io/BufferedWriter.P .deps/java/io/ByteArrayInputStream.P \
@@ -788,8 +826,9 @@
 .deps/java/lang/Throwable.P .deps/java/lang/UnknownError.P \
 .deps/java/lang/UnsatisfiedLinkError.P \
 .deps/java/lang/UnsupportedOperationException.P \
-.deps/java/lang/VerifyError.P .deps/java/lang/VirtualMachineError.P \
-.deps/java/lang/Void.P .deps/java/lang/dtoa.P .deps/java/lang/e_acos.P \
+.deps/java/lang/VMClassLoader.P .deps/java/lang/VerifyError.P \
+.deps/java/lang/VirtualMachineError.P .deps/java/lang/Void.P \
+.deps/java/lang/dtoa.P .deps/java/lang/e_acos.P \
 .deps/java/lang/e_asin.P .deps/java/lang/e_atan2.P \
 .deps/java/lang/e_exp.P .deps/java/lang/e_fmod.P \
 .deps/java/lang/e_log.P .deps/java/lang/e_pow.P \
@@ -872,9 +911,9 @@
 .deps/java/util/zip/ZipException.P .deps/java/util/zip/ZipFile.P \
 .deps/java/util/zip/ZipInputStream.P \
 .deps/java/util/zip/ZipOutputStream.P .deps/jni.P .deps/no-threads.P \
-.deps/nogc.P .deps/posix-threads.P .deps/prims.P
-SOURCES = $(libgcj_la_SOURCES) $(EXTRA_libgcj_la_SOURCES) $(jv_convert_SOURCES) $(EXTRA_jv_convert_SOURCES) $(gen_from_JIS_SOURCES) $(EXTRA_gen_from_JIS_SOURCES)
-OBJECTS = $(libgcj_la_OBJECTS) $(jv_convert_OBJECTS) $(gen_from_JIS_OBJECTS)
+.deps/nogc.P .deps/posix-threads.P .deps/prims.P .deps/resolve.P
+SOURCES = $(libgcj_la_SOURCES) $(EXTRA_libgcj_la_SOURCES) $(jv_convert_SOURCES) $(EXTRA_jv_convert_SOURCES) $(gij_SOURCES) $(EXTRA_gij_SOURCES) $(gen_from_JIS_SOURCES) $(EXTRA_gen_from_JIS_SOURCES)
+OBJECTS = $(libgcj_la_OBJECTS) $(jv_convert_OBJECTS) $(gij_OBJECTS) $(gen_from_JIS_OBJECTS)
 
 all: all-redirect
 .SUFFIXES:
@@ -1022,6 +1061,10 @@
 	@rm -f jv-convert$(EXEEXT)
 	$(jv_convert_LINK) $(jv_convert_LDFLAGS) $(jv_convert_OBJECTS) $(jv_convert_LDADD) $(LIBS)
 
+gij$(EXEEXT): $(gij_OBJECTS) $(gij_DEPENDENCIES)
+	@rm -f gij$(EXEEXT)
+	$(gij_LINK) $(gij_LDFLAGS) $(gij_OBJECTS) $(gij_LDADD) $(LIBS)
+
 gen-from-JIS$(EXEEXT): $(gen_from_JIS_OBJECTS) $(gen_from_JIS_DEPENDENCIES)
 	@rm -f gen-from-JIS$(EXEEXT)
 	$(LINK) $(gen_from_JIS_LDFLAGS) $(gen_from_JIS_OBJECTS) $(gen_from_JIS_LDADD) $(LIBS)
@@ -1449,6 +1492,16 @@
 	$(GCJH) -classpath $(top_builddir) \
 	    -friend 'jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);' \
 	    -friend 'java::lang::Class;' \
+	    $(basename $<)
+
+java/lang/VMClassLoader.h: java/lang/VMClassLoader.class libgcj.zip
+	$(GCJH) -classpath $(top_builddir) \
+	    -friend 'java::lang::ClassLoader;' \
+	    $(basename $<)
+
+gnu/gcj/runtime/MethodInvocation.h: gnu/gcj/runtime/MethodInvocation.class libgcj.zip
+	$(GCJH) -classpath $(top_builddir) \
+	    -friend 'class _Jv_InterpMethod;' \
 	    $(basename $<)
 
 maintainer-check: libgcj.la
Index: NEWS
===================================================================
RCS file: /cvs/java/libgcj/libjava/NEWS,v
retrieving revision 1.2
diff -u -r1.2 NEWS
--- NEWS	1999/08/01 04:04:04	1.2
+++ NEWS	1999/08/08 13:46:24
@@ -1,3 +1,7 @@
+New in libgcj X.XX:
+
+* libgcj now includes a bytecode interpreter.
+
 New in libgcj 2.95:
 
 * First public release
Index: THANKS
===================================================================
RCS file: /cvs/java/libgcj/libjava/THANKS,v
retrieving revision 1.3
diff -u -r1.3 THANKS
--- THANKS	1999/08/04 19:55:25	1.3
+++ THANKS	1999/08/08 13:46:25
@@ -10,9 +10,10 @@
 Franz Sirl		Franz.Sirl-kernel@lauterbach.com
 Geoff Berry		gcb@gnu.org
 Gilles Zunino		Gilles.Zunino@hei.fr
-Per Bothner		per@bother.com
+Kresten Krab Thorup	krab@gnu.org
+Per Bothner		per@bothner.com
 Rainer Orth		ro@TechFak.Uni-Bielefeld.DE
-Stu Grossman		grossman@cygnus.com
+Stu Grossman		grossman@juniper.net
 Tom Tromey		tromey@cygnus.com
 Urban Widmark		urban@svenskatest.se
 Warren Levy		warrenl@cygnus.com
Index: acconfig.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/acconfig.h,v
retrieving revision 1.3
diff -u -r1.3 acconfig.h
--- acconfig.h	1999/06/24 20:05:37	1.3
+++ acconfig.h	1999/08/08 13:46:25
@@ -93,3 +93,6 @@
 #undef HAVE_READDIR_R
 #undef HAVE_GETHOSTBYNAME_R
 #undef HAVE_GETHOSTBYADDR_R
+
+/* Define if you want a bytecode interpreter.  */
+#undef INTERPRETER
Index: boehm.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/boehm.cc,v
retrieving revision 1.3
diff -u -r1.3 boehm.cc
--- boehm.cc	1999/08/03 00:30:53	1.3
+++ boehm.cc	1999/08/08 13:46:26
@@ -16,6 +16,7 @@
 #include <java/lang/Class.h>
 #include <jvm.h>
 #include <java-field.h>
+#include <java-interp.h>
 
 // We need to include gc_priv.h.  However, it tries to include
 // config.h if it hasn't already been included.  So we force the
@@ -97,8 +98,14 @@
     {
       jclass c = (jclass) addr;
 
+#if 0
+      // The next field should probably not be marked, since this is
+      // only used in the class hash table.  Marking this field
+      // basically prohibits class unloading. --Kresten
       w = (word) c->next;
       MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c2label);
+#endif
+
       w = (word) c->name;
       MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c3label);
       w = (word) c->superclass;
@@ -109,12 +116,23 @@
 	  MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c5label);
 	}
 
+#ifdef INTERPRETER
+      if (_Jv_IsInterpretedClass (c))
+	{
+	  w = (word) c->constants.tags;
+	  MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c5alabel);
+	  w = (word) c->constants.data;
+	  MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c5blabel);
+	}
+#endif
+
       // If the class is an array, then the methods field holds a
       // pointer to the element class.  If the class is primitive,
       // then the methods field holds a pointer to the array class.
       w = (word) c->methods;
       MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c6label);
 
+
       if (! c->isArray() && ! c->isPrimitive())
 	{
 	  // Scan each method in the cases where `methods' really
@@ -127,7 +145,19 @@
 	      w = (word) c->methods[i].signature;
 	      MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c,
 			     cm2label);
+
 	      // FIXME: `ncode' entry?
+
+#ifdef INTERPRETER
+	      // The interpreter installs a heap-allocated
+	      // trampoline here, so we'll mark it. 
+	      if (_Jv_IsInterpretedClass (c))
+		  {
+		      w = (word) c->methods[i].ncode;
+		      MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c,
+				  cm3label);
+		  }
+#endif
 	    }
 	}
 
@@ -136,12 +166,34 @@
       MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8label);
       for (int i = 0; i < c->field_count; ++i)
 	{
+	  _Jv_Field* field = &c->fields[i];
+
 #ifndef COMPACT_FIELDS
-	  w = (word) c->fields[i].name;
+	  w = (word) field->name;
 	  MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8alabel);
 #endif
-	  w = (word) c->fields[i].type;
+	  w = (word) field->type;
 	  MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8blabel);
+
+	  // For the interpreter, we also need to mark the memory
+	  // containing static members
+	  if (field->flags & 0x0008)
+	    {
+	      w = (word) field->u.addr;
+	      MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, c8clabel);
+
+	      // also, if the static member is a reference,
+	      // mark also the value pointed to.  We check for isResolved
+	      // since marking can happen before memory is allocated for
+	      // static members.
+	      if (JvFieldIsRef (field) && field->isResolved()) 
+		{
+		  jobject val = *(jobject*) field->u.addr;
+		  w = (word) val;
+		  MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit,
+			      c, c8elabel);
+		}
+	    }
 	}
 
       w = (word) c->vtable;
@@ -155,6 +207,28 @@
 	}
       w = (word) c->loader;
       MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, c, cBlabel);
+
+#ifdef INTERPRETER
+      if (_Jv_IsInterpretedClass (c))
+	{
+	  _Jv_InterpClass* ic = (_Jv_InterpClass*)c;
+
+	  w = (word) ic->interpreted_methods;
+	  MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, ic, cElabel);
+
+	  for (int i = 0; i < c->method_count; i++)
+	    {
+	      w = (word) ic->interpreted_methods[i];
+	      MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, ic, \
+			  cFlabel);
+	    }
+
+	  w = (word) ic->field_initializers;
+	  MAYBE_MARK (w, mark_stack_ptr, mark_stack_limit, ic, cGlabel);
+	  
+	}
+#endif
+
     }
   else
     {
Index: configure
===================================================================
RCS file: /cvs/java/libgcj/libjava/configure,v
retrieving revision 1.21
diff -u -r1.21 configure
--- configure	1999/08/06 20:36:45	1.21
+++ configure	1999/08/08 13:46:35
@@ -35,6 +35,8 @@
 ac_help="$ac_help
   --enable-libgcj-debug           Enable runtime debugging code"
 ac_help="$ac_help
+  --enable-interpreter            Enable interpreter"
+ac_help="$ac_help
   --with-ecos      Enable runtime eCos target support."
 ac_help="$ac_help
   --with-system-zlib               Use installed libz"
@@ -59,6 +61,7 @@
 program_transform_name=s,x,x,
 silent=
 site=
+sitefile=
 srcdir=
 target=NONE
 verbose=
@@ -173,6 +176,7 @@
   --help                  print this message
   --no-create             do not create output files
   --quiet, --silent       do not print \`checking...' messages
+  --site-file=FILE        use FILE as the site file
   --version               print the version of autoconf that created configure
 Directory and file names:
   --prefix=PREFIX         install architecture-independent files in PREFIX
@@ -343,6 +347,11 @@
   -site=* | --site=* | --sit=*)
     site="$ac_optarg" ;;
 
+  -site-file | --site-file | --site-fil | --site-fi | --site-f)
+    ac_prev=sitefile ;;
+  -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*)
+    sitefile="$ac_optarg" ;;
+
   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
     ac_prev=srcdir ;;
   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
@@ -508,12 +517,16 @@
 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
 
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+if test -z "$sitefile"; then
+  if test -z "$CONFIG_SITE"; then
+    if test "x$prefix" != xNONE; then
+      CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+    else
+      CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+    fi
   fi
+else
+  CONFIG_SITE="$sitefile"
 fi
 for ac_site_file in $CONFIG_SITE; do
   if test -r "$ac_site_file"; then
@@ -601,7 +614,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:605: checking host system type" >&5
+echo "configure:618: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -622,7 +635,7 @@
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:626: checking target system type" >&5
+echo "configure:639: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -640,7 +653,7 @@
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:644: checking build system type" >&5
+echo "configure:657: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -688,7 +701,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:692: checking for a BSD compatible install" >&5
+echo "configure:705: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -741,7 +754,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:745: checking whether build environment is sane" >&5
+echo "configure:758: checking whether build environment is sane" >&5
 # Just in case
 sleep 1
 echo timestamp > conftestfile
@@ -798,7 +811,7 @@
 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:802: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:815: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -831,12 +844,12 @@
 fi
 
 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:835: checking for Cygwin environment" >&5
+echo "configure:848: checking for Cygwin environment" >&5
 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 840 "configure"
+#line 853 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -847,7 +860,7 @@
 return __CYGWIN__;
 ; return 0; }
 EOF
-if { (eval echo configure:851: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_cygwin=yes
 else
@@ -864,19 +877,19 @@
 CYGWIN=
 test "$ac_cv_cygwin" = yes && CYGWIN=yes
 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
-echo "configure:868: checking for mingw32 environment" >&5
+echo "configure:881: checking for mingw32 environment" >&5
 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 873 "configure"
+#line 886 "configure"
 #include "confdefs.h"
 
 int main() {
 return __MINGW32__;
 ; return 0; }
 EOF
-if { (eval echo configure:880: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:893: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mingw32=yes
 else
@@ -924,7 +937,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:928: checking host system type" >&5
+echo "configure:941: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -966,7 +979,7 @@
 
 missing_dir=`cd $ac_aux_dir && pwd`
 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:970: checking for working aclocal" >&5
+echo "configure:983: checking for working aclocal" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -979,7 +992,7 @@
 fi
 
 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:983: checking for working autoconf" >&5
+echo "configure:996: checking for working autoconf" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -992,7 +1005,7 @@
 fi
 
 echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:996: checking for working automake" >&5
+echo "configure:1009: checking for working automake" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1005,7 +1018,7 @@
 fi
 
 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1009: checking for working autoheader" >&5
+echo "configure:1022: checking for working autoheader" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1018,7 +1031,7 @@
 fi
 
 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1022: checking for working makeinfo" >&5
+echo "configure:1035: checking for working makeinfo" >&5
 # Run test in a subshell; some versions of sh will print an error if
 # an executable is not found, even if stderr is redirected.
 # Redirect stdin to placate older versions of autoconf.  Sigh.
@@ -1043,7 +1056,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1047: checking for $ac_word" >&5
+echo "configure:1060: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1073,7 +1086,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1077: checking for $ac_word" >&5
+echo "configure:1090: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1122,7 +1135,7 @@
 fi
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1126: checking whether we are using GNU C" >&5
+echo "configure:1139: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1131,7 +1144,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1148: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1146,7 +1159,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1150: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1163: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1182,7 +1195,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1186: checking for $ac_word" >&5
+echo "configure:1199: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1215,7 +1228,7 @@
 test -z "$CXX" && { echo "configure: error: no acceptable c++ found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
-echo "configure:1219: checking whether we are using GNU C++" >&5
+echo "configure:1232: checking whether we are using GNU C++" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1224,7 +1237,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1228: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gxx=yes
 else
   ac_cv_prog_gxx=no
@@ -1239,7 +1252,7 @@
   ac_save_CXXFLAGS="$CXXFLAGS"
   CXXFLAGS=
   echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
-echo "configure:1243: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1256: checking whether ${CXX-g++} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1272,7 +1285,7 @@
 # LIBGCJ_CONFIGURE, which doesn't work because that means that it will
 # be run before AC_CANONICAL_HOST.
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1276: checking build system type" >&5
+echo "configure:1289: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -1293,7 +1306,7 @@
 # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
 set dummy ${ac_tool_prefix}as; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1297: checking for $ac_word" >&5
+echo "configure:1310: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1325,7 +1338,7 @@
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1329: checking for $ac_word" >&5
+echo "configure:1342: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1357,7 +1370,7 @@
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1361: checking for $ac_word" >&5
+echo "configure:1374: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1389,7 +1402,7 @@
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1393: checking for $ac_word" >&5
+echo "configure:1406: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1434,7 +1447,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1438: checking for a BSD compatible install" >&5
+echo "configure:1451: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1488,7 +1501,7 @@
 
 
 echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:1492: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1505: checking whether to enable maintainer-specific portions of Makefiles" >&5
     # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
   enableval="$enable_maintainer_mode"
@@ -1522,7 +1535,7 @@
   
 
 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1526: checking for executable suffix" >&5
+echo "configure:1539: checking for executable suffix" >&5
 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1532,7 +1545,7 @@
   rm -f conftest*
   echo 'int main () { return 0; }' > conftest.$ac_ext
   ac_cv_exeext=
-  if { (eval echo configure:1536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+  if { (eval echo configure:1549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
     for file in conftest.*; do
       case $file in
       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
@@ -1654,7 +1667,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1658: checking for $ac_word" >&5
+echo "configure:1671: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1684,7 +1697,7 @@
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1688: checking for $ac_word" >&5
+echo "configure:1701: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1714,7 +1727,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1718: checking for $ac_word" >&5
+echo "configure:1731: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1765,7 +1778,7 @@
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1769: checking for $ac_word" >&5
+echo "configure:1782: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1797,7 +1810,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1801: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1814: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -1808,12 +1821,12 @@
 
 cat > conftest.$ac_ext << EOF
 
-#line 1812 "configure"
+#line 1825 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1817: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1839,12 +1852,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1843: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1856: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1848: checking whether we are using GNU C" >&5
+echo "configure:1861: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1853,7 +1866,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1870: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1872,7 +1885,7 @@
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1876: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1889: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1915,7 +1928,7 @@
 if test "$ac_cv_prog_gcc" = yes; then
   # Check if gcc -print-prog-name=ld gives a path.
   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:1919: checking for ld used by GCC" >&5
+echo "configure:1932: checking for ld used by GCC" >&5
   ac_prog=`($CC -print-prog-name=ld) 2>&5`
   case "$ac_prog" in
     # Accept absolute paths.
@@ -1939,10 +1952,10 @@
   esac
 elif test "$with_gnu_ld" = yes; then
   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:1943: checking for GNU ld" >&5
+echo "configure:1956: checking for GNU ld" >&5
 else
   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1946: checking for non-GNU ld" >&5
+echo "configure:1959: checking for non-GNU ld" >&5
 fi
 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1978,7 +1991,7 @@
 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
 
 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
-echo "configure:1982: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1995: checking if the linker ($LD) is GNU ld" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1994,7 +2007,7 @@
 
 
 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1998: checking for BSD-compatible nm" >&5
+echo "configure:2011: checking for BSD-compatible nm" >&5
 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2031,7 +2044,7 @@
 
 
 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2035: checking whether ln -s works" >&5
+echo "configure:2048: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2075,8 +2088,8 @@
 case "$host" in
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 2079 "configure"' > conftest.$ac_ext
-  if { (eval echo configure:2080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  echo '#line 2092 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2093: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     case "`/usr/bin/file conftest.o`" in
     *32-bit*)
       LD="${LD-ld} -32"
@@ -2097,19 +2110,19 @@
   SAVE_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS -belf"
   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2101: checking whether the C compiler needs -belf" >&5
+echo "configure:2114: checking whether the C compiler needs -belf" >&5
 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2106 "configure"
+#line 2119 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   lt_cv_cc_needs_belf=yes
 else
@@ -2253,6 +2266,21 @@
 fi
 
 
+# Check whether --enable-interpreter or --disable-interpreter was given.
+if test "${enable_interpreter+set}" = set; then
+  enableval="$enable_interpreter"
+  if test "$enable_interpreter" = yes; then
+     cat >> confdefs.h <<\EOF
+#define INTERPRETER 1
+EOF
+
+  fi
+fi
+
+
+INTERPSPEC=
+
+
 TARGET_ECOS="no"
 # Check whether --with-ecos or --without-ecos was given.
 if test "${with_ecos+set}" = set; then
@@ -2278,7 +2306,7 @@
 esac
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2282: checking how to run the C preprocessor" >&5
+echo "configure:2310: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2293,13 +2321,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2297 "configure"
+#line 2325 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2310,13 +2338,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2314 "configure"
+#line 2342 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2320: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2327,13 +2355,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2331 "configure"
+#line 2359 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2365: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2358,7 +2386,7 @@
 echo "$ac_t""$CPP" 1>&6
 
 cat > conftest.$ac_ext <<EOF
-#line 2362 "configure"
+#line 2390 "configure"
 #include "confdefs.h"
 #include <stdint.h>
 EOF
@@ -2373,7 +2401,7 @@
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 2377 "configure"
+#line 2405 "configure"
 #include "confdefs.h"
 #include <inttypes.h>
 EOF
@@ -2388,7 +2416,7 @@
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 2392 "configure"
+#line 2420 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -2403,7 +2431,7 @@
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 2407 "configure"
+#line 2435 "configure"
 #include "confdefs.h"
 #include <sys/config.h>
 EOF
@@ -2420,7 +2448,7 @@
 
 
 cat > conftest.$ac_ext <<EOF
-#line 2424 "configure"
+#line 2452 "configure"
 #include "confdefs.h"
 #include <time.h>
 EOF
@@ -2435,7 +2463,7 @@
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 2439 "configure"
+#line 2467 "configure"
 #include "confdefs.h"
 #include <time.h>
 EOF
@@ -2473,7 +2501,7 @@
 libsubdir=.libs
 
 echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:2477: checking for garbage collector to use" >&5
+echo "configure:2505: checking for garbage collector to use" >&5
 # Check whether --enable-java-gc or --disable-java-gc was given.
 if test "${enable_java_gc+set}" = set; then
   enableval="$enable_java_gc"
@@ -2523,7 +2551,7 @@
 
 
 echo $ac_n "checking for threads package to use""... $ac_c" 1>&6
-echo "configure:2527: checking for threads package to use" >&5
+echo "configure:2555: checking for threads package to use" >&5
 # Check whether --enable-threads or --disable-threads was given.
 if test "${enable_threads+set}" = set; then
   enableval="$enable_threads"
@@ -2715,12 +2743,12 @@
    for ac_func in strerror ioctl select open fsync sleep
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2719: checking for $ac_func" >&5
+echo "configure:2747: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2724 "configure"
+#line 2752 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2743,7 +2771,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2770,12 +2798,12 @@
    for ac_func in ctime_r ctime
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2774: checking for $ac_func" >&5
+echo "configure:2802: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2779 "configure"
+#line 2807 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2798,7 +2826,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2825,12 +2853,12 @@
    for ac_func in gmtime_r localtime_r readdir_r getpwuid_r
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2829: checking for $ac_func" >&5
+echo "configure:2857: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2834 "configure"
+#line 2862 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2853,7 +2881,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2880,12 +2908,12 @@
    for ac_func in access stat mkdir rename rmdir unlink realpath
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2884: checking for $ac_func" >&5
+echo "configure:2912: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2889 "configure"
+#line 2917 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2908,7 +2936,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2912: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2935,12 +2963,12 @@
    for ac_func in inet_aton inet_addr
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2939: checking for $ac_func" >&5
+echo "configure:2967: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2944 "configure"
+#line 2972 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2963,7 +2991,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2990,12 +3018,12 @@
    for ac_func in inet_pton uname inet_ntoa
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2994: checking for $ac_func" >&5
+echo "configure:3022: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2999 "configure"
+#line 3027 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3018,7 +3046,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3046,12 +3074,12 @@
    for ac_func in gethostbyname_r
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3050: checking for $ac_func" >&5
+echo "configure:3078: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3055 "configure"
+#line 3083 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3074,7 +3102,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3101,7 +3129,7 @@
      # We look for the one that returns `int'.
      # Hopefully this check is robust enough.
      cat > conftest.$ac_ext <<EOF
-#line 3105 "configure"
+#line 3133 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 EOF
@@ -3121,7 +3149,7 @@
      *" -D_REENTRANT "*) ;;
      *)
 		echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6
-echo "configure:3125: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
+echo "configure:3153: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
 if eval "test \"`echo '$''{'libjava_cv_gethostbyname_r_needs_reentrant'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3134,14 +3162,14 @@
 cross_compiling=$ac_cv_prog_cxx_cross
 
 	  cat > conftest.$ac_ext <<EOF
-#line 3138 "configure"
+#line 3166 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 gethostbyname_r("", 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:3145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   libjava_cv_gethostbyname_r_needs_reentrant=no
 else
@@ -3151,14 +3179,14 @@
   		CPPFLAGS_SAVE="$CPPFLAGS"
 		CPPFLAGS="$CPPFLAGS -D_REENTRANT"
 		cat > conftest.$ac_ext <<EOF
-#line 3155 "configure"
+#line 3183 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 gethostbyname_r("", 0, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:3162: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   libjava_cv_gethostbyname_r_needs_reentrant=yes
 else
@@ -3193,12 +3221,12 @@
      esac
 
      echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6
-echo "configure:3197: checking for struct hostent_data" >&5
+echo "configure:3225: checking for struct hostent_data" >&5
 if eval "test \"`echo '$''{'libjava_cv_struct_hostent_data'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   	cat > conftest.$ac_ext <<EOF
-#line 3202 "configure"
+#line 3230 "configure"
 #include "confdefs.h"
 
 #if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
@@ -3209,7 +3237,7 @@
 struct hostent_data data;
 ; return 0; }
 EOF
-if { (eval echo configure:3213: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   libjava_cv_struct_hostent_data=yes
 else
@@ -3238,12 +3266,12 @@
    for ac_func in gethostbyaddr_r
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3242: checking for $ac_func" >&5
+echo "configure:3270: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3247 "configure"
+#line 3275 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3266,7 +3294,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3293,7 +3321,7 @@
      # We look for the one that returns `int'.
      # Hopefully this check is robust enough.
      cat > conftest.$ac_ext <<EOF
-#line 3297 "configure"
+#line 3325 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 EOF
@@ -3317,12 +3345,12 @@
    for ac_func in gethostname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3321: checking for $ac_func" >&5
+echo "configure:3349: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3326 "configure"
+#line 3354 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3345,7 +3373,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3369,7 +3397,7 @@
 EOF
 
      cat > conftest.$ac_ext <<EOF
-#line 3373 "configure"
+#line 3401 "configure"
 #include "confdefs.h"
 #include <unistd.h>
 EOF
@@ -3396,12 +3424,12 @@
    for ac_func in pthread_mutexattr_settype pthread_mutexattr_setkind_np
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3400: checking for $ac_func" >&5
+echo "configure:3428: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3405 "configure"
+#line 3433 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3424,7 +3452,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3454,12 +3482,12 @@
    for ac_func in sched_yield
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3458: checking for $ac_func" >&5
+echo "configure:3486: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3463 "configure"
+#line 3491 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3482,7 +3510,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3504,7 +3532,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:3508: checking for sched_yield in -lposix4" >&5
+echo "configure:3536: checking for sched_yield in -lposix4" >&5
 ac_lib_var=`echo posix4'_'sched_yield | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3512,7 +3540,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lposix4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3516 "configure"
+#line 3544 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3523,7 +3551,7 @@
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:3527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3548,7 +3576,7 @@
   echo "$ac_t""no" 1>&6
 
        echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:3552: checking for sched_yield in -lrt" >&5
+echo "configure:3580: checking for sched_yield in -lrt" >&5
 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3556,7 +3584,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3560 "configure"
+#line 3588 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3567,7 +3595,7 @@
 sched_yield()
 ; return 0; }
 EOF
-if { (eval echo configure:3571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3604,12 +3632,12 @@
    for ac_func in gettimeofday time ftime
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3608: checking for $ac_func" >&5
+echo "configure:3636: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3613 "configure"
+#line 3641 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3632,7 +3660,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3663,12 +3691,12 @@
    for ac_func in memmove
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3667: checking for $ac_func" >&5
+echo "configure:3695: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3672 "configure"
+#line 3700 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3691,7 +3719,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3695: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3721,12 +3749,12 @@
    for ac_func in memcpy
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3725: checking for $ac_func" >&5
+echo "configure:3753: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3730 "configure"
+#line 3758 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3749,7 +3777,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3781: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3797,7 +3825,7 @@
    #--------------------------------------------------------------------
 
    echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
-echo "configure:3801: checking for socket libraries" >&5
+echo "configure:3829: checking for socket libraries" >&5
 if eval "test \"`echo '$''{'gcj_cv_lib_sockets'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3805,12 +3833,12 @@
      gcj_checkBoth=0
      unset ac_cv_func_connect
      echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:3809: checking for connect" >&5
+echo "configure:3837: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3814 "configure"
+#line 3842 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -3833,7 +3861,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -3856,7 +3884,7 @@
      if test "$gcj_checkSocket" = 1; then
 	 unset ac_cv_func_connect
 	 echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
-echo "configure:3860: checking for main in -lsocket" >&5
+echo "configure:3888: checking for main in -lsocket" >&5
 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3864,14 +3892,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3868 "configure"
+#line 3896 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3898,12 +3926,12 @@
 	 LIBS="$LIBS -lsocket -lnsl"
 	 unset ac_cv_func_accept
 	 echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:3902: checking for accept" >&5
+echo "configure:3930: checking for accept" >&5
 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3907 "configure"
+#line 3935 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char accept(); below.  */
@@ -3926,7 +3954,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_accept=yes"
 else
@@ -3953,12 +3981,12 @@
      gcj_oldLibs=$LIBS
      LIBS="$LIBS $gcj_cv_lib_sockets"
      echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3957: checking for gethostbyname" >&5
+echo "configure:3985: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3962 "configure"
+#line 3990 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -3981,7 +4009,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -3999,7 +4027,7 @@
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
-echo "configure:4003: checking for main in -lnsl" >&5
+echo "configure:4031: checking for main in -lnsl" >&5
 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4007,14 +4035,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4011 "configure"
+#line 4039 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4018: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4046: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4044,9 +4072,13 @@
 echo "$ac_t""$gcj_cv_lib_sockets" 1>&6
    SYSTEMSPEC="$SYSTEMSPEC $gcj_cv_lib_sockets"
 
+   if test "$enable_interpreter" = yes; then
+      INTERPSPEC=
+   fi
+
    if test "$with_system_zlib" = yes; then
       echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:4050: checking for deflate in -lz" >&5
+echo "configure:4082: checking for deflate in -lz" >&5
 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4054,7 +4086,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4058 "configure"
+#line 4090 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4065,7 +4097,7 @@
 deflate()
 ; return 0; }
 EOF
-if { (eval echo configure:4069: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4094,7 +4126,7 @@
    # requires -ldl.
    if test "$GC" = boehm; then
       echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6
-echo "configure:4098: checking for main in -ldl" >&5
+echo "configure:4130: checking for main in -ldl" >&5
 ac_lib_var=`echo dl'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4102,14 +4134,14 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4106 "configure"
+#line 4138 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:4113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4219,17 +4251,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4223: checking for $ac_hdr" >&5
+echo "configure:4255: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4228 "configure"
+#line 4260 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4259,17 +4291,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4263: checking for $ac_hdr" >&5
+echo "configure:4295: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4268 "configure"
+#line 4300 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4273: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4305: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -4297,16 +4329,16 @@
 
 
 echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:4301: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo "configure:4333: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4303 "configure"
+#line 4335 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 int main() {
 struct sockaddr_in6 addr6;
 ; return 0; }
 EOF
-if { (eval echo configure:4310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4342: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_INET6 1
@@ -4322,16 +4354,16 @@
 rm -f conftest*
 
 echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:4326: checking for socklen_t in sys/socket.h" >&5
+echo "configure:4358: checking for socklen_t in sys/socket.h" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4328 "configure"
+#line 4360 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 int main() {
 socklen_t x = 5;
 ; return 0; }
 EOF
-if { (eval echo configure:4335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4367: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_SOCKLEN_T 1
@@ -4347,16 +4379,16 @@
 rm -f conftest*
 
 echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:4351: checking for tm_gmtoff in struct tm" >&5
+echo "configure:4383: checking for tm_gmtoff in struct tm" >&5
 cat > conftest.$ac_ext <<EOF
-#line 4353 "configure"
+#line 4385 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 struct tm tim; tim.tm_gmtoff = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:4360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4392: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define STRUCT_TM_HAS_GMTOFF 1
@@ -4369,16 +4401,16 @@
   rm -rf conftest*
   echo "$ac_t""no" 1>&6
    echo $ac_n "checking for global timezone variable""... $ac_c" 1>&6
-echo "configure:4373: checking for global timezone variable" >&5
+echo "configure:4405: checking for global timezone variable" >&5
             cat > conftest.$ac_ext <<EOF
-#line 4375 "configure"
+#line 4407 "configure"
 #include "confdefs.h"
 #include <time.h>
 int main() {
 long z2 = timezone;
 ; return 0; }
 EOF
-if { (eval echo configure:4382: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   cat >> confdefs.h <<\EOF
 #define HAVE_TIMEZONE 1
@@ -4398,19 +4430,19 @@
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:4402: checking for working alloca.h" >&5
+echo "configure:4434: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4407 "configure"
+#line 4439 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:4414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -4431,12 +4463,12 @@
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:4435: checking for alloca" >&5
+echo "configure:4467: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4440 "configure"
+#line 4472 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -4464,7 +4496,7 @@
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:4468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -4496,12 +4528,12 @@
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:4500: checking whether alloca needs Cray hooks" >&5
+echo "configure:4532: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4505 "configure"
+#line 4537 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -4526,12 +4558,12 @@
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4530: checking for $ac_func" >&5
+echo "configure:4562: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4535 "configure"
+#line 4567 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4554,7 +4586,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4581,7 +4613,7 @@
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:4585: checking stack direction for C alloca" >&5
+echo "configure:4617: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4589,7 +4621,7 @@
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 4593 "configure"
+#line 4625 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -4608,7 +4640,7 @@
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:4612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -4635,7 +4667,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:4639: checking for $ac_word" >&5
+echo "configure:4671: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4868,6 +4900,7 @@
 s%@COMPPATH@%$COMPPATH%g
 s%@TESTSUBDIR_TRUE@%$TESTSUBDIR_TRUE%g
 s%@TESTSUBDIR_FALSE@%$TESTSUBDIR_FALSE%g
+s%@INTERPSPEC@%$INTERPSPEC%g
 s%@CPP@%$CPP%g
 s%@SYSTEMSPEC@%$SYSTEMSPEC%g
 s%@ZLIBSPEC@%$ZLIBSPEC%g
Index: configure.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/configure.in,v
retrieving revision 1.18
diff -u -r1.18 configure.in
--- configure.in	1999/08/06 20:36:46	1.18
+++ configure.in	1999/08/08 13:46:36
@@ -42,6 +42,17 @@
      AC_DEFINE(DEBUG)
   fi)
 
+dnl See if the user has the enterpreter included.
+AC_ARG_ENABLE(interpreter,
+[  --enable-interpreter            Enable interpreter],
+  if test "$enable_interpreter" = yes; then
+     AC_DEFINE(INTERPRETER)
+  fi)
+
+dnl This becomes -lffi if the interpreter is enables
+INTERPSPEC=
+AC_SUBST(INTERPSPEC)
+
 dnl If the target is an eCos system, use the appropriate eCos
 dnl I/O routines.
 dnl FIXME: this should not be a local option but a global target
@@ -446,6 +457,10 @@
      LIBS=$gcj_oldLIBS
    ])
    SYSTEMSPEC="$SYSTEMSPEC $gcj_cv_lib_sockets"
+
+   if test "$enable_interpreter" = yes; then
+      INTERPSPEC=
+   fi
 
    if test "$with_system_zlib" = yes; then
       AC_CHECK_LIB(z, deflate, ZLIBSPEC=-lz, ZLIBSPEC=-lzgcj)
Index: libgcj.spec.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/libgcj.spec.in,v
retrieving revision 1.3
diff -u -r1.3 libgcj.spec.in
--- libgcj.spec.in	1999/07/21 15:11:55	1.3
+++ libgcj.spec.in	1999/08/08 13:46:36
@@ -4,7 +4,7 @@
 # to link with libgcj.
 #
 %rename lib liborig
-*lib: -lgcj -lm @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(liborig)
+*lib: -lgcj -lm @INTERPSPEC@ @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(liborig)
 
 %rename cc1 cc1orig
 *cc1:  @DIVIDESPEC@ %(cc1orig)
Index: prims.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/prims.cc,v
retrieving revision 1.6
diff -u -r1.6 prims.cc
--- prims.cc	1999/07/21 15:11:55	1.6
+++ prims.cc	1999/08/08 13:46:38
@@ -180,6 +180,24 @@
   return (m);
 }
 
+_Jv_Utf8Const *
+_Jv_makeUtf8Const (jstring string)
+{
+  jint hash = string->hashCode ();
+  jint len = _Jv_GetStringUTFLength (string);
+
+  Utf8Const* m = (Utf8Const*)
+    _Jv_AllocBytesChecked (sizeof(Utf8Const) + len + 1);
+
+  m->hash = hash;
+  m->length = len;
+
+  _Jv_GetStringUTFRegion (string, 0, string->length (), m->data);
+  m->data[len] = 0;
+  
+  return m;
+}
+
 
 
 #ifdef DEBUG
@@ -298,7 +316,10 @@
     JvThrow (no_memory);
 
   size_t size = count * sizeof (jobject) + sizeof (__JArray);
-  jclass clas = _Jv_FindArrayClass (elementClass);
+
+  // FIXME: second argument should be "current loader" //
+  jclass clas = _Jv_FindArrayClass (elementClass, 0);
+
   jobjectArray obj = (jobjectArray) _Jv_AllocArray (size);
   if (! obj)
     JvThrow (no_memory);
@@ -338,7 +359,7 @@
   arr->length = count;
   // Note that we assume we are given zeroed memory by the allocator.
 
-  jclass klass = _Jv_FindArrayClass (eltype);
+  jclass klass = _Jv_FindArrayClass (eltype, 0);
   // Set the vtbl last to avoid problems if the GC happens during the
   // window in this function between the allocation and this
   // assignment.
@@ -531,9 +552,11 @@
 	  ;
 	_Jv_Utf8Const *name = _Jv_makeUtf8Const (&sig[1], i - 1);
 	return _Jv_FindClass (name, loader);
+
       }
     case '[':
-      return _Jv_FindArrayClass (_Jv_FindClassFromSignature (&sig[1], loader));
+      return _Jv_FindArrayClass (_Jv_FindClassFromSignature (&sig[1], loader),
+				 loader);
     }
   JvFail ("couldn't understand class signature");
   return NULL;			// Placate compiler.
@@ -588,9 +611,20 @@
   LTDL_SET_PRELOADED_SYMBOLS ();
 #endif
 
-  arg_vec = JvConvertArgv (argc - 1, argv + 1);
-  main_group = new java::lang::ThreadGroup (23);
-  main_thread = new java::lang::FirstThread (main_group, klass, arg_vec);
+  if (klass == NULL)
+    {
+      arg_vec = JvConvertArgv (argc - 2, argv + 2);
+      main_group = new java::lang::ThreadGroup (23);
+      main_thread = new java::lang::FirstThread (main_group,
+						 JvNewStringLatin1 (argv[1]),
+						 arg_vec);
+    }
+  else
+    {
+      arg_vec = JvConvertArgv (argc - 1, argv + 1);
+      main_group = new java::lang::ThreadGroup (23);
+      main_thread = new java::lang::FirstThread (main_group, klass, arg_vec);
+    }
 
   main_thread->start();
   _Jv_ThreadWait ();
@@ -598,6 +632,7 @@
   java::lang::Runtime::getRuntime ()->exit (0);
 }
 
+
 
 
 void *
@@ -630,7 +665,7 @@
   if (divisor == 0)
     _Jv_Throw (arithexception);
   
-  if (dividend == 0x80000000L && divisor == -1)
+  if (dividend == (jint) 0x80000000L && divisor == -1)
     return dividend;
 
   return dividend / divisor;
@@ -642,7 +677,7 @@
   if (divisor == 0)
     _Jv_Throw (arithexception);
   
-  if (dividend == 0x80000000L && divisor == -1)
+  if (dividend == (jint) 0x80000000L && divisor == -1)
     return 0;
 
   return dividend % divisor;
@@ -654,7 +689,7 @@
   if (divisor == 0)
     _Jv_Throw (arithexception);
   
-  if (dividend == 0x8000000000000000LL && divisor == -1)
+  if (dividend == (jlong) 0x8000000000000000LL && divisor == -1)
     return dividend;
 
   return dividend / divisor;
@@ -666,9 +701,15 @@
   if (divisor == 0)
     _Jv_Throw (arithexception);
   
-  if (dividend == 0x8000000000000000LL && divisor == -1)
+  if (dividend == (jlong) 0x8000000000000000LL && divisor == -1)
     return 0;
 
   return dividend % divisor;
 }
+
+
+
+
+
+
 
Index: include/config.h.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/include/config.h.in,v
retrieving revision 1.6
diff -u -r1.6 config.h.in
--- config.h.in	1999/08/01 23:39:53	1.6
+++ config.h.in	1999/08/08 13:46:39
@@ -106,6 +106,9 @@
 #undef HAVE_GETHOSTBYNAME_R
 #undef HAVE_GETHOSTBYADDR_R
 
+/* Define if you want a bytecode interpreter.  */
+#undef INTERPRETER
+
 /* Define if you have the access function.  */
 #undef HAVE_ACCESS
 
Index: include/java-field.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/include/java-field.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 java-field.h
--- java-field.h	1999/04/07 14:52:34	1.1.1.1
+++ java-field.h	1999/08/08 13:46:39
@@ -53,7 +53,18 @@
 
   jfieldID getNextInstanceField () { return this + 1; }
 
-  jboolean isRef () { return ! isResolved () || ! type->isPrimitive (); }
+  jboolean isRef () 
+    { 
+      if (!isResolved ()) 
+	{
+	  char first = ((_Jv_Utf8Const*)type)->data[0]; 
+	  return first == '[' || first == 'L';
+	}
+      else
+	{
+	  return ! type->isPrimitive ();
+	}
+    }
 
   // FIXME - may need to mask off internal flags.
   int getModifiers() { return flags; }
Index: include/javaprims.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/include/javaprims.h,v
retrieving revision 1.5
diff -u -r1.5 javaprims.h
--- javaprims.h	1999/05/18 15:32:55	1.5
+++ javaprims.h	1999/08/08 13:46:39
@@ -162,6 +162,7 @@
       class VerifyError;
       class VirtualMachineError;
       class Void;
+      class VMClassLoader;
       namespace reflect
       {
         class AccessibleObject;
Index: include/jvm.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/include/jvm.h,v
retrieving revision 1.2
diff -u -r1.2 jvm.h
--- jvm.h	1999/07/21 15:11:56	1.2
+++ jvm.h	1999/08/08 13:46:40
@@ -40,6 +40,8 @@
 
 typedef struct _Jv_Utf8Const Utf8Const;
 _Jv_Utf8Const *_Jv_makeUtf8Const (char *s, int len);
+_Jv_Utf8Const *_Jv_makeUtf8TypeConst (char* s, int len);
+_Jv_Utf8Const *_Jv_makeUtf8Const (jstring string);
 extern jboolean _Jv_equalUtf8Consts (_Jv_Utf8Const *, _Jv_Utf8Const *);
 extern jboolean _Jv_equal (_Jv_Utf8Const *, jstring, jint);
 
@@ -91,6 +93,8 @@
 extern "C" void _Jv_CheckArrayStore (jobject array, jobject obj);
 extern "C" void _Jv_RegisterClass (jclass klass);
 extern "C" void _Jv_RegisterClasses (jclass *classes);
+extern void _Jv_UnregisterClass (_Jv_Utf8Const*, java::lang::ClassLoader*);
+
 extern jclass _Jv_FindClass (_Jv_Utf8Const *name,
 			     java::lang::ClassLoader *loader);
 extern jclass _Jv_FindClassFromSignature (char *,
Index: java/lang/Class.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/Class.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Class.h
--- Class.h	1999/04/07 14:52:37	1.1.1.1
+++ Class.h	1999/08/08 13:46:40
@@ -21,25 +21,30 @@
 extern "C" void _Jv_InitClass (jclass klass);
 extern "C" void _Jv_RegisterClasses (jclass *classes);
 
+// These are the possible values for the `state' field of the class
+// structure.  Note that ordering is important here; in particular
+// `resolved' must come between `nothing' and the other states.
+// Whenever the state changes, one should notify all waiters of this
+// class.
+#define JV_STATE_NOTING        0 // set by compiler
+
+#define JV_STATE_PRELOADING    1 // can do _Jv_FindClass
+#define JV_STATE_LOADING       3 // has super installed
+#define JV_STATE_LOADED        5 // is complete
+    
+#define JV_STATE_COMPILED      6 // this was a compiled class
+
+#define JV_STATE_PREPARED      7 // layout & static init done
+#define JV_STATE_LINKED        9 // strings interned
+
+#define JV_STATE_IN_PROGRESS  10 // <clinit> running
+#define JV_STATE_DONE         12 // 
+
+#define JV_STATE_ERROR        14 // must be last
+
 struct _Jv_Field;
 struct _Jv_VTable;
 
-#define CONSTANT_Class 7
-#define CONSTANT_Fieldref 9
-#define CONSTANT_Methodref 10
-#define CONSTANT_InterfaceMethodref 11
-#define CONSTANT_String 8
-#define CONSTANT_Integer 3
-#define CONSTANT_Float 4
-#define CONSTANT_Long 5
-#define CONSTANT_Double 6
-#define CONSTANT_NameAndType 12
-#define CONSTANT_Utf8 1
-#define CONSTANT_Unicode 2
-#define CONSTANT_ResolvedFlag 16
-#define CONSTANT_ResolvedString    (CONSTANT_String+CONSTANT_ResolvedFlag)
-#define CONSTANT_ResolvedClass     (CONSTANT_Class+CONSTANT_ResolvedFlag)
-
 struct _Jv_Constants
 {
   jint size;
@@ -134,9 +139,11 @@
       return size_in_bytes;
     }
 
+  // finalization
+  void finalize ();
+
 private:
   void checkMemberAccess (jint flags);
-  void resolveConstants (void);
 
   // Various functions to handle class initialization.
   java::lang::Throwable *hackTrampoline (jint, java::lang::Throwable *);
@@ -147,12 +154,6 @@
   friend _Jv_Method *_Jv_GetMethodLocal (jclass klass, _Jv_Utf8Const *name,
 					 _Jv_Utf8Const *signature);
   friend void _Jv_InitClass (jclass klass);
-  friend void _Jv_RegisterClasses (jclass *classes);
-  friend jclass _Jv_FindClassInCache (_Jv_Utf8Const *name,
-				      java::lang::ClassLoader *loader);
-  friend jclass _Jv_FindArrayClass (jclass element);
-  friend jclass _Jv_NewClass (_Jv_Utf8Const *name, jclass superclass,
-			      java::lang::ClassLoader *loader);
 
   friend jfieldID JvGetFirstInstanceField (jclass);
   friend jint JvNumInstanceFields (jclass);
@@ -164,6 +165,41 @@
   friend jmethodID _Jv_FromReflectedMethod (java::lang::reflect::Method *);
 
   friend class _Jv_PrimClass;
+
+  // Friends classes and functions to implement the ClassLoader
+  friend class java::lang::ClassLoader;
+
+  friend void _Jv_WaitForState (jclass, int);
+  friend void _Jv_RegisterClasses (jclass *classes);
+  friend void _Jv_RegisterInitiatingLoader (jclass,java::lang::ClassLoader*);
+  friend void _Jv_UnregisterClass (jclass);
+  friend jclass _Jv_FindClass (_Jv_Utf8Const *name,
+			       java::lang::ClassLoader *loader);
+  friend jclass _Jv_FindClassInCache (_Jv_Utf8Const *name,
+				      java::lang::ClassLoader *loader);
+  friend jclass _Jv_FindArrayClass (jclass element,
+				    java::lang::ClassLoader *loader);
+  friend jclass _Jv_NewClass (_Jv_Utf8Const *name, jclass superclass,
+			      java::lang::ClassLoader *loader);
+
+  friend void _Jv_InternClassStrings (jclass);
+
+#ifdef INTERPRETER
+  friend jboolean _Jv_IsInterpretedClass (jclass);
+  friend void _Jv_InitField (jobject, jclass, _Jv_Field*);
+  friend _Jv_Method* _Jv_LookupDeclaredMethod (jclass, _Jv_Utf8Const *, 
+					       _Jv_Utf8Const*);
+  friend int _Jv_DetermineVTableIndex (jclass, _Jv_Utf8Const *, 
+				       _Jv_Utf8Const*);
+  friend void _Jv_InitField (jobject, jclass, int);
+  friend void* _Jv_ResolvePoolEntry (jclass, int);
+  friend void _Jv_PrepareClass (jclass);
+
+  friend class _Jv_ClassReader;	
+  friend class _Jv_InterpClass;
+  friend class _Jv_InterpMethod;
+  friend class _Jv_InterpMethodInvocation;
+#endif
 
 #ifdef JV_MARKOBJ_DECL
   friend JV_MARKOBJ_DECL;
Index: java/lang/Class.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/Class.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Class.java
--- Class.java	1999/04/07 14:52:37	1.1.1.1
+++ Class.java	1999/08/08 13:46:41
@@ -152,4 +152,7 @@
 
   // Initialize the class.
   private native void initializeClass ();
+
+  // finalization
+  protected native void finalize ();
 }
Index: java/lang/ClassLoader.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/ClassLoader.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 ClassLoader.java
--- ClassLoader.java	1999/04/07 14:52:37	1.1.1.1
+++ ClassLoader.java	1999/08/08 13:46:42
@@ -9,86 +9,394 @@
 details.  */
 
 package java.lang;
+
 import java.io.InputStream;
-import java.util.Hashtable;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Stack;
 
 /**
- * @author Tom Tromey <tromey@cygnus.com>
- * @date October 28, 1998 
+ * The class <code>ClassLoader</code> is intended to be subclassed by
+ * applications in order to describe new ways of loading classes,
+ * such as over the network.
+ *
+ * @author  Kresten Krab Thorup
  */
 
 /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
  * Status: Just a stub; not useful at all.
  */
-
-public abstract class ClassLoader
-{
-  protected ClassLoader ()
-    {
-      cache = new Hashtable ();
-    }
-
-  protected final Class defineClass (String className, byte[] bytecode,
-				     int offset, int length)
-    {
-      throw new ClassFormatError ("defineClass unimplemented");
-    }
-
-  protected final Class defineClass (byte[] bytecodes,
-				     int offset, int length)
-    {
-      return defineClass (null, bytecodes, offset, length);
-    }
-
-  protected final Class findLoadedClass (String className)
-    {
-      return (Class) cache.get(className);
-    }
-
-  protected final Class findSystemClass (String className)
-    throws ClassNotFoundException
-    {
-      Class c = system.findLoadedClass(className);
-      system.resolveClass(c);
-      return c;
-    }
 
-  // FIXME: Needs URL.
-  // public URL getResource (String resName);
+public abstract class ClassLoader {
 
-  public InputStream getResourceAsStream (String resName)
-    {
-      return null;
+  static private ClassLoader system;
+    
+  private static native ClassLoader getVMClassLoader0 ();
+
+  static public ClassLoader getSystemClassLoader () {
+    if (system == null)
+      system = getVMClassLoader0 ();
+    return system;
+  }
+
+  /**
+   * Creates a <code>ClassLoader</code>.   The only thing this
+   * constructor does, is to call
+   * <code>checkCreateClassLoader</code> on the current 
+   * security manager. 
+   * @exception java.lang.SecurityException if not allowed
+   */
+  protected ClassLoader() 
+  {
+    SecurityManager security = System.getSecurityManager ();
+    if (security != null)
+      security.checkCreateClassLoader ();
+  }
+
+  /** 
+   * Loads and link the class by the given name.
+   * @param     name the name of the class.
+   * @return    the class loaded.
+   * @see       ClassLoader#loadClass(String,boolean)
+   * @exception java.lang.ClassNotFoundException 
+   */ 
+  public Class loadClass(String name) 
+    throws java.lang.ClassNotFoundException, java.lang.LinkageError
+  { 
+    return loadClass (name, true);
+  }
+
+  /** 
+   * Loads the class by the given name.  
+   * As per java 1.1, this has been deprecated.  Use 
+   * <code>loadClass(String)</code>
+   * instead.
+   * @param     name the name of the class.
+   * @param     link if the class should be linked.
+   * @return    the class loaded.
+   * @exception java.lang.ClassNotFoundException 
+   * @deprecated 
+   */ 
+  protected abstract Class loadClass(String name, boolean link)
+    throws java.lang.ClassNotFoundException, java.lang.LinkageError;
+
+  /** 
+   * Defines a class, given the class-data.  According to the JVM, this
+   * method should not be used; instead use the variant of this method
+   * in which the name of the class being defined is specified
+   * explicitly.   
+   * <P>
+   * If the name of the class, as specified (implicitly) in the class
+   * data, denotes a class which has already been loaded by this class
+   * loader, an instance of
+   * <code>java.lang.ClassNotFoundException</code> will be thrown.
+   *
+   * @param     data    bytes in class file format.
+   * @param     off     offset to start interpreting data.
+   * @param     len     length of data in class file.
+   * @return    the class defined.
+   * @exception java.lang.ClassNotFoundException 
+   * @exception java.lang.LinkageError
+   * @see ClassLoader#defineClass(String,byte[],int,int) */
+  protected final Class defineClass(byte[] data, int off, int len) 
+    throws java.lang.ClassNotFoundException, java.lang.LinkageError
+  {
+    return defineClass (null, data, off, len);
+  }
+
+  /** 
+   * Defines a class, given the class-data.  This is preferable
+   * over <code>defineClass(byte[],off,len)</code> since it is more
+   * secure.  If the expected name does not match that of the class
+   * file, <code>ClassNotFoundException</code> is thrown.  If
+   * <code>name</code> denotes the name of an already loaded class, a
+   * <code>LinkageError</code> is thrown.
+   * <p>
+   * 
+   * FIXME: How do we assure that the class-file data is not being
+   * modified, simultaneously with the class loader running!?  If this
+   * was done in some very clever way, it might break security.  
+   * Right now I am thinking that defineclass should make sure never to
+   * read an element of this array more than once, and that that would
+   * assure the ``immutable'' appearance.  It is still to be determined
+   * if this is in fact how defineClass operates.
+   *
+   * @param     name    the expected name.
+   * @param     data    bytes in class file format.
+   * @param     off     offset to start interpreting data.
+   * @param     len     length of data in class file.
+   * @return    the class defined.
+   * @exception java.lang.ClassNotFoundException 
+   * @exception java.lang.LinkageError
+   */
+  protected final synchronized Class defineClass(String name,
+						 byte[] data,
+						 int off,
+						 int len)
+    throws java.lang.ClassNotFoundException, java.lang.LinkageError
+  {
+    if (data==null || data.length < off+len || off<0 || len<0)
+      throw new ClassFormatError ("arguments to defineClass "
+				  + "are meaningless");
+
+    // as per 5.3.5.1
+    if (name != null  &&  findLoadedClass (name) != null)
+      throw new java.lang.LinkageError ("class " 
+					+ name 
+					+ " already loaded");
+
+    try {
+      // Since we're calling into native code here, 
+      // we better make sure that any generated
+      // exception is to spec!
+
+      return defineClass0 (name, data, off, len);
+
+    } catch (java.lang.LinkageError x) {
+      throw x;		// rethrow
+
+    } catch (java.lang.ClassNotFoundException x) {
+      throw x;		// rethrow
+
+    } catch (java.lang.VirtualMachineError x) {
+      throw x;		// rethrow
+
+    } catch (java.lang.Throwable x) {
+      // This should never happen, or we are beyond spec.  
+      
+      throw new InternalError ("Unexpected exception "
+			       + "while defining class "
+			       + name + ": " 
+			       + x.toString ());
+     }
+  }
+
+  /** This is the entry point of defineClass into the native code */
+  private native Class defineClass0 (String name,
+				     byte[] data,
+				     int off,
+				     int len)
+    throws java.lang.ClassNotFoundException, java.lang.LinkageError;
+
+
+  /** This is called by defineClass0, once the "raw" and uninitialized
+   * class object has been created, and handles exceptions generated
+   * while actually defining the class (_Jv_DefineClass).  defineClass0
+   * holds the lock on the new class object, so it needs to capture
+   * these exceptions.  */
+
+  private static Throwable defineClass1 (Class klass, byte[] data,
+					 int offset, int length)
+  {
+    try {
+      defineClass2 (klass, data, offset, length);
+    } catch (Throwable x) {
+      return x;
     }
-
-  // FIXME: Needs URL.
-  // public static final URL getSystemResource (String resName);
-
-  public static final InputStream getSystemResourceAsStream (String resName)
-    {
+    return null;
+  }
+ 
+  /** This is just a wrapper for _Jv_DefineClass */
+  private static native void defineClass2 (Class klass, byte[] data, 
+				    int offset, int length)
+    throws Throwable;
+
+  /** 
+   * Link the given class.  This will bring the class to a state where
+   * the class initializer can be run.  Linking involves the following
+   * steps: 
+   * <UL>
+   * <LI>  Prepare (allocate and internalize) the constant strings that
+   *       are used in this class.
+   * <LI>  Allocate storage for static fields, and define the layout
+   *       of instance fields.
+   * <LI>  Perform static initialization of ``static final'' int,
+   *       long, float, double and String fields for which there is a
+   *       compile-time constant initializer.
+   * <LI>  Create the internal representation of the ``vtable''.
+   * </UL>
+   * For <code>gcj</code>-compiled classes, only the first step is
+   * performed.  The compiler will have done the rest already.
+   * <P>
+   * This is called by the system automatically,
+   * as part of class initialization; there is no reason to ever call
+   * this method directly.  
+   * <P> 
+   * For historical reasons, this method has a name which is easily
+   * misunderstood.  Java classes are never ``resolved''.  Classes are
+   * linked; whereas method and field references are resolved.
+   * <P>
+   * FIXME: The JDK documentation declares this method
+   * <code>final</code>, we declare it <code>static</code> -- any
+   * objections?  This allows us to call it directly from native code
+   * with less hassle. 
+   *
+   * @param     clazz the class to link.
+   * @exception java.lang.LinkageError
+   */
+  protected static void resolveClass(Class clazz)
+    throws java.lang.LinkageError
+  {
+    synchronized (clazz)
+      {
+	try {
+	  linkClass0 (clazz);
+	} catch (Throwable x) {
+	  markClassErrorState0 (clazz);
+
+	  if (x instanceof Error)
+	    throw (Error)x;
+	  else    
+	    throw new java.lang.InternalError
+	      ("unexpected exception during linking: " + x);
+	}
+      }
+  }
+
+  /** Internal method.  Calls _Jv_PrepareClass and
+   * _Jv_InternClassStrings.  This is only called from resolveClass.  */ 
+  private static native void linkClass0(Class clazz)
+    throws java.lang.LinkageError;
+
+  /** Internal method.  Marks the given clazz to be in an erroneous
+   * state, and calls notifyAll() on the class object.  This should only
+   * be called when the caller has the lock on the class object.  */
+  private static native void markClassErrorState0(Class clazz);
+
+
+  /** 
+   * Returns a class found in a system-specific way, typically
+   * via the <code>java.class.path</code> system property.  
+   *
+   * @param     name the class to resolve.
+   * @return    the class loaded.
+   * @exception java.lang.LinkageError 
+   * @exception java.lang.ClassNotFoundException 
+   */
+  protected native static Class findSystemClass(String name) 
+    throws java.lang.ClassNotFoundException, java.lang.LinkageError;
+
+  /*
+   * Does currently nothing.
+   */ 
+  protected final void setSigners(Class claz, Object[] signers) {
+    /* claz.setSigners (signers); */
+  }
+
+  /*
+   * If a class named <code>name</code> was previously loaded using
+   * this <code>ClassLoader</code>, then it is returned.  Otherwise
+   * it returns <code>null</code>.
+   * @param     name  class to find.
+   * @return    the class loaded, or null.
+   */ 
+  protected native Class findLoadedClass(String name);
+
+  public static final InputStream getSystemResourceAsStream(String name) {
+    return system.getResourceAsStream (name);
+  }
+
+  public static final URL getSystemResource(String name) {
+    return system.getResource (name);
+  }
+
+  public static final byte[] getSystemResourceAsBytes(String name) {
+    return system.getResourceAsBytes (name);
+  }
+
+  /**
+   *   Return an InputStream representing the resource name.  
+   *   This is essentially like 
+   *   <code>getResource(name).openStream()</code>, except
+   *   it masks out any IOException and returns null on failure.
+   * @param   name  resource to load
+   * @return  an InputStream, or null
+   * @see     java.lang.ClassLoader#getResource(String)
+   * @see     java.lang.ClassLoader#getResourceAsBytes(String)
+   * @see     java.io.InputStream
+   */
+  public InputStream getResourceAsStream(String name) 
+  {
+    try {
+      URL res = getResource (name);
+      if (res == null) return null;
+      return res.openStream ();
+    } catch (java.io.IOException x) {
+       return null;
+     }
+  }
+ 
+  /**
+   *  Return a byte array <code>byte[]</code> representing the
+   *  resouce <code>name</code>.  This only works for resources
+   *  that have a known <code>content-length</code>, and
+   *  it will block while loading the resource.  Returns null
+   *  for error conditions.<p>
+   *  Since it is synchroneous, this is only convenient for 
+   *  resources that are "readily" available.  System resources
+   *  can conveniently be loaded this way, and the runtime
+   *  system uses this to load class files.  <p>
+   *  To find the class data for a given class, use
+   *  something like the following:
+   *  <ul><code>
+   *  String res = clazz.getName().replace ('.', '/')) + ".class";<br>
+   *  byte[] data = getResourceAsBytes (res);
+   *  </code></ul>
+   * @param   name  resource to load
+   * @return  a byte array, or null
+   * @see     java.lang.ClassLoader#getResource(String)
+   * @see     java.lang.ClassLoader#getResourceAsStream(String)
+   */
+  public byte[] getResourceAsBytes(String name) {
+    try {
+      URL res = getResource (name);
+      if (res == null) return null;
+      URLConnection conn = res.openConnection ();
+      int len = conn.getContentLength ();
+      if (len == -1) return null;
+      return readbytes (conn.getInputStream (), len);
+    } catch (java.io.IOException x) {
+       return null;
+     }
+  }
+ 
+  /**
+   * Return an java.io.URL representing the resouce <code>name</code>.  
+   * @param   name  resource to load
+   * @return  a URL, or null if there is no such resource.
+   * @see     java.lang.ClassLoader#getResourceAsBytes(String)
+   * @see     java.lang.ClassLoader#getResourceAsStream(String)
+   * @see     java.io.URL
+   */
+  public URL getResource(String name) {
+    return null;
+  }
+
+  /**
+   * Utility routine to read a resource fully, even if the given
+   * InputStream only provides partial results.
+   */
+  private static byte[] readbytes (InputStream is, int length)
+  {
+    try {
+
+      byte[] data = new byte[length];
+      int read; 
+      int off = 0;
+	    
+      while (off != length)
+	{
+	  read = is.read (data, off, (int) (length-off));
+
+	  if (read == -1) 
+	    return null;
+
+	  off += read;
+	}
+	    
+      return data;
+    } catch (java.io.IOException x) {
       return null;
     }
-
-  protected abstract Class loadClass (String className, boolean resolve)
-    throws ClassNotFoundException;
-  public Class loadClass (String name) throws ClassNotFoundException
-    {
-      return loadClass (name, true);
-    }
-
-  protected final void resolveClass (Class c)
-    {
-      // Nothing for now.
-    }
-
-  protected final void setSigners (Class cl, Object[] signers)
-    {
-      // Nothing for now.
-    }
-
-  // Class cache.
-  private Hashtable cache;
-
-  // The system class loader.  FIXME: should have an actual value
-  private static final ClassLoader system = null;
+  }
 }
Index: java/lang/FirstThread.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/FirstThread.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 FirstThread.java
--- FirstThread.java	1999/04/07 14:52:37	1.1.1.1
+++ FirstThread.java	1999/08/08 13:46:42
@@ -19,12 +19,30 @@
 
 final class FirstThread extends Thread
 {
-  public native void run ();
+  public native void run0 ();
+  public void run () 
+  {
+    try {
+      run0 ();
+    } catch (Throwable ex) {
+      System.err.println ("uncaught exception at top level");
+      ex.printStackTrace ();
+    }
+  }
 
   public FirstThread (ThreadGroup g, Class k, Object o)
   {
     super (g, null, "main");
     klass = k;
+    klass_name = null;
+    args = o;
+  }
+
+  public FirstThread (ThreadGroup g, String class_name, Object o)
+  {
+    super (g, null, "main");
+    klass = null;
+    klass_name = class_name;
     args = o;
   }
 
@@ -36,5 +54,6 @@
 
   // Private data.
   private Class klass;
+  private String klass_name;
   private Object args;
 }
Index: java/lang/VirtualMachineError.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/VirtualMachineError.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 VirtualMachineError.java
--- VirtualMachineError.java	1999/04/07 14:52:38	1.1.1.1
+++ VirtualMachineError.java	1999/08/08 13:46:42
@@ -20,6 +20,11 @@
  * Status:  Believed complete and correct.
  */
 
+/* FIXME: We should consider adding some special error message when this
+ * exception is thrown, or maybe if it being caught at top-level.  Such
+ * a message would direct the user to send a bug report to
+ * gcj-bugs@cygnus.com, or something like that. --KKT */
+
 public abstract class VirtualMachineError extends Error
 {
   public VirtualMachineError ()
Index: java/lang/natClass.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natClass.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 natClass.cc
--- natClass.cc	1999/04/07 14:52:38	1.1.1.1
+++ natClass.cc	1999/08/08 13:46:44
@@ -39,6 +39,8 @@
 #include <java/lang/System.h>
 #include <java/lang/SecurityManager.h>
 
+#include <java-cpool.h>
+
 
 
 #define CloneableClass _CL_Q34java4lang9Cloneable
@@ -59,28 +61,6 @@
 static _Jv_Utf8Const *clinit_name = _Jv_makeUtf8Const ("<clinit>", 8);
 static _Jv_Utf8Const *init_name = _Jv_makeUtf8Const ("<init>", 6);
 
-// These are the possible values for the `state' field.  They more or
-// less follow the section numbers in the Java Language Spec.  Right
-// now we don't bother to represent other interesting states, e.g. the
-// states a class might inhabit before it is prepared.  Note that
-// ordering is important here; in particular `resolved' must come
-// between `nothing' and the other states.
-#define STATE_NOTHING      0
-#define STATE_RESOLVED     1
-#define STATE_IN_PROGRESS  6
-#define STATE_DONE         9
-#define STATE_ERROR       10
-
-// Size of local hash table.
-#define HASH_LEN 256
-
-// Hash function for Utf8Consts.
-#define HASH_UTF(Utf) (((Utf)->hash) % HASH_LEN)
-
-// This is the table we use to keep track of loaded classes.  See Spec
-// section 12.2.
-static jclass loaded_classes[HASH_LEN];
-
 
 
 jclass
@@ -111,6 +91,9 @@
 #endif
   if (! klass)
     JvThrow (new java::lang::ClassNotFoundException (className));
+
+  _Jv_InitClass (klass);
+
   return klass;
 }
 
@@ -380,33 +363,13 @@
   return r;
 }
 
-// Initialize the constants.
 void
-java::lang::Class::resolveConstants (void)
+java::lang::Class::finalize (void)
 {
-  for (int i = 0; i < constants.size; ++i)
-    {
-      if (constants.tags[i] == CONSTANT_String)
-	{
-	  jstring str;
-	  str = _Jv_NewStringUtf8Const ((_Jv_Utf8Const *) constants.data[i]);
-	  constants.data[i] = (void *) str;
-	  constants.tags[i] = CONSTANT_ResolvedString;
-	}
-      else if (constants.tags[i] == CONSTANT_Class)
-	{
-	  _Jv_Utf8Const *name = (_Jv_Utf8Const *) constants.data[i];
-	  jclass klass = _Jv_FindClassFromSignature (name->data, loader);
-	  if (! klass)
-	    {
-	      jstring str = _Jv_NewStringUtf8Const (name);
-	      JvThrow (new java::lang::ClassNotFoundException (str));
-	    }
-
-	  constants.data[i] = (void *) klass;
-	  constants.tags[i] = CONSTANT_ResolvedClass;
-	}
-    }
+#ifdef INTERPRETER
+  JvAssert (_Jv_IsInterpretedClass (this));
+  _Jv_UnregisterClass (this);
+#endif
 }
 
 // FIXME.
@@ -424,38 +387,52 @@
 java::lang::Class::initializeClass (void)
 {
   // Short-circuit to avoid needless locking.
-  if (state == STATE_DONE)
+  if (state == JV_STATE_DONE)
     return;
 
-  // Step 1.
-  _Jv_MonitorEnter (this);
+  // do this before we enter the monitor below, since this can cause
+  // exceptions.  Here we assume, that reading "state" is an atomic
+  // operation, I pressume that is true? --Kresten
+  if (state < JV_STATE_LINKED)
+    {
+#ifdef INTERPRETER
+      if (_Jv_IsInterpretedClass (this))
+	{
+	  java::lang::ClassLoader::resolveClass (this);
 
-  // FIXME: This should actually be handled by calling into the class
-  // loader.  For now we put it here.
-  if (state < STATE_RESOLVED)
-    {
-      // We set the state before calling resolveConstants to avoid
-      // infinite recursion when processing String or Class.
-      state = STATE_RESOLVED;
-      resolveConstants ();
+	  // Step 1.
+	  _Jv_MonitorEnter (this);
+	}
+      else
+#endif
+        {
+          // Step 1.
+	  _Jv_MonitorEnter (this);
+	  _Jv_InternClassStrings (this);
+	}
     }
+  else
+    {
+      // Step 1.
+      _Jv_MonitorEnter (this);
+    }
 
   // Step 2.
   java::lang::Thread *self = java::lang::Thread::currentThread();
   // FIXME: `self' can be null at startup.  Hence this nasty trick.
   self = (java::lang::Thread *) ((long) self | 1);
-  while (state == STATE_IN_PROGRESS && thread && thread != self)
+  while (state == JV_STATE_IN_PROGRESS && thread && thread != self)
     wait ();
 
   // Steps 3 &  4.
-  if (state == STATE_DONE || state == STATE_IN_PROGRESS || thread == self)
+  if (state == JV_STATE_DONE || state == JV_STATE_IN_PROGRESS || thread == self)
     {
       _Jv_MonitorExit (this);
       return;
     }
 
   // Step 5.
-  if (state == STATE_ERROR)
+  if (state == JV_STATE_ERROR)
     {
       _Jv_MonitorExit (this);
       JvThrow (new java::lang::NoClassDefFoundError);
@@ -463,7 +440,7 @@
 
   // Step 6.
   thread = self;
-  state = STATE_IN_PROGRESS;
+  state = JV_STATE_IN_PROGRESS;
   _Jv_MonitorExit (this);
 
   // Step 7.
@@ -477,7 +454,7 @@
 	{
 	  // Caught an exception.
 	  _Jv_MonitorEnter (this);
-	  state = STATE_ERROR;
+	  state = JV_STATE_ERROR;
 	  notify ();
 	  _Jv_MonitorExit (this);
 	  JvThrow (except);
@@ -492,7 +469,7 @@
   if (! except)
     {
       _Jv_MonitorEnter (this);
-      state = STATE_DONE;
+      state = JV_STATE_DONE;
     }
   else
     {
@@ -503,7 +480,7 @@
 	  except = hackTrampoline(2, except);
 	}
       _Jv_MonitorEnter (this);
-      state = STATE_ERROR;
+      state = JV_STATE_ERROR;
     }
   notify ();
   _Jv_MonitorExit (this);
@@ -530,6 +507,64 @@
   return NULL;
 }
 
+#define MCACHE_SIZE 1013
+
+struct _Jv_mcache {
+  jclass klass;
+  _Jv_Method *method;
+};
+
+static _Jv_mcache method_cache[MCACHE_SIZE];
+static int method_cache_count;
+
+static void*
+_Jv_FindMethodInCache (jclass klass,
+		       _Jv_Utf8Const *name,
+		       _Jv_Utf8Const *signature)
+{
+  for (int index = name->hash % MCACHE_SIZE;
+       method_cache[index].klass != NULL;
+       index = (index+1) % MCACHE_SIZE)
+    {
+      _Jv_mcache *mc = (method_cache+index);
+      _Jv_Method *m  = mc->method;
+
+      if (mc->klass == klass
+	  && m != NULL		// thread safe check
+	  && _Jv_equalUtf8Consts (m->name, name)
+	  && _Jv_equalUtf8Consts (m->signature, signature))
+	{
+	  return mc->method->ncode;
+	}
+    }  
+  return NULL;
+}
+
+static void
+_Jv_AddMethodToCache (jclass klass,
+			_Jv_Method *method)
+{
+  _Jv_MonitorEnter (&ClassClass); 
+
+  if (method_cache_count > MCACHE_SIZE*2/3)
+    {
+      for (int i = 0; i < MCACHE_SIZE; i++)
+	method_cache[i].klass = 0;
+    }
+
+  for (int index = method->name->hash % MCACHE_SIZE;
+       method_cache[index].klass != NULL;
+       index = (index+1) % MCACHE_SIZE)
+    {
+      method_cache[index].method = method;
+      method_cache[index].klass = klass;
+    }
+
+  method_cache_count += 1;
+  
+  _Jv_MonitorExit (&ClassClass);
+}
+
 void *
 _Jv_LookupInterfaceMethod (jclass klass, _Jv_Utf8Const *name,
 			   _Jv_Utf8Const *signature)
@@ -539,6 +574,14 @@
   // call a method of a class until the class is linked.  But this
   // captures the general idea.
   // klass->getClassLoader()->resolveClass(klass);
+  // 
+  // KKT: This is unnessecary, exactly for the reason you present: 
+  // _Jv_LookupInterfaceMethod is only called on object instances, and
+  // such have already been initialized (which includes resolving).
+
+  void *ncode = _Jv_FindMethodInCache (klass, name, signature);
+  if (ncode != 0)
+    return ncode;
 
   for (; klass; klass = klass->getSuperclass())
     {
@@ -553,6 +596,8 @@
       if (! java::lang::reflect::Modifier::isPublic(meth->accflags))
 	JvThrow (new java::lang::IllegalAccessError);
 
+      _Jv_AddMethodToCache (klass, meth);
+
       return meth->ncode;
     }
   JvThrow (new java::lang::IncompatibleClassChangeError);
@@ -563,219 +608,6 @@
 _Jv_InitClass (jclass klass)
 {
   klass->initializeClass();
-}
-
-// This function is called many times during startup, before main() is
-// run.  We do our runtime initialization here the very first time we
-// are called.  At that point in time we know for certain we are
-// running single-threaded, so we don't need to lock when modifying
-// `init'.  CLASSES is NULL-terminated.
-void
-_Jv_RegisterClasses (jclass *classes)
-{
-  static bool init = false;
-
-  if (! init)
-    {
-      init = true;
-      _Jv_InitThreads ();
-      _Jv_InitGC ();
-      _Jv_InitializeSyncMutex ();
-    }
-
-  JvSynchronize sync (&ClassClass);
-  for (; *classes; ++classes)
-    {
-      jclass klass = *classes;
-      jint hash = HASH_UTF (klass->name);
-      klass->next = loaded_classes[hash];
-      loaded_classes[hash] = klass;
-    }
-}
-
-void
-_Jv_RegisterClass (jclass klass)
-{
-  jclass classes[2];
-  classes[0] = klass;
-  classes[1] = NULL;
-  _Jv_RegisterClasses (classes);
-}
-
-jclass
-_Jv_FindClassInCache (_Jv_Utf8Const *name, java::lang::ClassLoader *loader)
-{
-  JvSynchronize sync (&ClassClass);
-  jint hash = HASH_UTF (name);
-  jclass klass;
-  for (klass = loaded_classes[hash]; klass; klass = klass->next)
-    {
-      if (loader == klass->loader && _Jv_equalUtf8Consts (name, klass->name))
-	break;
-    }
-  return klass;
-}
-
-#if 0
-jclass
-_Jv_FindClassInCache (jstring name, java::lang::ClassLoader *loader)
-{
-  JvSynchronize sync (&ClassClass);
-  jint hash = name->hashCode();
-  jclass klass = loaded_classes[(_Jv_ushort) hash % HASH_LEN];
-  for ( ; klass; klass = klass->next)
-    {
-      if (loader == klass->loader
-	  && _Jv_equalUtf8Consts (klass->name, name, hash))
-	break;
-    }
-  return klass;
-}
-#endif
-
-jclass
-_Jv_FindClass (_Jv_Utf8Const* name, java::lang::ClassLoader *loader)
-{
-  jclass klass = _Jv_FindClassInCache (name, loader);
-  if (loader && ! klass)
-    {
-      klass = loader->loadClass(_Jv_NewStringUtf8Const (name));
-      if (klass)
-	_Jv_RegisterClass (klass);
-    }
-  return klass;
-}
-
-#if 0
-jclass
-_Jv_FindClass (jstring name, java::lang::ClassLoader *loader)
-{
-  jclass klass = _Jv_FindClassInCache (name, loader);
-  if (loader && ! klass)
-    {
-      klass = loader->loadClass(name);
-      if (klass)
-	_Jv_RegisterClass (klass);
-    }
-  return klass;
-}
-#endif
-
-jclass
-_Jv_NewClass (_Jv_Utf8Const *name, jclass superclass,
-	      java::lang::ClassLoader *loader)
-{
-  jclass ret = (jclass) JvAllocObject (&ClassClass);
-
-  ret->next = NULL;
-  ret->name = name;
-  ret->accflags = 0;
-  ret->superclass = superclass;
-  ret->constants.size = 0;
-  ret->constants.tags = NULL;
-  ret->constants.data = NULL;
-  ret->methods = NULL;
-  ret->method_count = 0;
-  ret->vtable_method_count = 0;
-  ret->fields = NULL;
-  ret->size_in_bytes = 0;
-  ret->field_count = 0;
-  ret->static_field_count = 0;
-  ret->vtable = NULL;
-  ret->interfaces = NULL;
-  ret->loader = loader;
-  ret->interface_count = 0;
-  ret->state = 0;
-  ret->thread = NULL;
-
-  _Jv_RegisterClass (ret);
-
-  return ret;
-}
-
-jclass
-_Jv_FindArrayClass (jclass element)
-{
-  _Jv_Utf8Const *array_name;
-  int len;
-  if (element->isPrimitive())
-    {
-      // For primitive types the array is cached in the class.
-      jclass ret = (jclass) element->methods;
-      if (ret)
-	return ret;
-      len = 3;
-    }
-  else
-    len = element->name->length + 5;
-
-  {
-    char signature[len];
-    int index = 0;
-    signature[index++] = '[';
-    // Compute name of array class to see if we've already cached it.
-    if (element->isPrimitive())
-      {
-	signature[index++] = (char) element->method_count;
-      }
-    else
-      {
-	size_t length = element->name->length;
-	const char *const name = element->name->data;
-	if (name[0] != '[')
-	  signature[index++] = 'L';
-	memcpy (&signature[index], name, length);
-	index += length;
-	if (name[0] != '[')
-	  signature[index++] = ';';
-      }      
-    array_name = _Jv_makeUtf8Const (signature, index);
-  }
-
-  jclass array_class = _Jv_FindClassInCache (array_name, element->loader);
-
-  if (! array_class)
-    {
-      // Create new array class.
-      array_class = _Jv_NewClass (array_name, &ObjectClass, element->loader);
-
-      // Note that `vtable_method_count' doesn't include the initial
-      // NULL slot.
-      int dm_count = ObjectClass.vtable_method_count + 1;
-
-      // Create a new vtable by copying Object's vtable (except the
-      // class pointer, of course).  Note that we allocate this as
-      // unscanned memory -- the vtables are handled specially by the
-      // GC.
-      int size = (sizeof (_Jv_VTable) +
-		  ((dm_count - 1) * sizeof (void *)));
-      _Jv_VTable *vtable = (_Jv_VTable *) _Jv_AllocBytes (size);
-      vtable->clas = array_class;
-      memcpy (vtable->method, ObjectClass.vtable->method,
-	      dm_count * sizeof (void *));
-      array_class->vtable = vtable;
-      array_class->vtable_method_count = ObjectClass.vtable_method_count;
-
-      // Stash the pointer to the element type.
-      array_class->methods = (_Jv_Method *) element;
-
-      // Register our interfaces.
-      // FIXME: for JDK 1.2 we need Serializable.
-      static jclass interfaces[] = { &CloneableClass };
-      array_class->interfaces = interfaces;
-      array_class->interface_count = 1;
-
-      // FIXME: initialize other Class instance variables,
-      // e.g. `fields'.
-
-      array_class->state = STATE_DONE;
-    }
-
-  // For primitive types, point back at this array.
-  if (element->isPrimitive())
-    element->methods = (_Jv_Method *) array_class;
-
-  return array_class;
 }
 
 jboolean
Index: java/lang/natFirstThread.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natFirstThread.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 natFirstThread.cc
--- natFirstThread.cc	1999/04/07 14:52:38	1.1.1.1
+++ natFirstThread.cc	1999/08/08 13:46:44
@@ -27,7 +27,7 @@
 typedef void main_func (jobject);
 
 void
-java::lang::FirstThread::run (void)
+java::lang::FirstThread::run0 (void)
 {
   Utf8Const* main_signature = _Jv_makeUtf8Const ("([Ljava.lang.String;)V", 22);
   Utf8Const* main_name = _Jv_makeUtf8Const ("main", 4);
@@ -40,6 +40,12 @@
   if (! java::lang::reflect::Modifier::isPublic(klass->getModifiers()))
     DIE ("class must be public");
 #endif
+
+  if (klass == NULL)
+    {
+      klass = java::lang::Class::forName (klass_name);
+      if (klass != NULL) _Jv_InitClass (klass);
+    }
 
   _Jv_Method *meth = _Jv_GetMethodLocal (klass, main_name, main_signature);
 
Index: java/lang/reflect/natArray.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/reflect/natArray.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 natArray.cc
--- natArray.cc	1999/04/07 14:52:39	1.1.1.1
+++ natArray.cc	1999/08/08 13:46:44
@@ -45,10 +45,11 @@
   if (ndims == 1)
     return newInstance (componentType, dims[0]);
   jclass arrayType = componentType;
-  for (int i = 0;  i < ndims;  i++)
-    arrayType = _Jv_FindArrayClass (arrayType);
-  return _Jv_NewMultiArray (arrayType, ndims, dims);
+  for (int i = 0;  i < ndims;  i++)  // FIXME 2nd arg should 
+                                     // be "current" loader
+    arrayType = _Jv_FindArrayClass (arrayType, 0);
 
+  return _Jv_NewMultiArray (arrayType, ndims, dims);
 }
 
 jint
Index: java/lang/reflect/natMethod.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/reflect/natMethod.cc,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 natMethod.cc
--- natMethod.cc	1999/04/07 14:52:39	1.1.1.1
+++ natMethod.cc	1999/08/08 13:46:45
@@ -378,8 +378,10 @@
 	  while (*ptr != ';' && ptr[1] != '\0');
 	  break;
 	}
+
+      // FIXME: 2'nd argument should be "current loader"
       while (--num_arrays >= 0)
-	type = _Jv_FindArrayClass (type);
+	type = _Jv_FindArrayClass (type, 0);
       *argPtr++ = type;
     }
   parameter_types = args;
Index: java/net/natPlainSocketImpl.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/net/natPlainSocketImpl.cc,v
retrieving revision 1.8
diff -u -r1.8 natPlainSocketImpl.cc
--- natPlainSocketImpl.cc	1999/08/03 00:30:53	1.8
+++ natPlainSocketImpl.cc	1999/08/08 13:46:45
@@ -354,7 +354,7 @@
         if (l_val.l_onoff)
           return new java::lang::Integer (l_val.l_linger);
         else
-	  return new java::lang::Boolean (false);
+	  return new java::lang::Boolean ((__java_boolean)false);
 #else
         JvThrow (new java::lang::InternalError (
           JvNewStringUTF ("SO_LINGER not supported")));      
Index: testsuite/Makefile.in
===================================================================
RCS file: /cvs/java/libgcj/libjava/testsuite/Makefile.in,v
retrieving revision 1.10
diff -u -r1.10 Makefile.in
--- Makefile.in	1999/08/03 03:07:04	1.10
+++ Makefile.in	1999/08/08 13:46:46
@@ -71,6 +71,7 @@
 CPP = @CPP@
 CXX = @CXX@
 CXXCPP = @CXXCPP@
+DIVIDESPEC = @DIVIDESPEC@
 DLLTOOL = @DLLTOOL@
 EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
 EXEEXT = @EXEEXT@
@@ -79,6 +80,7 @@
 GCLIBS = @GCLIBS@
 GCOBJS = @GCOBJS@
 GCSPEC = @GCSPEC@
+INTERPSPEC = @INTERPSPEC@
 LD = @LD@
 LIBGCJ_CFLAGS = @LIBGCJ_CFLAGS@
 LIBGCJ_CXXFLAGS = @LIBGCJ_CXXFLAGS@

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]