* src/vm/builtin.c (builtin_retrieve_exception): Implemented.
* src/vm/jit/alpha/linux/md-os.c (md_signal_handler_sigsegv): Use above builtin.
* src/vm/jit/i386/linux/md-os.c,
* src/vm/jit/powerpc/darwin/md-os.c,
* src/vm/jit/powerpc/linux/md-os.c,
* src/vm/jit/powerpc64/linux/md-os.c,
* src/vm/jit/x86_64/linux/md-os.c: Likewise.
}
+/* builtin_retrieve_exception **************************************************
+
+ Gets and clears the exception pointer of the current thread.
+
+ RETURN VALUE:
+ the exception object, or NULL if no exception was thrown.
+
+ NOTE: This is a FAST builtin and can be called from JIT code,
+ or from the signal handlers.
+
+*******************************************************************************/
+
+java_object_t *builtin_retrieve_exception(void)
+{
+ java_handle_t *h;
+ java_object_t *o;
+
+ /* actually get and clear the exception */
+
+ h = exceptions_get_and_clear_exception();
+ o = LLNI_UNWRAP(h);
+
+ return o;
+}
+
+
/* builtin_canstore ************************************************************
Checks, if an object can be stored in an array.
void *builtin_throw_exception(java_object_t *exception);
/* NOT AN OP */
+java_object_t *builtin_retrieve_exception(void);
+/* NOT AN OP */
java_handle_t *builtin_new(classinfo *c);
/* NOT AN OP */
# include "threads/native/threads.h"
#endif
+#include "vm/builtin.h"
#include "vm/exceptions.h"
#include "vm/signallocal.h"
/* Get the exception object. */
- p = exceptions_get_and_clear_exception();
+ p = builtin_retrieve_exception();
assert(p != NULL);
#include "threads/threads-common.h"
+#include "vm/builtin.h"
#include "vm/exceptions.h"
#include "vm/signallocal.h"
#include "vm/stringlocal.h"
if (type == EXCEPTION_HARDWARE_COMPILER) {
if (p == NULL) {
- o = exceptions_get_and_clear_exception();
+ o = builtin_retrieve_exception();
_mc->gregs[REG_ESP] = (uintptr_t) sp; /* Remove RA from stack. */
# include "threads/native/threads.h"
#endif
+#include "vm/builtin.h"
#include "vm/exceptions.h"
#include "vm/global.h"
#include "vm/signallocal.h"
/* Get the exception object. */
- p = exceptions_get_and_clear_exception();
+ p = builtin_retrieve_exception();
assert(p != NULL);
# include "threads/native/threads.h"
#endif
+#include "vm/builtin.h"
#include "vm/exceptions.h"
#include "vm/signallocal.h"
#include "vm/stringlocal.h"
/* Get the exception object. */
- p = exceptions_get_and_clear_exception();
+ p = builtin_retrieve_exception();
assert(p != NULL);
# include "threads/native/threads.h"
#endif
+#include "vm/builtin.h"
#include "vm/exceptions.h"
#include "vm/signallocal.h"
/* Get the exception object. */
- p = exceptions_get_and_clear_exception();
+ p = builtin_retrieve_exception();
assert(p != NULL);
# include "threads/native/threads.h"
#endif
+#include "vm/builtin.h"
#include "vm/exceptions.h"
#include "vm/signallocal.h"
int type;
intptr_t val;
void *p;
- java_handle_t *o;
+ java_object_t *o;
_uc = (ucontext_t *) _p;
_mc = &_uc->uc_mcontext;
if (type == EXCEPTION_HARDWARE_COMPILER) {
if (p == NULL) {
- o = exceptions_get_and_clear_exception();
+ o = builtin_retrieve_exception();
_mc->gregs[REG_RSP] = (uintptr_t) sp; /* Remove RA from stack. */