sjlj jumbo patch

From-SVN: r30591
This commit is contained in:
Tom Tromey 1999-11-19 19:13:42 +00:00
parent 2395f8059c
commit 3cf88fb4e8
18 changed files with 469 additions and 661 deletions

View File

@ -1,3 +1,70 @@
1999-11-19 Tom Tromey <tromey@cygnus.com>
* Makefile.am (DIVIDESPEC): Removed.
(EXCEPTIONSPEC): Removed.
1999-11-19 Andrew Haley <aph@cygnus.com>
* Makefile.am (JCFLAGS): Add -L$(here)
(JC1FLAGS): Ditto.
* Makefile.in: Rebuild.
1999-11-18 Tom Tromey <tromey@cygnus.com>
* java/lang/natDouble.cc: Include <config.h>.
* include/config.h.in: Rebuilt.
* acconfig.h (SJLJ_EXCEPTIONS): Undefine.
* configure.host: Force -fsjlj-exceptions on non-sparc, non-x86
targets.
* configure: Rebuilt.
* configure.in (EXCEPTIONSPEC): Allow -fsjlj-exceptions to be
requested by configure.host. Don't put `-D' option into
libgcj.spec; instead, define SJLJ_EXCEPTIONS with AC_DEFINE.
* configure: Rebuilt.
* configure.in (EXCEPTIONSPEC): Changed `_' to `-' in
sjlj-exceptions.
1999-11-18 Andrew Haley <aph@cygnus.com>
* Makefile.am: rename SJLJ_EXCEPTIONS to EXCEPTIONSPEC.
(AM_CFLAGS): remove SJLJ_EXCEPTIONS.
(JC1FLAGS): Ditto.
* Makefile.in: Rebuild
* acconfig.h: remove SJLJ_EXCEPTIONS
* configure.in: rename SJLJ_EXCEPTIONS to EXCEPTIONSPEC.
Do not AC_DEFINE SJLJ_EXCEPTIONS.
* libgcj.spec.in: Add EXCEPTIONSPEC to jc1.
* gcj/Makefile.in, include/Makefile.in: rebuild.
* include/config.h.in: remove SJLJ_EXCEPTIONS.
1999-11-18 Andrew Haley <aph@cygnus.com>
* gij.cc (main): Rename label to prevent conflict.
* exception.cc (_Jv_type_matcher): Don't check the table if we're
using setjmp/longjmp exceptions: there isn't one.
1999-11-17 Andrew Haley <aph@cygnus.com>
* exception.cc (_Jv_type_matcher): Ignore null exception tables.
(_Jv_Throw ): Add SJLJ_EXCEPTIONS.
(__sjthrow): Add declaration.
* Makefile.am (JCFLAGS): Add SJLJ_EXCEPTIONS
(JC1FLAGS): Ditto
(AM_CFLAGS): Ditto
(AM_CXXFLAGS): Ditto
* Makefile.in: Rebuild
* acconfig.h: Add SJLJ_EXCEPTIONS
* configure.in: Add SJLJ_EXCEPTIONS
* configure: Rebuild.
* gcj/Makefile.in: Rebuild.
* gcj/cni.h: Add support for sjlj-exceptions.
* gcj/javaprims.h: Add _Jv_Sjlj_Throw.
* include/Makefile.in: Rebuild.
* include/default-signal.h: Add support for sjlj-exceptions.
1999-11-18 Tom Tromey <tromey@cygnus.com>
* no-threads.cc (_Jv_ThreadStart): Use JvFail and not JvAssert.

View File

