* src/threads/thread.hpp (thread_set_object, thread_get_object): Removed.
authorStefan Ring <stefan@complang.tuwien.ac.at>
Mon, 18 Apr 2011 19:57:47 +0000 (21:57 +0200)
committerStefan Ring <stefan@complang.tuwien.ac.at>
Mon, 18 Apr 2011 19:57:47 +0000 (21:57 +0200)
* src/native/vm/openjdk/jvm.cpp: Adapted (hand-inlined).
* src/threads/posix/thread-posix.cpp, src/threads/thread-openjdk.cpp,
src/threads/thread.cpp, src/vm/exceptions.cpp, src/vm/javaobjects.hpp:
Likewise.

src/native/vm/openjdk/jvm.cpp
src/threads/posix/thread-posix.cpp
src/threads/thread-openjdk.cpp
src/threads/thread.cpp
src/threads/thread.hpp
src/vm/exceptions.cpp
src/vm/javaobjects.hpp

index 6a98636ffe4d95e35648c0b3fcce09347accf07b..0d365146f0e398fb44aa2bdfa738b5a9b414d024 100644 (file)
@@ -1,6 +1,6 @@
 /* src/native/vm/openjdk/jvm.cpp - HotSpot VM interface functions
 
-   Copyright (C) 2007, 2008, 2009
+   Copyright (C) 1996-2011
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
    Copyright (C) 2009 Theobroma Systems Ltd.
 
@@ -3250,7 +3250,7 @@ jobjectArray JVM_GetAllThreads(JNIEnv *env, jclass dummy)
        for (List<threadobject*>::iterator it = active_threads.begin(); it != active_threads.end(); it++) {
                threadobject* t = *it;
 
-               java_handle_t* h = thread_get_object(t);
+               java_handle_t* h = LLNI_WRAP(t->object);
                assert(h != NULL);
 
                oa.set_element(index, h);
index 058a3bda94522821d1b4bd600e21c667137f17cb..9b238ce419ab891fcae41cf5ce90df0ae9feb9c4 100644 (file)
@@ -741,7 +741,7 @@ static void *threads_startup_thread(void *arg)
 #endif
 
        // Get the java.lang.Thread object for this thread.
-       java_handle_t* object = thread_get_object(t);
+       java_handle_t* object = LLNI_WRAP(t->object);
        java_lang_Thread jlt(object);
 
        /* set our priority */
@@ -926,7 +926,7 @@ bool thread_detach_current_thread(void)
 
        DEBUGTHREADS("detaching", t);
 
-       java_handle_t* object = thread_get_object(t);
+       java_handle_t* object = LLNI_WRAP(t->object);
        java_lang_Thread jlt(object);
 
 #if defined(ENABLE_JAVASE)
index ff46e9d6f8ff6b06dd2d4ee9f343af32b46cd21c..fecda2fc20506003351880bb1c1e2f07df69ccae 100644 (file)
@@ -87,7 +87,7 @@ void ThreadRuntimeOpenjdk::print_thread_name(const java_lang_Thread& jlt, FILE *
 void ThreadRuntimeOpenjdk::set_javathread_state(threadobject *t, int state)
 {
        // Set the state of the java.lang.Thread object.
-       java_lang_Thread thread(thread_get_object(t));
+       java_lang_Thread thread(LLNI_WRAP(t->object));
        assert(thread.is_non_null());
        thread.set_threadStatus(state);
 }
index 4520da8594b0e929af6d01d310efe66456bdc0f3..98945a5db9edd4f8a13db9db43c8f99a2f43e596 100644 (file)
@@ -213,7 +213,7 @@ static bool thread_create_object(threadobject *t, java_handle_t *name, java_hand
 
        // Set the Java object in the thread data-structure.  This
        // indicates that the thread is attached to the VM.
-       thread_set_object(t, jlt.get_handle());
+       t->object = LLNI_DIRECT(jlt.get_handle());
 
        return ThreadRuntime::invoke_thread_initializer(jlt, t, thread_method_init, name, group);
 }
@@ -371,7 +371,7 @@ void thread_free(threadobject *t)
 {
        /* Set the reference to the Java object to NULL. */
 
-       thread_set_object(t, NULL);
+       t->object = 0;
 
        ThreadList::deactivate_thread(t);
 }
@@ -424,7 +424,7 @@ bool threads_thread_start_internal(utf *name, functionptr f)
                return false;
        }
 
-       Finalizer::attach_custom_finalizer(thread_get_object(t), thread_cleanup_finalizer, t);
+       Finalizer::attach_custom_finalizer(LLNI_WRAP(t->object), thread_cleanup_finalizer, t);
 
        /* Start the thread. */
 
