This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[Patch] Make building without the interpreter work.
- From: David Daney <ddaney at avtrex dot com>
- To: GCJ-patches <java-patches at gcc dot gnu dot org>
- Date: Mon, 30 Jul 2007 00:29:54 -0700
- Subject: [Patch] Make building without the interpreter work.
The current state of the trunk is that if you have a target without ffi
closure support (mips64 for example), you cannot build libgcj.
Some parts of libgcj explicitly test for ffi closure support. Others
test for interpreter support. I made the simplifying assumption that
they are the same thing. That is if the interpreter is disabled, I
assume that ffi closures are not supported. This seemed quite a bit
simpler than trying to factor these two cases out.
The main change this patch makes is to define a new
AM_CONDITIONAL(INTERPRETER). This allows entire files to be excluded
from libgcj if the interpreter is not supported. Then I was able to
conditionally include all jvmti and jdwp files which only are used if
the interpreter is functional. The remainder of the patch just puts the
jvmti and closure code contained in files that cannot be excluded,
inside of #ifdef INTERPRETER blocks. Most of this had already been
done, but some has leaked out with the addition of jvmti, jdwp, proxies
and several other libgcj improvements.
With the patch I can build mips64-linux (o32, n32, n64 multi-lib). With
n32 a Hello World program works, n64 gets a SIGBUS initializing the GC
(I will fix that in a follow on patch). Also I am currently
bootstrapping and regerssion testing x86_64-pc-linux-gnu.
OK to commit if x86_64-pc-linux-gnu shows no regressions?
2007-07-29 David Daney <ddaney@avtrex.com>
* configure.ac (INTERPRETER): New AM_CONDITIONAL.
* scripts/makemake.tcl (package_map): Mark jdwp and jvmti packages
as being for interpreter only. Place interpreter related files in
'if INTERPRETER' block.
(interpreter_package_files): New list.
(interpreter_header_vars): Ditto.
(emit_package_rule_to_list): Renamed from emit_package_rule with
new target list parameter.
(emit_package_rule): Rewritten to call emit_package_rule_to_list.
(emit_interpreter_rule): New function.
(emit_source_var): Place interpreter related files in
interpreter_header_vars.
* Makefile.am (ACLOCAL_AMFLAGS): Add -I libltdl.
(libgcj_interpret_source_files): New variable.
(libgcj_la_SOURCES): Move jvmti.cc and interpret.cc to
libgcj_interpret_source_files and include
libgcj_interpret_source_files.
(nat_jdwp_source_files): New variable.
(nat_jvmti_source_files): Ditto.
(nat_source_files): Move jdwp and jvmti related files to
nat_jdwp_source_files and nat_jvmti_source_files and include
nat_jdwp_source_files and nat_jvmti_source_files.
* Makefile.in: Regenerate.
* include/Makefile.in: Ditto.
* testsuite/Makefile.in: Ditto.
* gcj/Makefile.in: Ditto.
* aclocal.m4: Ditto.
* sources.am: Ditto.
* configure: Ditto.
* include/config.h.in: Ditto.
* interpret.cc: Remove #ifdef INTERPRETER block.
* stacktrace.cc (UnwindTraceFn): Do not handle proxy frames if
interpreter disabled.
* include/java-interp.h (_Jv_FrameType): Move outside of
#ifdef INTERPRETER block.
* include/execution.h (_Jv_IndirectCompiledEngine::do_get_closure_list,
_Jv_InterpreterEngine, _Jv_soleInterpreterEngine): Place in
#ifdef INTERPRETER block.
* jni.cc (jvmti.h, jvmti-int.h): Only include if INTERPRETER is
defined.
(_Jv_JNI_PopSystemFrame, _Jv_JNI_GetEnv): Only do jvmti processing
if INTERPRETER is defined.
* prims.cc (jvmti.h, jvmti-int.h, Jdwp.h, VMVirtualMachine.h): Only
include if INTERPRETER is defined.
(defaultJdwpOptions, jdwpOptions, jvmti_agent_onload_func,
jvmti_agent_onunload_func, jvmti_agentonload, jvmti_agentonunload,
jvmti_agent_opts, load_jvmti_agent): Only define if INTERPRETER is
defined.
(parse_x_arg): Only process 'runjdwp:' if INTERPRETER is defined.
(parse_init_args): Only process jvmti related options if
INTERPRETER is defined.
(_Jv_CreateJavaVM): Only call _Jv_JVMTI_Init if INTERPRETER is
defined.
(_Jv_RunMain): Only do jvmti and jdwp processing if INTERPRETER is
defined.
* link.cc (jvmti.h, jvmti-int.h): Only include if INTERPRETER is
defined.
(_Jv_ThrowNoClassDefFoundError, _Jv_Linker::create_error_method):
Define if if INTERPRETER is not defined.
(_Jv_Linker::wait_for_state): Only do jvmti proccessing if
INTERPRETER is defined.
* boehm.cc (closure_list_pointer, finalize_closure_list,
_Jv_ClosureListFinalizer): Only define if INTERPRETER is
defined.
* java/lang/natThread.cc (jvmti.h, jvmti-int.h): Only include if
INTERPRETER is defined.
(finish_, _Jv_NotifyThreadStart): Only do jvmti proccessing if
INTERPRETER is defined.
* java/lang/Class.h (_Jv_InterpreterEngine): Move declaration
and friend declaration inside #ifdef INTERPRETER block.
* java/lang/natClass.cc (_Jv_ClosureList::releaseClosures,
_Jv_ClosureList::registerClosure, _Jv_GetInterpClassSourceFile):
Only define if INTERPRETER is defined.
* java/lang/reflect/natVMProxy.cc (UnsupportedOperationException.h):
Include.
(generateProxyClass): Throw UnsupportedOperationException unless
INTERPRETER is defined.
Index: scripts/makemake.tcl
===================================================================
--- scripts/makemake.tcl (revision 127010)
+++ scripts/makemake.tcl (working copy)
@@ -36,6 +36,11 @@ proc verbose {text} {
# objects in this package are not used. Note however that
# most ignored files are actually handled by listing them in
# 'standard.omit'
+# * interpreter
+# objects in this package (and possibly sub-packages,
+# if they do not appear in the map) are only compiled if
+# the interpreter is enabled. They are compiled as with the
+# 'package' specifier.
#
# If a package does not appear in the map, the default is 'package'.
global package_map
@@ -93,6 +98,19 @@ set package_map(gnu/javax/swing/text/htm
set package_map(gnu/gcj/xlib) package
set package_map(gnu/awt/xlib) package
+# These packages should only be included if the interpreter is
+# enabled.
+set package_map(gnu/classpath/jdwp) interpreter
+set package_map(gnu/classpath/jdwp/event) interpreter
+set package_map(gnu/classpath/jdwp/event/filters) interpreter
+set package_map(gnu/classpath/jdwp/exception) interpreter
+set package_map(gnu/classpath/jdwp/id) interpreter
+set package_map(gnu/classpath/jdwp/processor) interpreter
+set package_map(gnu/classpath/jdwp/transport) interpreter
+set package_map(gnu/classpath/jdwp/util) interpreter
+set package_map(gnu/classpath/jdwp/value) interpreter
+set package_map(gnu/gcj/jvmti) interpreter
+
# Some BC ABI packages have classes which must not be compiled BC.
# This maps such packages to a grep expression for excluding such
# classes.
@@ -138,9 +156,16 @@ set properties_files {}
# List of all '@' files that we are going to compile.
set package_files {}
+# List of all '@' files that we are going to compile if the
+# interpreter is enabled.
+set interpreter_package_files {}
+
# List of all header file variables.
set header_vars {}
+# List of all header file variables for interpreter packages.
+set interpreter_header_vars {}
+
# List of all BC object files.
set bc_objects {}
@@ -300,8 +325,8 @@ proc emit_bc_rule {package} {
}
# Emit a rule for a 'package' package.
-proc emit_package_rule {package} {
- global package_map exclusion_map package_files
+proc emit_package_rule_to_list {package package_files_list} {
+ global package_map exclusion_map $package_files_list
if {$package == "."} {
set pkgname ordinary
@@ -333,10 +358,20 @@ proc emit_package_rule {package} {
if {$pkgname != "gnu/gcj/xlib" && $pkgname != "gnu/awt/xlib"
&& $pkgname != "gnu/gcj/tools/gcj_dbtool"} {
- lappend package_files $lname
+ lappend $package_files_list $lname
}
}
+proc emit_package_rule {package} {
+ global package_files
+ emit_package_rule_to_list $package package_files
+}
+
+proc emit_interpreter_rule {package} {
+ global interpreter_package_files
+ emit_package_rule_to_list $package interpreter_package_files
+}
+
# Emit a rule to build a package full of 'ordinary' files, that is,
# one .o for each .java.
proc emit_ordinary_rule {package} {
@@ -382,7 +417,7 @@ proc emit_process_package_rule {platform
# Emit a source file variable for a package, and corresponding header
# file variable, if needed.
proc emit_source_var {package} {
- global package_map name_map dir_map header_vars
+ global package_map name_map dir_map header_vars interpreter_header_vars
if {$package == "."} {
set pkgname ordinary
@@ -428,7 +463,11 @@ proc emit_source_var {package} {
puts "${uname}_header_files = $result"
puts ""
if {$pkgname != "gnu/gcj/xlib" && $pkgname != "gnu/awt/xlib"} {
- lappend header_vars "${uname}_header_files"
+ if {$package_map($package) == "interpreter"} {
+ lappend interpreter_header_vars "${uname}_header_files"
+ } else {
+ lappend header_vars "${uname}_header_files"
+ }
}
}
}
@@ -490,6 +529,8 @@ foreach package [lsort [array names pack
emit_ordinary_rule $package
} elseif {$package_map($package) == "package"} {
emit_package_rule $package
+ } elseif {$package_map($package) == "interpreter"} {
+ emit_interpreter_rule $package
} else {
error "unrecognized type: $package_map($package)"
}
@@ -499,6 +540,21 @@ emit_process_package_rule Ecos
emit_process_package_rule Win32
emit_process_package_rule Posix
+puts "if INTERPRETER"
+pp_var interpreter_packages_source_files $interpreter_package_files
+pp_var interpreter_header_files $interpreter_header_vars "\$(" ")"
+puts ""
+puts "else"
+puts ""
+puts "interpreter_packages_source_files="
+puts ""
+puts "interpreter_header_files="
+puts ""
+puts "endif"
+
+lappend package_files {$(interpreter_packages_source_files)}
+lappend header_vars interpreter_header_files
+
pp_var all_packages_source_files $package_files
pp_var ordinary_header_files $header_vars "\$(" ")"
pp_var bc_objects $bc_objects
Index: interpret.cc
===================================================================
--- interpret.cc (revision 127010)
+++ interpret.cc (working copy)
@@ -43,8 +43,6 @@ details. */
#include <gnu/gcj/jvmti/Breakpoint.h>
#include <gnu/gcj/jvmti/BreakpointManager.h>
-#ifdef INTERPRETER
-
// Execution engine for interpreted code.
_Jv_InterpreterEngine _Jv_soleInterpreterEngine;
@@ -1932,5 +1930,3 @@ _Jv_CompileMethod (_Jv_InterpMethod* met
}
}
#endif // DIRECT_THREADED
-
-#endif // INTERPRETER
Index: configure.ac
===================================================================
--- configure.ac (revision 127010)
+++ configure.ac (working copy)
@@ -564,6 +564,7 @@ if test "$libgcj_interpreter" = yes; the
fi
INTERPRETER="$libgcj_interpreter"
AC_SUBST(INTERPRETER)
+AM_CONDITIONAL(INTERPRETER, test "$libgcj_interpreter" = yes)
AC_MSG_CHECKING([for exception model to use])
AC_LANG_PUSH(C++)
Index: stacktrace.cc
===================================================================
--- stacktrace.cc (revision 127010)
+++ stacktrace.cc (working copy)
@@ -138,7 +138,6 @@ _Jv_StackTrace::UnwindTraceFn (struct _U
state->interp_frame = state->interp_frame->next_interp;
}
else
-#endif
// We handle proxies in the same way as interpreted classes
if (_Jv_is_proxy (func_addr))
{
@@ -148,6 +147,7 @@ _Jv_StackTrace::UnwindTraceFn (struct _U
state->interp_frame = state->interp_frame->next_interp;
}
else
+#endif
{
#ifdef HAVE_GETIPINFO
_Unwind_Ptr ip;
Index: include/java-interp.h
===================================================================
--- include/java-interp.h (revision 127010)
+++ include/java-interp.h (working copy)
@@ -15,6 +15,13 @@ details. */
#include <java-cpool.h>
#include <gnu/gcj/runtime/NameFinder.h>
+enum _Jv_FrameType
+{
+ frame_native,
+ frame_interpreter,
+ frame_proxy
+};
+
#ifdef INTERPRETER
#pragma interface
@@ -373,13 +380,6 @@ public:
}
};
-enum _Jv_FrameType
-{
- frame_native,
- frame_interpreter,
- frame_proxy
-};
-
// The composite call stack as represented by a linked list of frames
class _Jv_Frame
{
Index: include/execution.h
===================================================================
--- include/execution.h (revision 127010)
+++ include/execution.h (working copy)
@@ -199,6 +199,7 @@ struct _Jv_IndirectCompiledEngine : publ
_Jv_Free (aux->field_initializers);
}
+#ifdef INTERPRETER
static _Jv_ClosureList **do_get_closure_list (jclass klass)
{
_Jv_IndirectCompiledClass *aux = get_aux_info (klass);
@@ -208,9 +209,10 @@ struct _Jv_IndirectCompiledEngine : publ
return aux->closures;
}
+#endif
};
-
+#ifdef INTERPRETER
// This handles interpreted code.
class _Jv_InterpreterEngine : public _Jv_ExecutionEngine
@@ -266,8 +268,9 @@ class _Jv_InterpreterEngine : public _Jv
}
};
-
extern _Jv_InterpreterEngine _Jv_soleInterpreterEngine;
+#endif // INTERPRETER
+
extern _Jv_CompiledEngine _Jv_soleCompiledEngine;
extern _Jv_IndirectCompiledEngine _Jv_soleIndirectCompiledEngine;
#endif // __JAVA_EXECUTION_H__
Index: jni.cc
===================================================================
--- jni.cc (revision 127010)
+++ jni.cc (working copy)
@@ -22,9 +22,10 @@ details. */
#ifdef ENABLE_JVMPI
#include <jvmpi.h>
#endif
+#ifdef INTERPRETER
#include <jvmti.h>
#include "jvmti-int.h"
-
+#endif
#include <java/lang/Class.h>
#include <java/lang/ClassLoader.h>
#include <java/lang/Throwable.h>
@@ -452,7 +453,8 @@ _Jv_JNI_PopSystemFrame (JNIEnv *env)
_Jv_JNI_PopLocalFrame (env, NULL, MARK_SYSTEM);
else
env->locals = NULL;
-
+
+#ifdef INTERPRETER
if (__builtin_expect (env->ex != NULL, false))
{
jthrowable t = env->ex;
@@ -461,6 +463,7 @@ _Jv_JNI_PopSystemFrame (JNIEnv *env)
_Jv_ReportJVMTIExceptionThrow (t);
throw t;
}
+#endif
}
template<typename T> T extract_from_jvalue(jvalue const & t);
@@ -2535,12 +2538,14 @@ _Jv_JNI_GetEnv (JavaVM *, void **penv, j
}
#endif
+#ifdef INTERPRETER
// Handle JVMTI requests
if (version == JVMTI_VERSION_1_0)
{
*penv = (void *) _Jv_GetJVMTIEnv ();
return 0;
}
+#endif
// FIXME: do we really want to support 1.1?
if (version != JNI_VERSION_1_4 && version != JNI_VERSION_1_2
Index: prims.cc
===================================================================
--- prims.cc (revision 127010)
+++ prims.cc (working copy)
@@ -32,8 +32,10 @@ details. */
#include <java/lang/ThreadGroup.h>
#endif
+#ifdef INTERPRETER
#include <jvmti.h>
#include "jvmti-int.h"
+#endif
#ifndef DISABLE_GETENV_PROPERTIES
#include <ctype.h>
@@ -67,8 +69,12 @@ details. */
#include <gnu/gcj/runtime/ExtensionClassLoader.h>
#include <gnu/gcj/runtime/FinalizerThread.h>
#include <execution.h>
+
+#ifdef INTERPRETER
#include <gnu/classpath/jdwp/Jdwp.h>
#include <gnu/classpath/jdwp/VMVirtualMachine.h>
+#endif // INTERPRETER
+
#include <gnu/java/lang/MainThread.h>
#ifdef USE_LTDL
@@ -105,6 +111,7 @@ int _Jv_argc;
// Debugging options
static bool remoteDebug = false;
+#ifdef INTERPRETER
static char defaultJdwpOptions[] = "";
static char *jdwpOptions = defaultJdwpOptions;
@@ -117,6 +124,7 @@ typedef jint jvmti_agent_onunload_func (
static jvmti_agent_onload_func *jvmti_agentonload = NULL;
static jvmti_agent_onunload_func *jvmti_agentonunload = NULL;
static char *jvmti_agent_opts;
+#endif // INTERPRETER
// Argument support.
int
@@ -1173,6 +1181,7 @@ parse_x_arg (char* option_string)
{
remoteDebug = true;
}
+#ifdef INTERPRETER
else if (! strncmp (option_string, "runjdwp:", 8))
{
if (strlen (option_string) > 8)
@@ -1184,6 +1193,7 @@ parse_x_arg (char* option_string)
return -1;
}
}
+#endif // INTERPRETER
else if (! strncmp (option_string, "bootclasspath:", 14))
{
// FIXME: add a parse_bootclasspath_arg function
@@ -1372,6 +1382,7 @@ parse_verbose_args (char* option_string,
return 0;
}
+#ifdef INTERPRETER
// This function loads the agent functions for JVMTI from the library indicated
// by name. It returns a negative value on failure, the value of which
// indicates where ltdl failed, it also prints an error message.
@@ -1427,6 +1438,7 @@ load_jvmti_agent (const char *name)
// If LTDL cannot be used, return an error code indicating this.
return -99;
}
+#endif // INTERPRETER
static jint
parse_init_args (JvVMInitArgs* vm_args)
@@ -1481,6 +1493,7 @@ parse_init_args (JvVMInitArgs* vm_args)
continue;
}
+#ifdef INTERPRETER
else if (! strncmp (option_string, "-agentlib", sizeof ("-agentlib") - 1))
{
char *strPtr;
@@ -1575,6 +1588,7 @@ parse_init_args (JvVMInitArgs* vm_args)
JVMTI::enabled = true;
continue;
}
+#endif // INTERPRETER
else
{
int r = -1;
@@ -1666,7 +1680,10 @@ _Jv_CreateJavaVM (JvVMInitArgs* vm_args)
_Jv_platform_initialize ();
_Jv_JNI_Init ();
+
+#ifdef INTERPRETER
_Jv_JVMTI_Init ();
+#endif
_Jv_GCInitializeFinalizers (&::gnu::gcj::runtime::FinalizerThread::finalizerReady);
@@ -1734,7 +1751,8 @@ _Jv_RunMain (JvVMInitArgs *vm_args, jcla
main_thread = new MainThread (JvNewStringUTF (name),
arg_vec, is_jar);
_Jv_AttachCurrentThread (main_thread);
-
+
+#ifdef INTERPRETER
// Start JVMTI if an agent function has been found.
if (jvmti_agentonload)
(*jvmti_agentonload) (_Jv_GetJavaVM (), jvmti_agent_opts, NULL);
@@ -1755,6 +1773,7 @@ _Jv_RunMain (JvVMInitArgs *vm_args, jcla
// Send VMInit
if (JVMTI_REQUESTED_EVENT (VMInit))
_Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_INIT, main_thread);
+#endif // INTERPRETER
}
catch (java::lang::Throwable *t)
{
@@ -1769,6 +1788,7 @@ _Jv_RunMain (JvVMInitArgs *vm_args, jcla
_Jv_ThreadRun (main_thread);
+#ifdef INTERPRETER
// Send VMDeath
if (JVMTI_REQUESTED_EVENT (VMDeath))
{
@@ -1776,10 +1796,11 @@ _Jv_RunMain (JvVMInitArgs *vm_args, jcla
JNIEnv *jni_env = _Jv_GetCurrentJNIEnv ();
_Jv_JVMTI_PostEvent (JVMTI_EVENT_VM_DEATH, thread, jni_env);
}
-
- // Run JVMTI AgentOnUnload if it exists and an agent is loaded.
+
+ // Run JVMTI AgentOnUnload if it exists and an agent is loaded.
if (jvmti_agentonunload)
(*jvmti_agentonunload) (_Jv_GetJavaVM ());
+#endif // INTERPRETER
// If we got here then something went wrong, as MainThread is not
// supposed to terminate.
Index: link.cc
===================================================================
--- link.cc (revision 127010)
+++ link.cc (working copy)
@@ -33,8 +33,10 @@ details. */
#include <limits.h>
#include <java-cpool.h>
#include <execution.h>
+#ifdef INTERPRETER
#include <jvmti.h>
#include "jvmti-int.h"
+#endif
#include <java/lang/Class.h>
#include <java/lang/String.h>
#include <java/lang/StringBuffer.h>
@@ -853,7 +855,7 @@ _Jv_ThrowNoSuchMethodError ()
throw new java::lang::NoSuchMethodError;
}
-#if defined USE_LIBFFI && FFI_CLOSURES
+#if defined USE_LIBFFI && FFI_CLOSURES && defined(INTERPRETER)
// A function whose invocation is prepared using libffi. It gets called
// whenever a static method of a missing class is invoked. The data argument
// holds a reference to a String denoting the missing class.
@@ -1039,7 +1041,7 @@ _Jv_Linker::find_iindex (jclass *ifaces,
return i;
}
-#if defined USE_LIBFFI && FFI_CLOSURES
+#if defined USE_LIBFFI && FFI_CLOSURES && defined(INTERPRETER)
// We use a structure of this type to store the closure that
// represents a missing method.
struct method_closure
@@ -2069,6 +2071,7 @@ _Jv_Linker::wait_for_state (jclass klass
throw new java::lang::LinkageError;
}
+#ifdef INTERPRETER
if (__builtin_expect (klass->state == JV_STATE_LINKED, false)
&& state >= JV_STATE_LINKED
&& JVMTI_REQUESTED_EVENT (ClassPrepare))
@@ -2077,4 +2080,5 @@ _Jv_Linker::wait_for_state (jclass klass
_Jv_JVMTI_PostEvent (JVMTI_EVENT_CLASS_PREPARE, self, jni_env,
klass);
}
+#endif
}
Index: boehm.cc
===================================================================
--- boehm.cc (revision 127010)
+++ boehm.cc (working copy)
@@ -380,6 +380,7 @@ _Jv_AllocRawObj (jsize size)
return (void *) GC_MALLOC (size ? size : 1);
}
+#ifdef INTERPRETER
typedef _Jv_ClosureList *closure_list_pointer;
/* Release closures in a _Jv_ClosureList. */
@@ -402,6 +403,7 @@ _Jv_ClosureListFinalizer ()
NULL, NULL, NULL);
return clpp;
}
+#endif // INTERPRETER
static void
call_finalizer (GC_PTR obj, GC_PTR client_data)
Index: java/lang/natThread.cc
===================================================================
--- java/lang/natThread.cc (revision 127010)
+++ java/lang/natThread.cc (working copy)
@@ -27,8 +27,11 @@ details. */
#include <java/lang/NullPointerException.h>
#include <jni.h>
+
+#ifdef INTERPRETER
#include <jvmti.h>
#include "jvmti-int.h"
+#endif
#ifdef ENABLE_JVMPI
#include <jvmpi.h>
@@ -217,8 +220,10 @@ java::lang::Thread::finish_ ()
nt->park_helper.deactivate ();
group->removeThread (this);
+#ifdef INTERPRETER
if (JVMTI_REQUESTED_EVENT (ThreadEnd))
_Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_END, this, nt->jni_env);
+#endif
#ifdef ENABLE_JVMPI
if (_Jv_JVMPI_Notify_THREAD_END)
@@ -258,11 +263,13 @@ java::lang::Thread::finish_ ()
static void
_Jv_NotifyThreadStart (java::lang::Thread* thread)
{
+#ifdef INTERPRETER
if (JVMTI_REQUESTED_EVENT (ThreadStart))
{
natThread *nt = reinterpret_cast<natThread *> (thread->data);
_Jv_JVMTI_PostEvent (JVMTI_EVENT_THREAD_START, thread, nt->jni_env);
}
+#endif
#ifdef ENABLE_JVMPI
if (_Jv_JVMPI_Notify_THREAD_START)
Index: java/lang/Class.h
===================================================================
--- java/lang/Class.h (revision 127010)
+++ java/lang/Class.h (working copy)
@@ -97,9 +97,9 @@ class _Jv_Linker;
class _Jv_ExecutionEngine;
class _Jv_CompiledEngine;
class _Jv_IndirectCompiledEngine;
-class _Jv_InterpreterEngine;
#ifdef INTERPRETER
+class _Jv_InterpreterEngine;
class _Jv_ClassReader;
class _Jv_InterpClass;
class _Jv_InterpMethod;
@@ -619,6 +619,7 @@ private:
friend class ::_Jv_ClassReader;
friend class ::_Jv_InterpClass;
friend class ::_Jv_InterpMethod;
+ friend class ::_Jv_InterpreterEngine;
#endif
friend class ::_Jv_StackTrace;
@@ -633,7 +634,6 @@ private:
friend class ::_Jv_ExecutionEngine;
friend class ::_Jv_CompiledEngine;
friend class ::_Jv_IndirectCompiledEngine;
- friend class ::_Jv_InterpreterEngine;
friend class ::_Jv_ClosureList;
friend void ::_Jv_sharedlib_register_hook (jclass klass);
Index: java/lang/natClass.cc
===================================================================
--- java/lang/natClass.cc (revision 127010)
+++ java/lang/natClass.cc (working copy)
@@ -671,6 +671,7 @@ java::lang::Class::finalize (void)
engine->unregister(this);
}
+#ifdef INTERPRETER
void
_Jv_ClosureList::releaseClosures (_Jv_ClosureList **closures)
{
@@ -692,6 +693,7 @@ _Jv_ClosureList::registerClosure (jclass
this->next = *closures;
*closures = this;
}
+#endif
// This implements the initialization process for a class. From Spec
// section 12.4.2.
@@ -2065,6 +2067,7 @@ _Jv_GetClassState (jclass klass)
return klass->state;
}
+#ifdef INTERPRETER
jstring
_Jv_GetInterpClassSourceFile (jclass klass)
{
@@ -2077,3 +2080,4 @@ _Jv_GetInterpClassSourceFile (jclass kla
return NULL;
}
+#endif
Index: java/lang/reflect/natVMProxy.cc
===================================================================
--- java/lang/reflect/natVMProxy.cc (revision 127010)
+++ java/lang/reflect/natVMProxy.cc (working copy)
@@ -42,6 +42,7 @@ details. */
#include <java/lang/IllegalArgumentException.h>
#include <java/lang/Integer.h>
#include <java/lang/StringBuffer.h>
+#include <java/lang/UnsupportedOperationException.h>
#include <java/lang/VMClassLoader.h>
#include <java/lang/VMCompiler.h>
#include <java/lang/reflect/InvocationHandler.h>
@@ -65,6 +66,15 @@ details. */
using namespace java::lang::reflect;
using namespace java::lang;
+#ifndef INTERPRETER
+jclass
+java::lang::reflect::VMProxy::generateProxyClass
+ (ClassLoader *, Proxy$ProxyData *)
+{
+ throw new UnsupportedOperationException (
+ JvNewStringLatin1 ("Interpreter not available"));
+}
+#else
typedef void (*closure_fun) (ffi_cif*, void*, void**, void*);
static void *ncode (int method_index, jclass klass, _Jv_Method *self, closure_fun fun);
static void run_proxy (ffi_cif*, void*, void**, void*);
@@ -444,3 +454,5 @@ ncode (int method_index, jclass klass, _
self->ncode = code;
return self->ncode;
}
+
+#endif // INTERPRETER
Index: Makefile.am
===================================================================
--- Makefile.am (revision 127010)
+++ Makefile.am (working copy)
@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS = foreign subdir-objects
-ACLOCAL_AMFLAGS = -I . -I .. -I ../config
+ACLOCAL_AMFLAGS = -I . -I .. -I ../config -I libltdl
# May be used by various substitution variables.
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
@@ -186,8 +186,14 @@ libgij_la_LIBADD = -L$(here)/.libs libgc
libgij_la_LDFLAGS = -rpath $(toolexeclibdir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
-libgcj_la_SOURCES = prims.cc jni.cc jvmti.cc exception.cc stacktrace.cc \
- link.cc defineclass.cc interpret.cc verify.cc \
+if INTERPRETER
+libgcj_interpret_source_files = jvmti.cc interpret.cc
+else
+libgcj_interpret_source_files =
+endif
+
+libgcj_la_SOURCES = prims.cc jni.cc exception.cc stacktrace.cc \
+ link.cc defineclass.cc verify.cc $(libgcj_interpret_source_files) \
$(nat_source_files)
## We need to compile at least the interpreter this way.
@@ -830,12 +836,22 @@ grmiregistry_LDADD = -L$(here)/.libs lib
grmiregistry_DEPENDENCIES = libgcj-tools.la
## ################################################################
+if INTERPRETER
+nat_jdwp_source_files = \
+gnu/classpath/jdwp/natVMFrame.cc \
+gnu/classpath/jdwp/natVMMethod.cc \
+gnu/classpath/jdwp/natVMVirtualMachine.cc
+nat_jvmti_source_files = \
+gnu/gcj/jvmti/natBreakpoint.cc \
+gnu/gcj/jvmti/natNormalBreakpoint.cc
+else
+nat_jdwp_source_files =
+nat_jvmti_source_files =
+endif
## This lists all the C++ source files in subdirectories.
nat_source_files = \
-gnu/classpath/jdwp/natVMFrame.cc \
-gnu/classpath/jdwp/natVMMethod.cc \
-gnu/classpath/jdwp/natVMVirtualMachine.cc \
+$(nat_jdwp_source_files) \
gnu/classpath/natConfiguration.cc \
gnu/classpath/natSystemProperties.cc \
gnu/classpath/natVMStackWalker.cc \
@@ -850,8 +866,7 @@ gnu/gcj/convert/natOutput_EUCJIS.cc \
gnu/gcj/convert/natOutput_SJIS.cc \
gnu/gcj/io/natSimpleSHSStream.cc \
gnu/gcj/io/shs.cc \
-gnu/gcj/jvmti/natBreakpoint.cc \
-gnu/gcj/jvmti/natNormalBreakpoint.cc \
+$(nat_jvmti_source_files) \
gnu/gcj/runtime/natFinalizerThread.cc \
gnu/gcj/runtime/natSharedLibLoader.cc \
gnu/gcj/runtime/natSystemClassLoader.cc \