@ -69,15 +69,16 @@ JAVAC = $(GCJ) -C
EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
WARNINGS = -W -Wall
AM_CXXFLAGS = -fno-rtti -fvtable-thunks @LIBGCJ_CXXFLAGS@ $(WARNINGS)
AM_CXXFLAGS = -fno-rtti -fvtable-thunks @LIBGCJ_CXXFLAGS@ @EXCEPTIONSPEC@ \
$(WARNINGS)
if USING_GCC
AM_CFLAGS = @LIBGCJ_CFLAGS@ $(WARNINGS)
else
AM_CFLAGS = @LIBGCJ_CFLAGS@
endif
JCFLAGS = -g
JC1FLAGS = -g @LIBGCJ_JAVAFLAGS@
JCFLAGS = -g -L$(here)
JC1FLAGS = -g -L$(here) @LIBGCJ_JAVAFLAGS@
LIBFFIINCS = -I$(top_srcdir)/../libffi/include -I../libffi/include
@ -85,8 +86,6 @@ INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \
$(GCINCS) $(THREADINCS) \
$(EH_COMMON_INCLUDE) $(ZINCS) $(LIBFFIINCS)
DIVIDESPEC = @DIVIDESPEC@
## ################################################################

View File

@ -71,7 +71,9 @@ COMPPATH = @COMPPATH@
CPP = @CPP@
CXX = @CXX@
CXXCPP = @CXXCPP@
DIVIDESPEC = @DIVIDESPEC@
DLLTOOL = @DLLTOOL@
EXCEPTIONSPEC = @EXCEPTIONSPEC@
EXEEXT = @EXEEXT@
GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
@ -148,14 +150,16 @@ JAVAC = $(GCJ) -C
EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
WARNINGS = -W -Wall
AM_CXXFLAGS = -fno-rtti -fvtable-thunks @LIBGCJ_CXXFLAGS@ $(WARNINGS)
AM_CXXFLAGS = -fno-rtti -fvtable-thunks @LIBGCJ_CXXFLAGS@ @EXCEPTIONSPEC@ \
$(WARNINGS)
@USING_GCC_TRUE@AM_CFLAGS = \
@USING_GCC_TRUE@@LIBGCJ_CFLAGS@ $(WARNINGS)
@USING_GCC_FALSE@AM_CFLAGS = \
@USING_GCC_FALSE@@LIBGCJ_CFLAGS@
JCFLAGS = -g
JC1FLAGS = -g @LIBGCJ_JAVAFLAGS@
JCFLAGS = -g -L$(here)
JC1FLAGS = -g -L$(here) @LIBGCJ_JAVAFLAGS@
LIBFFIINCS = -I$(top_srcdir)/../libffi/include -I../libffi/include
@ -164,8 +168,6 @@ INCLUDES = -I$(top_srcdir) -Iinclude -I$(top_srcdir)/include \
$(EH_COMMON_INCLUDE) $(ZINCS) $(LIBFFIINCS)
DIVIDESPEC = @DIVIDESPEC@
nat_files = $(nat_source_files:.cc=.lo)
c_files = $(c_source_files:.c=.lo)
javao_files = $(java_source_files:.java=.lo) \
@ -708,8 +710,7 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DATA = $(data_DATA) $(toolexeclib_DATA)
DIST_COMMON = README COPYING.LIB ChangeLog Makefile.am Makefile.in NEWS \
THANKS acconfig.h acinclude.m4 aclocal.m4 configure configure.in \
include/config.h.in include/stamp-h.in libgcj.spec.in
THANKS acinclude.m4 aclocal.m4 configure configure.in libgcj.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@ -931,34 +932,6 @@ config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
include/config.h: include/stamp-h
@if test ! -f $@; then \
rm -f include/stamp-h; \
$(MAKE) include/stamp-h; \
else :; fi
include/stamp-h: $(srcdir)/include/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=include/config.h \
$(SHELL) ./config.status
@echo timestamp > include/stamp-h 2> /dev/null
$(srcdir)/include/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/include/stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/include/stamp-h.in; \
$(MAKE) $(srcdir)/include/stamp-h.in; \
else :; fi
$(srcdir)/include/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/include/stamp-h.in 2> /dev/null
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
-rm -f include/config.h
maintainer-clean-hdr:
libgcj.spec: $(top_builddir)/config.status libgcj.spec.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -1357,32 +1330,29 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-hdr mostlyclean-toolexeclibLTLIBRARIES \
mostlyclean-compile mostlyclean-libtool \
mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean-am: mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-binPROGRAMS \
mostlyclean-noinstPROGRAMS mostlyclean-tags \
mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-hdr clean-toolexeclibLTLIBRARIES clean-compile \
clean-libtool clean-binPROGRAMS clean-noinstPROGRAMS \
clean-tags clean-depend clean-generic mostlyclean-am \
clean-local
clean-am: clean-toolexeclibLTLIBRARIES clean-compile clean-libtool \
clean-binPROGRAMS clean-noinstPROGRAMS clean-tags \
clean-depend clean-generic mostlyclean-am clean-local
clean: clean-recursive
distclean-am: distclean-hdr distclean-toolexeclibLTLIBRARIES \
distclean-compile distclean-libtool \
distclean-binPROGRAMS distclean-noinstPROGRAMS \
distclean-tags distclean-depend distclean-generic \
clean-am
distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \
distclean-libtool distclean-binPROGRAMS \
distclean-noinstPROGRAMS distclean-tags \
distclean-depend distclean-generic clean-am
-rm -f libtool
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-hdr \
maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-binPROGRAMS \
maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
@ -1394,9 +1364,9 @@ maintainer-clean-am: maintainer-clean-hdr \
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \
clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \
.PHONY: mostlyclean-toolexeclibLTLIBRARIES \
distclean-toolexeclibLTLIBRARIES clean-toolexeclibLTLIBRARIES \
maintainer-clean-toolexeclibLTLIBRARIES \
uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \

