AC_SUBST(CACAO_LIBDIR)
-dnl Features
+AC_CHECK_ENABLE_LTDL
AC_CHECK_ENABLE_JAVA
AC_CHECK_ENABLE_JIT
-dnl with-options
AC_CHECK_WITH_CACAOH
-dnl check for stuff that should be done in software
AC_CHECK_SOFTFLOAT
AC_CHECK_SOFT_FLOAT_CMP
AC_CHECK_SOFT_DOUBLE_CMP
AC_CHECK_WITH_JRE_LAYOUT
-dnl check if GNU Classpath should be linked statically into CACAO
-AC_MSG_CHECKING(whether to link GNU Classpath native libraries statically into CACAO)
-AC_ARG_WITH([static-classpath],
- [AS_HELP_STRING(--with-static-classpath,link GNU classpath native libraries statically into CACAO [[default=no]])],
- [case "${enableval}" in
- yes) WITH_STATIC_CLASSPATH=yes;;
- *) WITH_STATIC_CLASSPATH=no;;
- esac],
- [WITH_STATIC_CLASSPATH=no])
-AC_MSG_RESULT(${WITH_STATIC_CLASSPATH})
-
-if test x"${WITH_STATIC_CLASSPATH}" = "xyes"; then
- AC_DEFINE([WITH_STATIC_CLASSPATH], 1, [link GNU classpath native libraries statically into CACAO])
-
- dnl check for some classpath related stuff when we link statically
- AM_ICONV_LINK
-else
- AC_CHECK_ENABLE_LTDL
-fi
-AM_CONDITIONAL([WITH_STATIC_CLASSPATH], test x"${WITH_STATIC_CLASSPATH}" = "xyes")
-AC_SUBST(WITH_STATIC_CLASSPATH)
-
-
dnl check for some programs we need
case "${WITH_CLASSPATH}" in
[src/native/Makefile]
[src/native/include/Makefile]
[src/native/jvmti/Makefile]
- [src/native/tools/Makefile]
[src/native/vm/Makefile]
[src/native/vm/cldc1.1/Makefile]
[src/native/vm/gnu/Makefile]
libjvm.la
endif
-if WITH_STATIC_CLASSPATH
-cacao_LDFLAGS += \
- $(LTLIBICONV)
-
-CLASSPATH_LIBS = \
- $(CLASSPATH_LIBDIR)/classpath/libjavaio.a \
- $(CLASSPATH_LIBDIR)/classpath/libjavanio.a \
- $(CLASSPATH_LIBDIR)/classpath/libjavanet.a \
- $(CLASSPATH_LIBDIR)/classpath/libjavautil.a \
- $(CLASSPATH_LIBDIR)/classpath/libjavalang.a \
- $(CLASSPATH_LIBDIR)/classpath/libjavalangreflect.a
-
-CACAO_LIBS += \
- $(CLASSPATH_LIBS)
-
-#if USE_GTK_PEER
-#cacao_CFLAGS = \
-# $(GTK_CFLAGS) $(CAIRO_CFLAGS) $(PANGOFT2_CFLAGS) \
-# $(XML_CFLAGS) $(XSLT_CFLAGS)
-#
-#cacao_LDFLAGS += \
-# $(GTK_LIBS) $(CAIRO_LIBS) $(PANGOFT2_LIBS) $(X_LIBS) -lXtst \
-# $(XML_LIBS) $(XSLT_LIBS)
-#
-#CLASSPATH_LIBS += \
-# $(CLASSPATH_LIBDIR)/classpath/libgtkpeer.a
-#endif
-endif
-
if ENABLE_RT_TIMING
cacao_LDFLAGS += -lrt
endif
int main(int argc, char **argv)
{
-#if defined(ENABLE_LIBJVM) && !defined(WITH_STATIC_CLASSPATH)
+#if defined(ENABLE_LIBJVM)
char *path;
#endif
/* load and initialize a Java VM, return a JNI interface pointer in env */
-#if defined(ENABLE_LIBJVM) && !defined(WITH_STATIC_CLASSPATH)
+#if defined(ENABLE_LIBJVM)
# if defined(WITH_JRE_LAYOUT)
/* SUN also uses a buffer of 4096-bytes (strace is your friend). */
if (jvmti) jvmti_set_phase(JVMTI_PHASE_START);
#endif
-#if !defined(WITH_STATIC_CLASSPATH) && defined(ENABLE_LIBJVM)
+#if defined(ENABLE_LIBJVM)
if (!(libjvm_vm_run = lt_dlsym(libjvm_handle, "vm_run"))) {
fprintf(stderr, "lt_dlsym failed: %s\n", lt_dlerror());
abort();
include \
vm
-CLEANFILES = \
- nativetable.inc
-
if ENABLE_JVMTI
SUBDIRS += jvmti
JVMTI_LIB = jvmti/libjvmti.la
endif
-if WITH_STATIC_CLASSPATH
-SUBDIRS += tools
-
-GENNATIVETABLE=$(top_builddir)/src/native/tools/gennativetable
-
-CLASSPATH = $(top_builddir)/src/lib/classes/:$(CLASSPATH_GLIBJ_ZIP)
-
-$(srcdir)/native.c: nativetable.inc
-
-nativetable.inc: $(CACAO_VM_ZIP) $(CLASSPATH_GLIBJ_ZIP) $(top_builddir)/src/native/tools/gennativetable
- echo $(GENNATIVETABLE) -bootclasspath $(CLASSPATH) > $(top_builddir)/src/native/nativetable.inc
- if `$(GENNATIVETABLE) -bootclasspath $(CLASSPATH) > $(top_builddir)/src/native/nativetable.inc` ; then true; else rm -f $(top_builddir)/src/native/nativetable.inc; exit 1; fi
-endif
-
noinst_LTLIBRARIES = libnative.la
if ENABLE_JNI
java_security_VMAccessController.h
endif
-ADDITIONAL_STATIC_CLASSPATH_HEADER_FILES = \
- java_net_DatagramPacket.h \
- java_net_InetAddress.h \
- \
- gnu_java_net_PlainDatagramSocketImpl.h \
- gnu_java_net_PlainSocketImpl.h \
- gnu_java_nio_PipeImpl.h \
- gnu_java_nio_channels_FileChannelImpl.h \
- gnu_java_nio_charset_iconv_IconvEncoder.h \
- gnu_java_nio_charset_iconv_IconvDecoder.h \
- java_lang_VMProcess.h \
- java_net_SocketImpl.h \
- java_nio_MappedByteBufferImpl.h \
- java_nio_channels_spi_SelectorProvider.h
-
CLEANFILES = \
*.h
$(GEN_JVMTI_HEADER_FILES)
endif
-if WITH_STATIC_CLASSPATH
-DO_HEADER_FILES += \
- $(ADDITIONAL_STATIC_CLASSPATH_HEADER_FILES)
-endif
-
if WITH_CLASSPATH_GNU
CLASSPATH = $(top_builddir)/src/lib/classes/:$(CLASSPATH_CLASSES)
VM_ZIP = $(top_builddir)/src/lib/vm.zip
#endif
-/* include table of native functions ******************************************/
-
-#if defined(WITH_STATIC_CLASSPATH)
-# include "native/nativetable.inc"
-#endif
-
-
-/* tables for methods *********************************************************/
-
-#if defined(WITH_STATIC_CLASSPATH)
-#define NATIVETABLESIZE (sizeof(nativetable)/sizeof(struct nativeref))
-
-/* table for fast string comparison */
-static nativecompref nativecomptable[NATIVETABLESIZE];
-
-/* string comparsion table initialized */
-static bool nativecompdone = false;
-#endif
-
-
/* global variables ***********************************************************/
static avl_tree_t *tree_native_methods;
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
static utf *native_make_overloaded_function(utf *name, utf *descriptor)
{
char *newname;
return ne;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
-
-
-/* native_findfunction *********************************************************
-
- Looks up a method (must have the same class name, method name,
- descriptor and 'static'ness) and returns a function pointer to it.
- Returns: function pointer or NULL (if there is no such method)
-
- Remark: For faster operation, the names/descriptors are converted
- from C strings to Unicode the first time this function is called.
-
-*******************************************************************************/
-
-#if defined(WITH_STATIC_CLASSPATH)
-functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
- bool isstatic)
-{
- /* entry of table for fast string comparison */
- struct nativecompref *n;
- s4 i;
-
- isstatic = isstatic ? true : false;
-
- if (!nativecompdone) {
- for (i = 0; i < NATIVETABLESIZE; i++) {
- nativecomptable[i].classname =
- utf_new_char(nativetable[i].classname);
-
- nativecomptable[i].methodname =
- utf_new_char(nativetable[i].methodname);
-
- nativecomptable[i].descriptor =
- utf_new_char(nativetable[i].descriptor);
-
- nativecomptable[i].isstatic = nativetable[i].isstatic;
- nativecomptable[i].func = nativetable[i].func;
- }
-
- nativecompdone = true;
- }
-
- for (i = 0; i < NATIVETABLESIZE; i++) {
- n = &(nativecomptable[i]);
-
- if (cname == n->classname && mname == n->methodname &&
- desc == n->descriptor && isstatic == n->isstatic)
- return n->func;
- }
-
- /* no function was found, throw exception */
-
- exceptions_throw_unsatisfiedlinkerror(mname);
-
- return NULL;
-}
-#endif /* defined(WITH_STATIC_CLASSPATH) */
/* native_resolve_function *****************************************************
return f;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
+#endif
/* native_new_and_init *********************************************************
#define NATIVE_METHODS_COUNT sizeof(methods) / sizeof(JNINativeMethod)
-/* table for locating native methods */
-
-#if defined(WITH_STATIC_CLASSPATH)
-typedef struct nativeref nativeref;
-typedef struct nativecompref nativecompref;
-#endif
-
-
/* native_methods_node_t ******************************************************/
typedef struct native_methods_node_t native_methods_node_t;
#endif
-struct nativeref {
- char *classname;
- char *methodname;
- char *descriptor;
- bool isstatic;
- functionptr func;
-};
-
-/* table for fast string comparison */
-
-struct nativecompref {
- utf *classname;
- utf *methodname;
- utf *descriptor;
- bool isstatic;
- functionptr func;
-};
-
-
/* function prototypes ********************************************************/
bool native_init(void);
void native_method_register(utf *classname, const JNINativeMethod *methods,
int32_t count);
-#if defined(WITH_STATIC_CLASSPATH)
-
-functionptr native_findfunction(utf *cname, utf *mname, utf *desc,
- bool isstatic);
-
-#else /* defined(WITH_STATIC_CLASSPATH) */
-
-# if defined(ENABLE_LTDL)
+#if defined(ENABLE_LTDL)
lt_dlhandle native_library_open(utf *filename);
void native_library_add(utf *filename, classloader *loader,
lt_dlhandle handle);
hashtable_library_name_entry *native_library_find(utf *filename,
classloader *loader);
-# endif
+#endif
functionptr native_resolve_function(methodinfo *m);
-#endif /* defined(WITH_STATIC_CLASSPATH) */
-
java_handle_t *native_new_and_init(classinfo *c);
-
java_handle_t *native_new_and_init_string(classinfo *c, java_handle_t *s);
#endif /* _NATIVE_H */
+++ /dev/null
-## src/native/tools/Makefile.am
-##
-## Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
-## C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
-## E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
-## J. Wenninger, Institut f. Computersprachen - TU Wien
-##
-## This file is part of CACAO.
-##
-## This program is free software; you can redistribute it and/or
-## modify it under the terms of the GNU General Public License as
-## published by the Free Software Foundation; either version 2, or (at
-## your option) any later version.
-##
-## This program is distributed in the hope that it will be useful, but
-## WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-## 02110-1301, USA.
-##
-## Contact: cacao@cacaojvm.org
-##
-## Authors: Christian Thalinger
-
-
-AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR) -I$(top_srcdir)/src/vm/jit/$(ARCH_DIR)/$(OS_DIR) -I$(top_builddir)/src
-
-LIBS =
-
-noinst_PROGRAMS = gennativetable
-
-gennativetable_SOURCES = gennativetable.c
-
-gennativetable_LDADD = \
- $(top_builddir)/src/cacaoh/libcacaoh.la \
- $(top_builddir)/src/fdlibm/libfdlibm.la
-
-gennativetable_DEPENDENCIES = \
- $(gennativetable_LDADD)
-
-
-## Local variables:
-## mode: Makefile
-## indent-tabs-mode: t
-## c-basic-offset: 4
-## tab-width: 8
-## compile-command: "automake --add-missing"
-## End:
+++ /dev/null
-/* src/native/tools/gennativetable.c - generate nativetable.h for native.c
-
- Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
- C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
- E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
- J. Wenninger, Institut f. Computersprachen - TU Wien
-
- This file is part of CACAO.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2, or (at
- your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA.
-
- Contact: cacao@cacaojvm.org
-
- Authors: Christian Thalinger
-
- Changes:
-
-*/
-
-
-#include "config.h"
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "vm/types.h"
-
-#include "cacaoh/headers.h"
-#include "mm/gc-common.h"
-#include "mm/memory.h"
-
-#if defined(ENABLE_THREADS)
-# include "threads/native/threads.h"
-#endif
-
-#include "toolbox/chain.h"
-#include "vm/classcache.h"
-#include "vm/exceptions.h"
-#include "vm/global.h"
-#include "vm/loader.h"
-#include "vm/options.h"
-#include "vm/stringlocal.h"
-#include "vm/suck.h"
-
-
-/* define heap sizes **********************************************************/
-
-#define HEAP_MAXSIZE 4 * 1024 * 1024 /* default 4MB */
-#define HEAP_STARTSIZE 100 * 1024 /* default 100kB */
-
-#define ACC_NATIVELY_OVERLOADED 0x10000000
-
-
-/* define cacaoh options ******************************************************/
-
-enum {
- OPT_HELP,
- OPT_VERSION,
- OPT_VERBOSE,
- OPT_BOOTCLASSPATH,
-
- DUMMY
-};
-
-
-opt_struct opts[] = {
- { "help", false, OPT_HELP },
- { "version", false, OPT_VERSION },
- { "verbose", false, OPT_VERBOSE },
- { "bootclasspath", true, OPT_BOOTCLASSPATH },
- { NULL, false, 0 }
-};
-
-
-static JavaVMInitArgs *gennativetable_options_prepare(int argc, char **argv);
-
-
-int main(int argc, char **argv)
-{
- JavaVMInitArgs *vm_args;
- char *bootclasspath;
-
- chain *nativemethod_chain;
- classcache_name_entry *nmen;
- classcache_class_entry *clsen;
- classinfo *c;
- s4 i;
- s4 j;
- u4 slot;
- methodinfo *m;
- methodinfo *m2;
- bool nativelyoverloaded;
-
-#if defined(DISABLE_GC)
- gc_init(HEAP_MAXSIZE, HEAP_STARTSIZE);
-#endif
-
- vm_args = gennativetable_options_prepare(argc, argv);
-
- while ((i = options_get(opts, vm_args)) != OPT_DONE) {
- switch (i) {
- case OPT_IGNORE:
- break;
-
- case OPT_HELP:
-/* usage(); */
- break;
-
- case OPT_BOOTCLASSPATH:
- bootclasspath = MNEW(char, strlen(opt_arg) + strlen("0"));
- strcpy(bootclasspath, opt_arg);
- break;
-
- case OPT_VERSION:
-/* version(); */
- break;
-
- case OPT_VERBOSE:
- opt_verbose = true;
- loadverbose = true;
- linkverbose = true;
- break;
-
- default:
-/* usage(); */
- ;
- }
- }
-
- /* initialize the garbage collector */
-
- gc_init(HEAP_MAXSIZE, HEAP_STARTSIZE);
-
-#if defined(ENABLE_THREADS)
- threads_preinit();
-#endif
-
- /* initialize the string hashtable stuff: lock (must be done
- _after_ threads_preinit) */
-
- if (!string_init())
- throw_main_exception_exit();
-
- /* initialize the utf8 hashtable stuff: lock, often used utf8 strings
- (must be done _after_ threads_preinit) */
-
- if (!utf8_init())
- throw_main_exception_exit();
-
- /* initialize the classcache hashtable stuff: lock, hashtable
- (must be done _after_ threads_preinit) */
-
- if (!classcache_init())
- throw_main_exception_exit();
-
- /* initialize the loader with bootclasspath (must be done _after_
- thread_preinit) */
-
- if (!suck_init())
- throw_main_exception_exit();
-
- suck_add(bootclasspath);
-
- /* initialize the loader subsystems (must be done _after_
- classcache_init) */
-
- if (!loader_init())
- throw_main_exception_exit();
-
-
- /*********************** Load JAVA classes **************************/
-
- nativemethod_chain = chain_new();
- ident_chain = chain_new();
-
- /* load all classes from bootclasspath */
-
- loader_load_all_classes();
-
- /* link all classes */
-
- for (slot = 0; slot < hashtable_classcache.size; slot++) {
- nmen = (classcache_name_entry *) hashtable_classcache.ptr[slot];
-
- for (; nmen; nmen = nmen->hashlink) {
- /* iterate over all class entries */
-
- for (clsen = nmen->classes; clsen; clsen = clsen->next) {
- c = clsen->classobj;
-
- if (c == NULL)
- continue;
-
- /* find overloaded methods */
-
- for (i = 0; i < c->methodscount; i++) {
- m = &(c->methods[i]);
-
- if (!(m->flags & ACC_NATIVE))
- continue;
-
- if (!(m->flags & ACC_NATIVELY_OVERLOADED)) {
- nativelyoverloaded = false;
-
- for (j = i + 1; j < c->methodscount; j++) {
- m2 = &(c->methods[j]);
-
- if (!(m2->flags & ACC_NATIVE))
- continue;
-
- if (m->name == m2->name) {
- m2->flags |= ACC_NATIVELY_OVERLOADED;
- nativelyoverloaded = true;
- }
- }
-
- if (nativelyoverloaded == true)
- m->flags |= ACC_NATIVELY_OVERLOADED;
- }
- }
-
- for (j = 0; j < c->methodscount; j++) {
- m = &(c->methods[j]);
-
- if (m->flags & ACC_NATIVE) {
- chain_addlast(nativemethod_chain, m);
- }
- }
- }
- }
- }
-
- /* create table of native-methods */
-
- file = stdout;
-
- fprintf(file, "/* This file is machine generated, don't edit it! */\n\n");
-
- m = chain_first(nativemethod_chain);
-
- while (m) {
- printmethod(m);
- m = chain_next(nativemethod_chain);
- }
-
- fprintf(file, "static nativeref nativetable[] = {\n");
-
- m = chain_first(nativemethod_chain);
-
- while (m) {
- fprintf(file, " { \"");
-
- print_classname(m->class);
- fprintf(file, "\",\n \"");
- utf_fprint_printable_ascii(file, m->name);
- fprintf(file, "\",\n \"");
- utf_fprint_printable_ascii(file, m->descriptor);
- fprintf(file, "\",\n ");
-
- if (m->flags & ACC_STATIC)
- fprintf(file, "true");
- else
- fprintf(file, "false");
-
- fprintf(file, ",\n ");
- fprintf(file, "(functionptr) Java_");
- printID(m->class->name);
- fprintf(file, "_");
- printID(m->name);
-
- if (m->flags & ACC_NATIVELY_OVERLOADED)
- printOverloadPart(m->descriptor);
-
- fprintf(file,"\n },\n");
-
- m = chain_next(nativemethod_chain);
- }
-
- chain_free(nativemethod_chain);
-
- fprintf(file, "};\n");
-
- fclose(file);
-
- /* release all resources */
-
- loader_close();
-
- /* everything is ok */
-
- return 0;
-}
-
-
-/* gennativetable_options_prepare **********************************************
-
- Prepare the JavaVMInitArgs.
-
-*******************************************************************************/
-
-static JavaVMInitArgs *gennativetable_options_prepare(int argc, char **argv)
-{
- JavaVMInitArgs *vm_args;
- s4 i;
-
- vm_args = NEW(JavaVMInitArgs);
-
- vm_args->nOptions = argc - 1;
- vm_args->options = MNEW(JavaVMOption, argc);
-
- for (i = 1; i < argc; i++)
- vm_args->options[i - 1].optionString = argv[i];
-
- return vm_args;
-}
-
-
-/*
- * These are local overrides for various environment variables in Emacs.
- * Please do not remove this and leave it at the end of the file, where
- * Emacs will automagically detect them.
- * ---------------------------------------------------------------------
- * Local variables:
- * mode: c
- * indent-tabs-mode: t
- * c-basic-offset: 4
- * tab-width: 4
- * End:
- */
funcdisp = dseg_add_functionptr(cd, f);
-#if !defined(WITH_STATIC_CLASSPATH)
if (f == NULL)
patcher_add_patch_ref(jd, PATCHER_resolve_native_function, m, funcdisp);
-#endif
#if defined(ENABLE_GC_CACAO)
/* Save callee saved integer registers in stackframeinfo (GC may
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native_function(patchref_t *pr)
{
methodinfo *m;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/* patcher_get_putstatic *******************************************************
funcdisp = dseg_add_functionptr(cd, f);
-#if !defined(WITH_STATIC_CLASSPATH)
if (f == NULL) {
patcher_add_patch_ref(jd, PATCHER_resolve_native_function, m, funcdisp);
if (opt_showdisassemble)
M_NOP;
}
-#endif
#if defined(ENABLE_GC_CACAO)
/* Save callee saved integer registers in stackframeinfo (GC may
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native_function(patchref_t *pr)
{
methodinfo *m;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/*
/* get function address (this must happen before the stackframeinfo) */
-#if !defined(WITH_STATIC_CLASSPATH)
if (f == NULL)
codegen_addpatchref(cd, PATCHER_resolve_native, m, 0);
-#endif
M_AST_IMM((ptrint) f, REG_SP, 4 * 4);
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native(u1 *sp)
{
u1 *ra;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/*
THROW0;
PATCHER_NATIVECALL ( #am #af #addrcif ... -- )
-#if !defined(WITH_STATIC_CLASSPATH)
stackframeinfo sfi;
bool result;
global_sp = sp;
IP[-4] = opt_verbosecall ? INST_ADDR(TRACENATIVECALL) : INST_ADDR(NATIVECALL);
SET_IP(IP - 4);
patchersuper_rewrite(IP);
-#else
-assert(false);
-#endif
TRACECALL ( #am -- )
#if !defined(NDEBUG)
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool intrp_patcher_resolve_native(u1 *sp)
{
ptrint *ip;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/*
if (m->flags & ACC_NATIVE) {
functionptr f;
-#if defined(WITH_STATIC_CLASSPATH)
- f = native_findfunction(m->class->name, m->name, m->descriptor,
- (m->flags & ACC_STATIC));
- if (f == NULL)
- return NULL;
-#else
f = NULL;
-#endif
code = codegen_generate_stub_native(m, f);
M_AADD_IMM(-(cd->stackframesize*4), REG_SP);
/* get function address (this must happen before the stackframeinfo) */
-#if !defined(WITH_STATIC_CLASSPATH)
if (f == NULL) {
codegen_addpatchref(cd, PATCHER_resolve_native_function, m, 0);
}
-#endif
+
M_AMOV_IMM(f, REG_ATMP2); /* do not move this line, the patcher is needed */
M_AST(REG_ATMP2, REG_SP, 4 * 4);
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native_function(u1 *sp)
{
methodinfo *m;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/* patcher_invokeinterface *****************************************************
funcdisp = dseg_add_functionptr(cd, f);
-#if !defined(WITH_STATIC_CLASSPATH)
if (f == NULL)
patcher_add_patch_ref(jd, PATCHER_resolve_native_function, m, funcdisp);
-#endif
/* save integer and float argument registers */
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native_function(patchref_t *pr)
{
methodinfo *m;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/* patcher_invokestatic_special ************************************************
bool patcher_resolve_classref_to_flags(patchref_t *pr);
#define PATCHER_resolve_classref_to_flags (functionptr) patcher_resolve_classref_to_flags
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native_function(patchref_t *pr);
#define PATCHER_resolve_native_function (functionptr) patcher_resolve_native_function
-#endif
/* old patcher functions */
bool patcher_resolve_classref_to_flags(u1 *sp);
#define PATCHER_resolve_classref_to_flags (functionptr) patcher_resolve_classref_to_flags
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native_function(u1 *sp);
#define PATCHER_resolve_native_function (functionptr) patcher_resolve_native_function
-#endif
bool patcher_get_putstatic(u1 *sp);
bool patcher_athrow_areturn(u1 *sp);
#define PATCHER_athrow_areturn (functionptr) patcher_athrow_areturn
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native(u1 *sp);
#define PATCHER_resolve_native (functionptr) patcher_resolve_native
-#endif
/* stuff for the interpreter **************************************************/
funcdisp = dseg_add_functionptr(cd, f);
-#if !defined(WITH_STATIC_CLASSPATH)
if (f == NULL)
patcher_add_patch_ref(jd, PATCHER_resolve_native_function, m, funcdisp);
-#endif
/* emit trace code */
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native_function(patchref_t *pr)
{
methodinfo *m;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/* patcher_get_putstatic *******************************************************
funcdisp = dseg_add_functionptr(cd, f);
-#if !defined(WITH_STATIC_CLASSPATH)
- if (f == NULL) {
+ if (f == NULL)
codegen_addpatchref(cd, PATCHER_resolve_native, m, funcdisp);
- }
-#endif
/* save integer and float argument registers */
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native(u1 *sp)
{
u1 *ra;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/*
disp = dseg_add_functionptr(cd, f);
-#if !defined(WITH_STATIC_CLASSPATH)
if (f == NULL)
patcher_add_patch_ref(jd, PATCHER_resolve_native_function, m, disp);
-#endif
M_ILD_DSEG(REG_ITMP1, disp);
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native_function(patchref_t *pr)
{
methodinfo *m;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
+
/*
* These are local overrides for various environment variables in Emacs.
funcdisp = dseg_add_functionptr(cd, f);
-#if !defined(WITH_STATIC_CLASSPATH)
- if (f == NULL) {
+ if (f == NULL)
codegen_add_patch_ref(cd, PATCHER_resolve_native, m, funcdisp);
- }
-#endif
/* save float argument registers */
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native(u1 *sp)
{
methodinfo *m;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/*
/* get function address (this must happen before the stackframeinfo) */
-#if !defined(WITH_STATIC_CLASSPATH)
if (f == NULL)
codegen_add_patch_ref(cd, PATCHER_resolve_native, m, 0);
-#endif
M_MOV_IMM(f, REG_ITMP3);
*******************************************************************************/
-#if !defined(WITH_STATIC_CLASSPATH)
bool patcher_resolve_native(u1 *sp)
{
u1 *ra;
return true;
}
-#endif /* !defined(WITH_STATIC_CLASSPATH) */
/*
properties_add("java.class.version", CLASS_VERSION);
-# if defined(WITH_STATIC_CLASSPATH)
- properties_add("gnu.classpath.boot.library.path", ".");
- properties_add("java.library.path" , ".");
-# else
properties_add("gnu.classpath.boot.library.path", boot_library_path);
/* Get and set java.library.path. */
java_library_path = "";
properties_add("java.library.path", java_library_path);
-# endif
properties_add("java.io.tmpdir", "/tmp");
properties_add("os.version", utsnamebuf->release);
# endif
-# if defined(WITH_STATIC_CLASSPATH)
- /* This is just for debugging purposes and can cause troubles in
- GNU Classpath. */
-
- properties_add("gnu.cpu.endian", "unknown");
-# else
-# if WORDS_BIGENDIAN == 1
+# if WORDS_BIGENDIAN == 1
properties_add("gnu.cpu.endian", "big");
-# else
+# else
properties_add("gnu.cpu.endian", "little");
-# endif
# endif
properties_add("file.separator", "/");