35 #include "threads/threadlist.h"
96 #define ROOTSET_ADD(adr,mrk,tp) \
97 if (refcount >= rs->capacity) \
98 rs = rootset_resize(rs); \
99 rs->refs[refcount].ref = (adr); \
100 rs->refs[refcount].marks = (mrk); \
101 rs->refs[refcount].reftype = (tp); \
110 GC_LOG(
dolog(
"GC: Acquiring Root-Set from globals ..."); );
121 GC_LOG2(
printf(
"Found Registered Reference: %p at %p of type %d\n", *(re->
ref), re->
ref, ref->reftype); );
129 GC_LOG2(
printf(
"Found Registered Weak Reference: %p at %p of type %d\n", *(re->
ref), re->
ref, ref->reftype); );
137 GC_LOG2(
printf(
"Found Finalizer Entry: %p\n", (
void *) fe->
o); );
154 void *sys_start, *sys_end;
158 GC_LOG(
dolog(
"GC: Acquiring Root-Set from classes ..."); );
181 if (f->value->a == NULL)
184 GC_LOG2(
printf(
"Found Static Field Reference: %p\n", (
void *) f->value->a);
231 #if defined(ENABLE_THREADS)
233 GC_LOG(
dolog(
"GC: Acquiring Root-Set from thread (tid=%p) ...", (
void *) thread->
impl.
tid); );
236 GC_LOG(
dolog(
"GC: Acquiring Root-Set from single-thread ..."); );
240 threads_thread_print_stacktrace(thread); );
260 for (sf = ss->frames; sf != NULL; sf = sf->down) {
262 GC_LOG(
printf(
"Source Frame: localcount=%d, stackdepth=%d, syncslots=%d\n", sf->javalocalcount, sf->javastackdepth, sf->syncslotcount); );
264 for (i = 0; i < sf->javalocalcount; i++) {
267 if (sf->javalocaltype[i] !=
TYPE_ADR)
270 GC_LOG2(
printf(
"Found Reference (Java Local): %p\n", (
void *) sf->javalocals[i].a); );
277 for (i = 0; i < sf->javastackdepth; i++) {
280 if (sf->javastacktype[i] !=
TYPE_ADR)
283 GC_LOG2(
printf(
"Found Reference (Java Stack): %p\n", (
void *) sf->javastack[i].a); );
290 for (i = 0; i < sf->syncslotcount; i++) {
292 GC_LOG(
printf(
"Found Reference (Sync Slot): %p\n", (
void *) sf->syncslots[i].a); );
301 #if defined(ENABLE_THREADS)
308 for (i = 0; i < lrt->
used; i++) {
343 #if defined(ENABLE_THREADS)
344 for (t = threadlist_first(); t != NULL; t = threadlist_next(t)) {
376 #if defined(ENABLE_THREADS)
378 GC_LOG(
dolog(
"GC: Writing back Root-Set to thread (tid=%p) ...", (
void *) thread->
impl.
tid); );
381 GC_LOG(
dolog(
"GC: Writing back Root-Set to single-thread ..."); );
385 replace_gc_into_native(thread);
398 "THREADOBJECT",
"CLASSLOADER ",
"GLOBAL-REF ",
399 "FINALIZER ",
"LOCAL-REF ",
"ON-STACK-ADR",
400 "STATIC FIELD",
"LOCKRECORD "
409 printf(
"Root Set Chain:\n");
414 printf(
"\tGlobal Root Set:\n");
416 #if defined(ENABLE_THREADS)
419 printf(
"\tLocal Root Set:\n");
425 for (i = 0; i < rs->
refcount; i++) {
static rootset_t * rootset_from_globals(rootset_t *rs)
#define ROOTSET_INITIAL_CAPACITY
rootset_entry_t refs[ROOTSET_INITIAL_CAPACITY]
static rootset_t * rootset_from_thread(threadobject *thread, rootset_t *rs)
struct rootset_entry_t rootset_entry_t
#define DMREALLOC(ptr, type, num1, num2)
void class_print(classinfo *c)
struct rootset_t rootset_t
void replace_sourcestate_println(sourcestate_t *ss)
cacao::detail::threadobject impl
#define GC_ASSERT(assertion)
#define ROOTSET_ADD(adr, mrk, tp)
void field_print(fieldinfo *f)
localref_table * _localref_table
#define GC_ALIGN(val, size)
regioninfo_t * heap_region_sys
void rootset_print(rootset_t *rs)
void heap_print_object(java_object_t *o)
rootset_t * rootset_resize(rootset_t *rs)
list_t * gc_reflist_strong
static rootset_t * rootset_from_classes(rootset_t *rs)
void rootset_writeback(rootset_t *rs)
rootset_t * rootset_create(void)
static const char * reftype_names[]
#define GC_EXECUTIONSTATE
union localref_table::@1 refs[LOCALREFTABLE_CAPACITY]
#define ROOTSET_DUMMY_THREAD
rootset_t * rootset_readout()