* src/threads/thread-classpath.cpp, src/threads/thread-classpath.hpp,
src/threads/thread-cldc11.cpp, src/threads/thread-cldc11.hpp,
src/threads/thread-openjdk.cpp, src/threads/thread-openjdk.hpp
(clear_heap_reference): Added.
* src/vm/javaobjects.cpp, src/vm/javaobjects.hpp [OpenJDK]:
Added accessors for "me" field.
+void ThreadRuntimeClasspath::clear_heap_reference(java_lang_Thread& jlt)
+{
+ // Nothing to do.
+}
+
#endif /* ENABLE_THREADS && WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH */
#endif /* ENABLE_THREADS && WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH */
static threadobject *get_threadobject_from_thread(java_handle_t *h);
static void thread_create_initial_threadgroups(java_handle_t **threadgroup_system, java_handle_t **threadgroup_main);
static bool invoke_thread_initializer(java_lang_Thread& jlt, threadobject *t, methodinfo *thread_method_init, java_handle_t *name, java_handle_t *group);
static threadobject *get_threadobject_from_thread(java_handle_t *h);
static void thread_create_initial_threadgroups(java_handle_t **threadgroup_system, java_handle_t **threadgroup_main);
static bool invoke_thread_initializer(java_lang_Thread& jlt, threadobject *t, methodinfo *thread_method_init, java_handle_t *name, java_handle_t *group);
+ static void clear_heap_reference(java_lang_Thread& jlt);
};
typedef ThreadRuntimeClasspath ThreadRuntime;
};
typedef ThreadRuntimeClasspath ThreadRuntime;
+void ThreadRuntimeOpenjdk::clear_heap_reference(java_lang_Thread& jlt)
+{
+ // Nothing to do.
+}
+
#endif /* ENABLE_THREADS && WITH_JAVA_RUNTIME_LIBRARY_OPENJDK */
#endif /* ENABLE_THREADS && WITH_JAVA_RUNTIME_LIBRARY_OPENJDK */
static threadobject *get_threadobject_from_thread(java_handle_t *h);
static void thread_create_initial_threadgroups(java_handle_t **threadgroup_system, java_handle_t **threadgroup_main);
static bool invoke_thread_initializer(java_lang_Thread& jlt, threadobject *t, methodinfo *thread_method_init, java_handle_t *name, java_handle_t *group);
static threadobject *get_threadobject_from_thread(java_handle_t *h);
static void thread_create_initial_threadgroups(java_handle_t **threadgroup_system, java_handle_t **threadgroup_main);
static bool invoke_thread_initializer(java_lang_Thread& jlt, threadobject *t, methodinfo *thread_method_init, java_handle_t *name, java_handle_t *group);
+ static void clear_heap_reference(java_lang_Thread& jlt);
};
typedef ThreadRuntimeCldc11 ThreadRuntime;
};
typedef ThreadRuntimeCldc11 ThreadRuntime;
+void ThreadRuntimeOpenjdk::clear_heap_reference(java_lang_Thread& jlt)
+{
+ jlt.set_me(0);
+}
+
#endif /* ENABLE_THREADS && WITH_JAVA_RUNTIME_LIBRARY_OPENJDK */
#endif /* ENABLE_THREADS && WITH_JAVA_RUNTIME_LIBRARY_OPENJDK */
static threadobject *get_threadobject_from_thread(java_handle_t *h);
static void thread_create_initial_threadgroups(java_handle_t **threadgroup_system, java_handle_t **threadgroup_main);
static bool invoke_thread_initializer(java_lang_Thread& jlt, threadobject *t, methodinfo *thread_method_init, java_handle_t *name, java_handle_t *group);
static threadobject *get_threadobject_from_thread(java_handle_t *h);
static void thread_create_initial_threadgroups(java_handle_t **threadgroup_system, java_handle_t **threadgroup_main);
static bool invoke_thread_initializer(java_lang_Thread& jlt, threadobject *t, methodinfo *thread_method_init, java_handle_t *name, java_handle_t *group);
+ static void clear_heap_reference(java_lang_Thread& jlt);
};
typedef ThreadRuntimeOpenjdk ThreadRuntime;
};
typedef ThreadRuntimeOpenjdk ThreadRuntime;
void thread_free(threadobject *t)
{
void thread_free(threadobject *t)
{
+ java_handle_t *h = LLNI_WRAP(t->object);
+ java_lang_Thread jlt(h);
+ ThreadRuntime::clear_heap_reference(jlt);
+
/* Set the reference to the Java object to NULL. */
t->object = 0;
/* Set the reference to the Java object to NULL. */
t->object = 0;
/* src/vm/javaobjects.cpp - functions to create and access Java objects
/* src/vm/javaobjects.cpp - 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.
CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
Copyright (C) 2008, 2009 Theobroma Systems Ltd.
off_t java_lang_Thread::offset_group;
off_t java_lang_Thread::offset_uncaughtExceptionHandler;
off_t java_lang_Thread::offset_threadStatus;
off_t java_lang_Thread::offset_group;
off_t java_lang_Thread::offset_uncaughtExceptionHandler;
off_t java_lang_Thread::offset_threadStatus;
+off_t java_lang_Thread::offset_me;
static DynOffsetEntry dyn_entries_java_lang_Thread[] = {
{ &java_lang_Thread::set_priority_offset, "priority" },
static DynOffsetEntry dyn_entries_java_lang_Thread[] = {
{ &java_lang_Thread::set_priority_offset, "priority" },
{ &java_lang_Thread::set_group_offset, "group" },
{ &java_lang_Thread::set_uncaughtExceptionHandler_offset, "uncaughtExceptionHandler" },
{ &java_lang_Thread::set_threadStatus_offset, "threadStatus" },
{ &java_lang_Thread::set_group_offset, "group" },
{ &java_lang_Thread::set_uncaughtExceptionHandler_offset, "uncaughtExceptionHandler" },
{ &java_lang_Thread::set_threadStatus_offset, "threadStatus" },
+ { &java_lang_Thread::set_me_offset, "me" },
static off_t offset_group;
static off_t offset_uncaughtExceptionHandler;
static off_t offset_threadStatus;
static off_t offset_group;
static off_t offset_uncaughtExceptionHandler;
static off_t offset_threadStatus;
+ static off_t offset_me;
public:
java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
public:
java_lang_Thread(java_handle_t* h) : java_lang_Object(h) {}
void set_priority (int32_t value);
void set_group (java_handle_t* value);
void set_threadStatus(int32_t value);
void set_priority (int32_t value);
void set_group (java_handle_t* value);
void set_threadStatus(int32_t value);
+ void set_me (java_handle_t* value);
// Offset initializers
static void set_priority_offset(int32_t off) { offset_priority = off; }
// Offset initializers
static void set_priority_offset(int32_t off) { offset_priority = off; }
static void set_group_offset(int32_t off) { offset_group = off; }
static void set_uncaughtExceptionHandler_offset(int32_t off) { offset_uncaughtExceptionHandler = off; }
static void set_threadStatus_offset(int32_t off) { offset_threadStatus = off; }
static void set_group_offset(int32_t off) { offset_group = off; }
static void set_uncaughtExceptionHandler_offset(int32_t off) { offset_uncaughtExceptionHandler = off; }
static void set_threadStatus_offset(int32_t off) { offset_threadStatus = off; }
+ static void set_me_offset(int32_t off) { offset_me = off; }
set(_handle, offset_threadStatus, value);
}
set(_handle, offset_threadStatus, value);
}
+inline void java_lang_Thread::set_me(java_handle_t* value)
+{
+ set(_handle, offset_me, value);
+}
+