* src/cacaoh/headers.h (_exceptionptr): Removed.
authorChristian Thalinger <twisti@complang.tuwien.ac.at>
Thu, 13 Sep 2007 20:26:06 +0000 (22:26 +0200)
committerChristian Thalinger <twisti@complang.tuwien.ac.at>
Thu, 13 Sep 2007 20:26:06 +0000 (22:26 +0200)
* src/threads/native/threads.h (exceptionptr): Removed.
* src/threads/none/threads.h: Likewise.

* src/vm/exceptions.c (exceptions_get_exception): Rewritten to use
threadobject directly.
(exceptions_set_exception): Likewise.

* src/vm/jit/inline/inline.c (inline_transform)
[INLINE_VERIFY_RESULT]: Use exceptions_clear_exception.

src/cacaoh/headers.h
src/threads/native/threads.h
src/threads/none/threads.h
src/vm/exceptions.c
src/vm/jit/inline/inline.c

index 4493d5834c89b3678947ddffe4d70923c77ee25d..c90b224dfdf74f7e83bf594927fc81821303ad4a 100644 (file)
@@ -40,7 +40,6 @@
 
 /* export variables ***********************************************************/
 
-extern java_object_t *_exceptionptr;
 extern chain *nativemethod_chain;
 extern chain *nativeclass_chain;
 extern chain *ident_chain;
index 8de392338d988032dc19833ec8b5c156b809ac75..0a7fcabd893a0e538b25ad524a4b284a7d5b11fd 100644 (file)
@@ -169,11 +169,6 @@ struct threadobject {
 };
 
 
-/* exception pointer **********************************************************/
-
-#define exceptionptr      (&(THREADOBJECT->_exceptionptr))
-
-
 /* stackframeinfo *************************************************************/
 
 #define STACKFRAMEINFO    (THREADOBJECT->_stackframeinfo)
index 1083844526072d58d12f1a31db7a5df5fa381bdf..5b7a8133d88f1af8fcc7896b9943872aa3058117 100644 (file)
 #define threadobject      void
 
 
-/* exception pointer **********************************************************/
-
-extern java_object_t        *_no_threads_exceptionptr;
-
-#define exceptionptr        (&_no_threads_exceptionptr)
-
-
 /* stackframeinfo *************************************************************/
 
 struct stackframeinfo;
index a61f0d17b5cbd775270d61fdf19af8bb54d50663..54efe6859284b8649adc47317f7eea746d9d8415 100644 (file)
@@ -205,16 +205,25 @@ bool exceptions_init(void)
 java_handle_t *exceptions_get_exception(void)
 {
        java_handle_t *e;
+#if defined(ENABLE_THREADS)
+       threadobject  *t;
 
-       /* get the exception */
+       t = THREADOBJECT;
+#endif
+
+       /* Get the exception. */
 
        LLNI_CRITICAL_START;
 
-       e = LLNI_WRAP(*exceptionptr);
+#if defined(ENABLE_THREADS)
+       e = LLNI_WRAP(t->_exceptionptr);
+#else
+       e = LLNI_WRAP(_no_threads_exceptionptr);
+#endif
 
        LLNI_CRITICAL_END;
 
-       /* return the exception */
+       /* Return the exception. */
 
        return e;
 }
@@ -228,11 +237,21 @@ java_handle_t *exceptions_get_exception(void)
 
 void exceptions_set_exception(java_handle_t *o)
 {
-       /* set the exception */
+#if defined(ENABLE_THREADS)
+       threadobject *t;
+
+       t = THREADOBJECT;
+#endif
+
+       /* Set the exception. */
 
        LLNI_CRITICAL_START;
 
-       *exceptionptr = LLNI_UNWRAP(o);
+#if defined(ENABLE_THREADS)
+       t->_exceptionptr = LLNI_UNWRAP(o);
+#else
+       _no_threads_exceptionptr = LLNI_UNWRAP(o);
+#endif
 
        LLNI_CRITICAL_END;
 }
index 773a11f48848d17493ebef33e5be6fbd95486e74..06fc9c727877d302af649cd0dcdab0167a41fa10 100644 (file)
@@ -2141,7 +2141,7 @@ static bool inline_transform(inline_node *iln, jitdata *jd)
                debug_verify_inlined_code = 0;
                DOLOG( printf("VERIFYING INLINED RESULT...\n"); fflush(stdout); );
                if (!typecheck(n_jd)) {
-                       *exceptionptr = NULL;
+                       exceptions_clear_exception();
                        DOLOG( printf("XXX INLINED RESULT DID NOT PASS VERIFIER XXX\n") );
                        return false;
                }