* prims.cc (catch_segv): Create exception in handler.
(catch_fpe): Likewise.
(_Jv_divI, _Jv_remI, _Jv_divJ, _Jv_remJ): Likewise.
(_Jv_ThrowSignal): Remove.
* include/x86_64-signal.h (INIT_SEGV): Delete reference to nullp.
* include/default-signal.h (INIT_SEGV, INIT_FPE): Delete reference
to nullp and arithexception.
* include/dwarf2-signal.h (INIT_SEGV, INIT_FPE): Likewise.
* include/i386-signal.h (INIT_SEGV, INIT_FPE): Likewise.
* include/s390-signal.h (INIT_SEGV, INIT_FPE): Likewise.
* include/sparc-signal.h (INIT_SEGV, INIT_FPE): Likewise.
* include/win32-signal.h (INIT_SEGV, INIT_FPE): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67892
138bc75d-0d04-0410-961f-
82ee72b054a4
+2003-06-12 Andrew Haley <aph@redhat.com>
+
+ * prims.cc (catch_segv): Create exception in handler.
+ (catch_fpe): Likewise.
+ (_Jv_divI, _Jv_remI, _Jv_divJ, _Jv_remJ): Likewise.
+ (_Jv_ThrowSignal): Remove.
+
+ * include/x86_64-signal.h (INIT_SEGV): Delete reference to nullp.
+ * include/default-signal.h (INIT_SEGV, INIT_FPE): Delete reference
+ to nullp and arithexception.
+ * include/dwarf2-signal.h (INIT_SEGV, INIT_FPE): Likewise.
+ * include/i386-signal.h (INIT_SEGV, INIT_FPE): Likewise.
+ * include/s390-signal.h (INIT_SEGV, INIT_FPE): Likewise.
+ * include/sparc-signal.h (INIT_SEGV, INIT_FPE): Likewise.
+ * include/win32-signal.h (INIT_SEGV, INIT_FPE): Likewise.
+
2003-06-11 Andrew Haley <aph@redhat.com>
* jni.cc (_Jv_JNI_check_types): New.
#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 INIT_SEGV \
do \
{ \
- nullp = new java::lang::NullPointerException (); \
struct kernel_sigaction act; \
unsigned long stub = ((unsigned long)&__rt_sigreturn_stub); \
act.k_sa_sigaction = _Jv_catch_segv; \
#define INIT_FPE \
do \
{ \
- arithexception = new java::lang::ArithmeticException \
- (JvNewStringLatin1 ("/ by zero")); \
struct kernel_sigaction act; \
unsigned long stub = ((unsigned long)&__rt_sigreturn_stub); \
act.k_sa_sigaction = _Jv_catch_fpe; \
do \
{ \
struct kernel_sigaction act; \
- nullp = new java::lang::NullPointerException (); \
act.k_sa_sigaction = _Jv_catch_segv; \
act.k_sa_mask = 0; \
act.k_sa_flags = SA_SIGINFO; \
#define INIT_FPE \
do \
{ \
- arithexception = new java::lang::ArithmeticException \
- (JvNewStringLatin1 ("/ by zero")); \
struct kernel_sigaction act; \
act.k_sa_sigaction = _Jv_catch_fpe; \
act.k_sa_mask = 0; \
#define INIT_SEGV \
do \
{ \
- nullp = new java::lang::NullPointerException (); \
struct sigaction act; \
act.sa_sigaction = _Jv_catch_segv; \
sigemptyset (&act.sa_mask); \
#define INIT_FPE \
do \
{ \
- arithexception = new java::lang::ArithmeticException \
- (JvNewStringLatin1 ("/ by zero")); \
struct sigaction act; \
act.sa_sigaction = _Jv_catch_fpe; \
sigemptyset (&act.sa_mask); \
#define INIT_SEGV \
do \
{ \
- nullp = new java::lang::NullPointerException (); \
struct sigaction act; \
act.sa_sigaction = _Jv_catch_segv; \
sigemptyset (&act.sa_mask); \
#define INIT_FPE \
do \
{ \
- arithexception = new java::lang::ArithmeticException \
- (JvNewStringLatin1 ("/ by zero")); \
struct sigaction act; \
act.sa_sigaction = _Jv_catch_fpe; \
sigemptyset (&act.sa_mask); \
#define INIT_SEGV \
do \
{ \
- nullp = new java::lang::NullPointerException (); \
struct old_i386_kernel_sigaction kact; \
kact.k_sa_handler = catch_segv; \
kact.k_sa_mask = 0; \
#define INIT_FPE \
do \
{ \
- arithexception = new java::lang::ArithmeticException \
- (JvNewStringLatin1 ("/ by zero")); \
struct old_i386_kernel_sigaction kact; \
kact.k_sa_handler = catch_fpe; \
kact.k_sa_mask = 0; \
#define INIT_SEGV \
do \
{ \
- nullp = new java::lang::NullPointerException (); \
struct old_s390_kernel_sigaction kact; \
kact.k_sa_handler = catch_segv; \
kact.k_sa_mask = 0; \
#define INIT_FPE \
do \
{ \
- arithexception = new java::lang::ArithmeticException \
- (JvNewStringLatin1 ("/ by zero")); \
struct old_s390_kernel_sigaction kact; \
kact.k_sa_handler = catch_fpe; \
kact.k_sa_mask = 0; \
#define INIT_SEGV \
do \
{ \
- nullp = new java::lang::NullPointerException (); \
struct sigaction act; \
act.sa_sigaction = catch_segv; \
act.sa_flags = SA_SIGINFO | SA_NODEFER; \
#define INIT_FPE \
do \
{ \
- arithexception = new java::lang::ArithmeticException \
- (JvNewStringLatin1 ("/ by zero")); \
struct sigaction act; \
act.sa_flags = SA_SIGINFO | SA_NODEFER; \
act.sa_sigaction = catch_fpe; \
#define INIT_SEGV \
do \
{ \
- nullp = new java::lang::NullPointerException (); \
} \
while (0)
#define INIT_FPE \
do \
{ \
- arithexception = new java::lang::ArithmeticException \
- (JvNewStringLatin1 ("/ by zero")); \
} \
while (0)
#define INIT_SEGV \
do \
{ \
- nullp = new java::lang::NullPointerException (); \
struct kernel_sigaction act; \
act.k_sa_sigaction = _Jv_catch_segv; \
sigemptyset (&act.k_sa_mask); \
#endif
\f
-extern "C" void _Jv_ThrowSignal (jthrowable) __attribute ((noreturn));
-
-// Just like _Jv_Throw, but fill in the stack trace first. Although
-// this is declared extern in order that its name not be mangled, it
-// is not intended to be used outside this file.
-void
-_Jv_ThrowSignal (jthrowable throwable)
-{
- throwable->fillInStackTrace ();
- throw throwable;
-}
-
#ifdef HANDLE_SEGV
-static java::lang::NullPointerException *nullp;
-
SIGNAL_HANDLER (catch_segv)
{
+ java::lang::NullPointerException *nullp
+ = new java::lang::NullPointerException;
MAKE_THROW_FRAME (nullp);
- _Jv_ThrowSignal (nullp);
+ throw nullp;
}
#endif
-static java::lang::ArithmeticException *arithexception;
-
#ifdef HANDLE_FPE
SIGNAL_HANDLER (catch_fpe)
{
+ java::lang::ArithmeticException *arithexception
+ = new java::lang::ArithmeticException (JvNewStringLatin1 ("/ by zero"));
#ifdef HANDLE_DIVIDE_OVERFLOW
HANDLE_DIVIDE_OVERFLOW;
#else
MAKE_THROW_FRAME (arithexception);
#endif
- _Jv_ThrowSignal (arithexception);
+ throw arithexception;
}
#endif
INIT_SEGV;
#ifdef HANDLE_FPE
INIT_FPE;
-#else
- arithexception = new java::lang::ArithmeticException
- (JvNewStringLatin1 ("/ by zero"));
#endif
no_memory = new java::lang::OutOfMemoryError;
_Jv_divI (jint dividend, jint divisor)
{
if (__builtin_expect (divisor == 0, false))
- _Jv_ThrowSignal (arithexception);
+ {
+ java::lang::ArithmeticException *arithexception
+ = new java::lang::ArithmeticException (JvNewStringLatin1 ("/ by zero"));
+ throw arithexception;
+ }
if (dividend == (jint) 0x80000000L && divisor == -1)
return dividend;
_Jv_remI (jint dividend, jint divisor)
{
if (__builtin_expect (divisor == 0, false))
- _Jv_ThrowSignal (arithexception);
+ {
+ java::lang::ArithmeticException *arithexception
+ = new java::lang::ArithmeticException (JvNewStringLatin1 ("/ by zero"));
+ throw arithexception;
+ }
if (dividend == (jint) 0x80000000L && divisor == -1)
return 0;
-
+
return dividend % divisor;
}
_Jv_divJ (jlong dividend, jlong divisor)
{
if (__builtin_expect (divisor == 0, false))
- _Jv_ThrowSignal (arithexception);
-
+ {
+ java::lang::ArithmeticException *arithexception
+ = new java::lang::ArithmeticException (JvNewStringLatin1 ("/ by zero"));
+ throw arithexception;
+ }
+
if (dividend == (jlong) 0x8000000000000000LL && divisor == -1)
return dividend;
_Jv_remJ (jlong dividend, jlong divisor)
{
if (__builtin_expect (divisor == 0, false))
- _Jv_ThrowSignal (arithexception);
-
+ {
+ java::lang::ArithmeticException *arithexception
+ = new java::lang::ArithmeticException (JvNewStringLatin1 ("/ by zero"));
+ throw arithexception;
+ }
+
if (dividend == (jlong) 0x8000000000000000LL && divisor == -1)
return 0;