* 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 - 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.
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);
#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 */
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)
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);
}
// 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);
}
{
/* Set the reference to the Java object to NULL. */
- thread_set_object(t, NULL);
+ t->object = 0;
ThreadList::deactivate_thread(t);
}
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. */
/* Link the two objects together. */
- thread_set_object(t, object);
+ t->object = LLNI_DIRECT(object);
/* Add the thread to the thread list. */
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. */
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);
}
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. */
/* 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.
java_handle_t *o;
t = THREADOBJECT;
- o = thread_get_object(t);
+ o = LLNI_WRAP(t->object);
return o;
}
{
java_handle_t *o;
- o = thread_get_object(t);
+ o = LLNI_WRAP(t->object);
return o != NULL;
}
/* 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.
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 \"");
/* 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.
};
-// 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);