aboutsummaryrefslogtreecommitdiff
path: root/libjava/prims.cc
diff options
context:
space:
mode:
authorAndrew Haley <aph@cygnus.com>1999-04-20 06:27:11 +0000
committerAndrew Haley <aph@gcc.gnu.org>1999-04-20 06:27:11 +0000
commit01f78a025e7e000b836ab9ff76ffc3b9958ba43e (patch)
treeadd4675eb0e1e75e84638aec16fc821fcc469627 /libjava/prims.cc
parent3d6b96617891cf51b41ebcd5b569d3d668932e24 (diff)
downloadgcc-01f78a025e7e000b836ab9ff76ffc3b9958ba43e.zip
gcc-01f78a025e7e000b836ab9ff76ffc3b9958ba43e.tar.gz
gcc-01f78a025e7e000b836ab9ff76ffc3b9958ba43e.tar.bz2
sparc-signal.h: new file.
1999-04-20 Andrew Haley <aph@cygnus.com> * include/sparc-signal.h: new file. * configure.in: include/sparc-signal.h added. * configure: regenerated. * prims.cc (JvRunMain): signal handling code rewritten to be more portable. (catch_segv): ditto. (catch_fpe): ditto. * include/i386-signal.h: reorganized. * include/default-signal.h: reorganized. From-SVN: r26560
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r--libjava/prims.cc69
1 files changed, 22 insertions, 47 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc
index 70dc89c..4d11cd8 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -52,6 +52,26 @@ static java::lang::OutOfMemoryError *no_memory;
+#ifdef HANDLE_SEGV
+static java::lang::NullPointerException *nullp;
+SIGNAL_HANDLER (catch_segv)
+{
+ MAKE_THROW_FRAME;
+ _Jv_Throw (nullp);
+}
+#endif
+
+#ifdef HANDLE_FPE
+static java::lang::ArithmeticException *arithexception;
+SIGNAL_HANDLER (catch_fpe)
+{
+ MAKE_THROW_FRAME;
+ _Jv_Throw (arithexception);
+}
+#endif
+
+
+
jboolean
_Jv_equalUtf8Consts (Utf8Const* a, Utf8Const *b)
{
@@ -426,32 +446,6 @@ _Jv_NewMultiArray (jclass array_type, jint dimensions, ...)
-#ifdef HANDLE_SEGV
-static java::lang::NullPointerException *nullp;
-
-static void
-catch_segv (int dummy)
-{
- MAKE_THROW_FRAME(dummy);
- // Don't run `new' in a signal handler, so we always throw the same
- // exception.
- _Jv_Throw (nullp);
-}
-#endif
-
-#ifdef HANDLE_FPE
-static java::lang::ArithmeticException *arithexception;
-
-static void
-catch_fpe (int dummy)
-{
- MAKE_THROW_FRAME(dummy);
- // Don't run `new' in a signal handler, so we always throw the same
- // exception.
- _Jv_Throw (arithexception);
-}
-#endif
-
class _Jv_PrimClass : public java::lang::Class
{
public:
@@ -572,27 +566,8 @@ static java::lang::Thread *main_thread;
void
JvRunMain (jclass klass, int argc, const char **argv)
{
-#ifdef HANDLE_SEGV
- {
- nullp = new java::lang::NullPointerException ();
- struct sigaction act;
- act.sa_handler = catch_segv;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
- sigaction (SIGSEGV, &act, NULL);
- }
-#endif
-
-#ifdef HANDLE_FPE
- {
- arithexception = new java::lang::ArithmeticException ();
- struct sigaction act;
- act.sa_handler = catch_fpe;
- sigemptyset (&act.sa_mask);
- act.sa_flags = 0;
- sigaction (SIGFPE, &act, NULL);
- }
-#endif
+ INIT_SEGV;
+ INIT_FPE;
no_memory = new java::lang::OutOfMemoryError;