View File

@ -116,3 +116,6 @@
/* Define if system properties shouldn't be read from
getenv("GCJ_PROPERTIES"). */
#undef DISABLE_GETENV_PROPERTIES
/* Define if using setjmp/longjmp exceptions. */
#undef SJLJ_EXCEPTIONS

845
libjava/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@ libgcj_flags=
libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
libgcj_sjlj=
case "${target_optspace}:${host}" in
yes:*)
@ -59,7 +60,10 @@ case "${host}" in
libgcj_flags="${libgcj_flags} -ffloat-store"
DIVIDESPEC=-fno-use-divide-subroutine
;;
sparc-*)
;;
*)
libgcj_sjlj=yes
;;
esac

View File

@ -57,13 +57,27 @@ AC_ARG_ENABLE(libgcj-debug,
AC_DEFINE(DEBUG)
fi)
dnl See if the user has the enterpreter included.
dnl See if the user has the interpreter included.
AC_ARG_ENABLE(interpreter,
[ --enable-interpreter enable interpreter],
if test "$enable_interpreter" = yes; then
AC_DEFINE(INTERPRETER)
fi)
EXCEPTIONSPEC=
dnl See if we should use setjmp/longjmp exceptions
AC_ARG_ENABLE(sjlj-exceptions,
[ --enable-sjlj-exceptions use setjmp/longjmp exceptions],
if test "$enable_sjlj_exceptions" = yes; then
# This can be set in configure.host.
libgcj_sjlj=yes
fi)
if test "$libgcj_sjlj" = yes; then
EXCEPTIONSPEC="-fsjlj-exceptions"
AC_DEFINE(SJLJ_EXCEPTIONS)
fi
dnl See if the user wants to disable java.net. This is the mildly
dnl ugly way that we admit that target-side configuration sucks.
AC_ARG_ENABLE(java-net,
@ -520,6 +534,7 @@ AC_SUBST(ZLIBS)
AC_SUBST(ZDEPS)
AC_SUBST(ZINCS)
AC_SUBST(DIVIDESPEC)
AC_SUBST(EXCEPTIONSPEC)
AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
AM_CONDITIONAL(NULL_TARGET, test "$NULL_TARGET" = yes)
@ -621,17 +636,21 @@ AC_FUNC_ALLOCA
AC_CHECK_PROGS(PERL, perl, false)
case "${host}" in
i?86-*-linux*)
SIGNAL_HANDLER=include/i386-signal.h
;;
sparc-sun-solaris*)
SIGNAL_HANDLER=include/sparc-signal.h
;;
*)
SIGNAL_HANDLER=include/default-signal.h
;;
esac
if test "$enable_sjlj_exceptions" = yes; then
SIGNAL_HANDLER=include/default-signal.h
else
case "${host}" in
i?86-*-linux*)
SIGNAL_HANDLER=include/i386-signal.h
;;
sparc-sun-solaris*)
SIGNAL_HANDLER=include/sparc-signal.h
;;
*)
SIGNAL_HANDLER=include/default-signal.h
;;
esac
fi
AC_LINK_FILES($SIGNAL_HANDLER, include/java-signal.h)

