void stringTable::gc_mark_contents() { // throw out unreachable strings stringTableEntry* e; FOR_ALL_ENTRIES(e) { if (e->is_string()) { if (!e->get_string()->is_gc_marked()) e->clear(); else MARK_TEMPLATE((stringOop*) e); } else { stringTableLink* l = e->get_link(), **p = (stringTableLink**) e; while (l) { if (!l->string->is_gc_marked()) { // unreachable; remove from table stringTableLink* d = l; *p = l = l->next; d->next = NULL; Memory->string_table->delete_link(d); } else { MARK_TEMPLATE(&l->string); p = &l->next; l = *p; } } if (e->length() == 1) { // Compact the bucket stringTableLink* l_ = e->get_link(); e->set_string(l_->string); Memory->string_table->delete_link(l_); } } } }
void OopNCode::gc_mark_contents() { ResourceMark m; addrDesc* p = locs(), *end = locsEnd(); LocChange* changes = NEW_RESOURCE_ARRAY( LocChange, end - p); int32 locLen = 0; for (; p < end; p++) { if (!p->isOop()) { // no oops here } else { oop oldOop = (oop)p->referent(this); oop newOop = oldOop; MARK_TEMPLATE(&newOop); if (newOop != oldOop) { changes[locLen].p = p; changes[locLen].newOop = newOop; locLen++; } } } for (LocChange* l = &changes[0]; locLen > 0; locLen--, l++) { l->p->set_referent(this, (char*)l->newOop); } }
void NMethodLookupKey::gc_mark_contents() { MARK_TEMPLATE(&_receiverMapOop); MARK_TEMPLATE(&_methodHolder_or_map); MARK_TEMPLATE(&selector); MARK_TEMPLATE(&delegatee); }