@@ -469,7 +469,7 @@ void threads_thread_start(java_handle_t *object)
 
        /* Link the two objects together. */
 
-       thread_set_object(t, object);
+       t->object = LLNI_DIRECT(object);
 
        /* Add the thread to the thread list. */
 
@@ -479,7 +479,7 @@ void threads_thread_start(java_handle_t *object)
 
        ThreadRuntime::setup_thread_vmdata(jlt, t);
 
-       Finalizer::attach_custom_finalizer(thread_get_object(t), thread_cleanup_finalizer, t);
+       Finalizer::attach_custom_finalizer(LLNI_WRAP(t->object), thread_cleanup_finalizer, t);
 
        /* Start the thread.  Don't pass a function pointer (NULL) since
           we want Thread.run()V here. */
@@ -675,10 +675,10 @@ bool thread_detach_current_external_thread(void)
 
 void thread_fprint_name(threadobject *t, FILE *stream)
 {
-       if (thread_get_object(t) == NULL)
+       if (LLNI_WRAP(t->object) == NULL)
                vm_abort("");
 
-       java_lang_Thread jlt(thread_get_object(t));
+       java_lang_Thread jlt(LLNI_WRAP(t->object));
 
        ThreadRuntime::print_thread_name(jlt, stream);
 }
@@ -695,7 +695,7 @@ void thread_fprint_name(threadobject *t, FILE *stream)
 
 void thread_print_info(threadobject *t)
 {
-       java_lang_Thread jlt(thread_get_object(t));
+       java_lang_Thread jlt(LLNI_WRAP(t->object));
 
        /* Print as much as we can when we are in state NEW. */
 
index 7124b4cf83e4f41b825805715b672189af830f6d..0804b81f7c3172bdea73a9f87efd231d818fa03b 100644 (file)
@@ -100,40 +100,6 @@ extern "C" {
 
 /* inline functions ***********************************************************/
 
-/* thread_get_object ***********************************************************
-
-   Return the Java for the given thread.
-
-   ARGUMENTS:
-       t ... thread
-
-   RETURN:
-       the Java object
-
-*******************************************************************************/
-
-inline static java_handle_t *thread_get_object(threadobject *t)
-{
-       return LLNI_WRAP(t->object);
-}
-
-
-/* threads_thread_set_object ***************************************************
-
-   Set the Java object for the given thread.
-
-   ARGUMENTS:
-       t ... thread
-          o ... Java object
-
-*******************************************************************************/
-
-inline static void thread_set_object(threadobject *t, java_handle_t *o)
-{
-       t->object = LLNI_DIRECT(o);
-}
-
-
 /* thread_get_current_object **************************************************
 
    Return the Java object of the current thread.
@@ -149,7 +115,7 @@ inline static java_handle_t *thread_get_current_object(void)
        java_handle_t *o;
 
        t = THREADOBJECT;
-       o = thread_get_object(t);
+       o = LLNI_WRAP(t->object);
 
        return o;
 }
@@ -190,7 +156,7 @@ inline static bool thread_is_attached(threadobject *t)
 {
        java_handle_t *o;
 
-       o = thread_get_object(t);
+       o = LLNI_WRAP(t->object);
 
        return o != NULL;
 }
index 69a748febd18f67a0678c9cb31dbe91857730d03..707efa4c31ea88a321104f91070972f9ae1c2a21 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/exceptions.cpp - exception related functions
 
-   Copyright (C) 1996-2005, 2006, 2007, 2008
+   Copyright (C) 1996-2011
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
@@ -2021,7 +2021,7 @@ void exceptions_print_stacktrace(void)
                   need it afterwards. */
 
                t  = thread_get_current();
-               to = (java_lang_Thread *) thread_get_object(t);
+               to = (java_lang_Thread *) LLNI_WRAP(t->object);
 
                if (to != NULL) {
                        fprintf(stderr, "in thread \"");
index 0aaa29504636106fac47a1081491b041cbc75838..29329f380add98fc2b713b43ac7206ee2714116e 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/javaobjects.hpp - functions to create and access Java objects
 
-   Copyright (C) 2010, 2011
+   Copyright (C) 1996-2011
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
    Copyright (C) 2008, 2009 Theobroma Systems Ltd.
 
@@ -2765,12 +2765,6 @@ public:
 };
 
 
-// inline java_lang_Thread::java_lang_Thread(threadobject* t) : java_lang_Object(h)
-// {
-//     java_lang_Thread(thread_get_object(t));
-// }
-
-
 inline int32_t java_lang_Thread::get_priority() const
 {
        return get<int32_t>(_handle, offset_priority);