View File

@ -33,10 +33,10 @@ typedef struct {
extern "C" java_eh_info **__get_eh_info ();
extern "C" void __throw () __attribute__ ((__noreturn__));
extern "C" void __sjthrow () __attribute__ ((__noreturn__));
extern "C" short __get_eh_table_version (void *table);
extern "C" short __get_eh_table_language (void *table);
extern "C" void * malloc (size_t);
extern "C" void free (void *);
@ -45,8 +45,12 @@ extern "C" void *
_Jv_type_matcher (java_eh_info *info, void* match_info,
void *exception_table)
{
if (__get_eh_table_language (exception_table) != EH_LANG_Java)
#ifndef SJLJ_EXCEPTIONS
/* No exception table implies the old style mechanism, so don't check. */
if (exception_table != NULL
&& __get_eh_table_language (exception_table) != EH_LANG_Java)
return NULL;
#endif
/* we don't worry about version info yet, there is only one version! */
@ -125,10 +129,6 @@ _Jv_eh_free ()
*info_ptr = NULL;
}
/* Perform a throw, Java style. Throw will unwind through this call, so
there better not be any handlers or exception thrown here. */
/* Initialize an __eh_info structure with this libraries matching info. */
extern "C" void
@ -136,6 +136,9 @@ _Jv_setup_eh_info (__eh_info *)
{
}
/* Perform a throw, Java style. Throw will unwind through this call,
so there better not be any handlers or exception thrown here. */
extern "C" void
_Jv_Throw (void *value)
{
@ -151,5 +154,12 @@ _Jv_Throw (void *value)
ehinfo->eh_info.language = EH_LANG_Java;
ehinfo->eh_info.version = 1;
ehinfo->value = value;
__throw();
/* We're happy with setjmp/longjmp exceptions or region-based
exception handlers: entry points are provided here for both. */
#ifdef SJLJ_EXCEPTIONS
__sjthrow ();
#else
__throw ();
#endif
}

View File

@ -74,6 +74,7 @@ CXXCPP = @CXXCPP@
DIVIDESPEC = @DIVIDESPEC@
DLLTOOL = @DLLTOOL@
EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
EXCEPTIONSPEC = @EXCEPTIONSPEC@
EXEEXT = @EXEEXT@
GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
@ -89,6 +90,7 @@ LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
PERL = @PERL@
RANLIB = @RANLIB@
@ -98,7 +100,6 @@ THREADINCS = @THREADINCS@
THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@
THREADSPEC = @THREADSPEC@
USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
VERSION = @VERSION@
ZDEPS = @ZDEPS@
ZINCS = @ZINCS@

View File

@ -109,6 +109,10 @@ public:
{ _Jv_MonitorExit (obj); }
};
#ifdef SJLJ_EXCEPTIONS
#define _Jv_Throw _Jv_Sjlj_Throw
#endif
// Throw some exception.
extern void JvThrow (jobject obj) __attribute__ ((__noreturn__));
extern inline void

View File

@ -269,6 +269,7 @@ extern "C" jsize _Jv_GetStringUTFLength (jstring);
extern "C" jsize _Jv_GetStringUTFRegion (jstring, jsize, jsize, char *);
extern "C" void _Jv_Throw (void *) __attribute__ ((__noreturn__));
extern "C" void _Jv_Sjlj_Throw (void *) __attribute__ ((__noreturn__));
extern "C" void* _Jv_Malloc (jsize);
extern "C" void _Jv_Free (void*);

View File

@ -89,7 +89,7 @@ main (int argc, const char **argv)
{
if (i >= argc - 1)
{
no_argument:
no_arg:
fprintf (stderr, "gij: option requires an argument -- `%s'\n",
argv[i]);
fprintf (stderr, "Try `gij --help' for more information.\n");
@ -102,7 +102,7 @@ main (int argc, const char **argv)
else if (! strcmp (arg, "-mx"))
{
if (i >= argc - 1)
goto no_argument;
goto no_arg;
_Jv_SetMaximumHeapSize (argv[++i]);
}
else

View File

@ -74,6 +74,7 @@ CXXCPP = @CXXCPP@
DIVIDESPEC = @DIVIDESPEC@
DLLTOOL = @DLLTOOL@
EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
EXCEPTIONSPEC = @EXCEPTIONSPEC@
EXEEXT = @EXEEXT@
GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
@ -89,6 +90,7 @@ LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
PERL = @PERL@
RANLIB = @RANLIB@
@ -98,7 +100,6 @@ THREADINCS = @THREADINCS@
THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@
THREADSPEC = @THREADSPEC@
USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
VERSION = @VERSION@
ZDEPS = @ZDEPS@
ZINCS = @ZINCS@

View File

@ -132,6 +132,9 @@
getenv("GCJ_PROPERTIES"). */
#undef DISABLE_GETENV_PROPERTIES
/* Define if using setjmp/longjmp exceptions. */
#undef SJLJ_EXCEPTIONS
/* Define if you have the access function. */
#undef HAVE_ACCESS

View File

@ -11,11 +11,44 @@ details. */
#ifndef JAVA_SIGNAL_H
#define JAVA_SIGNAL_H 1
#ifdef SJLJ_EXCEPTIONS
#define HANDLE_SEGV
#define HANDLE_FPE
#include <signal.h>
#define SIGNAL_HANDLER(_name) \
static void _name (int _dummy)
#define INIT_SEGV \
do \
{ \
nullp = new java::lang::NullPointerException (); \
signal (SIGSEGV, catch_segv); \
} \
while (0)
#define INIT_FPE \
do \
{ \
arithexception = new java::lang::ArithmeticException \
(JvNewStringLatin1 ("/ by zero")); \
signal (SIGFPE, catch_fpe); \
} \
while (0)
#define MAKE_THROW_FRAME do {} while (0)
#else /* SJLJ_EXCEPTIONS */
#undef HANDLE_SEGV
#undef HANDLE_FPE
#define INIT_SEGV do {} while (0)
#define INIT_FPE do {} while (0)
#endif /* SJLJ_EXCEPTIONS */
#endif /* JAVA_SIGNAL_H */

View File

@ -8,6 +8,8 @@ This software is copyrighted work licensed under the terms of the
Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
details. */
#include <config.h>
/* AIX requires this to be the first thing in the file. */
#ifndef __GNUC__
# if HAVE_ALLOCA_H

View File

@ -6,4 +6,5 @@
%rename lib liborig
*lib: -lgcj -lm @GCSPEC@ @THREADSPEC@ @ZLIBSPEC@ @SYSTEMSPEC@ %(liborig)
*jc1: @DIVIDESPEC@
*jc1: @DIVIDESPEC@ @EXCEPTIONSPEC@

View File

@ -74,6 +74,7 @@ CXXCPP = @CXXCPP@
DIVIDESPEC = @DIVIDESPEC@
DLLTOOL = @DLLTOOL@
EH_COMMON_INCLUDE = @EH_COMMON_INCLUDE@
EXCEPTIONSPEC = @EXCEPTIONSPEC@
EXEEXT = @EXEEXT@
GCDEPS = @GCDEPS@
GCINCS = @GCINCS@
@ -89,6 +90,7 @@ LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
NM = @NM@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
PERL = @PERL@
RANLIB = @RANLIB@
@ -98,7 +100,6 @@ THREADINCS = @THREADINCS@
THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@
THREADSPEC = @THREADSPEC@
USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
VERSION = @VERSION@
ZDEPS = @ZDEPS@
ZINCS = @ZINCS@