fix incorrect reporting of fixie collection status in heap.cpp (part 2)

My earlier fix (f8e8609) was almost -- but not quite -- sufficient.
It asked the heap to mark the dead fixies too early, so some of them
were marked dead even though they ultimately survived, causing us to
clear weak JNI references when we shouldn't.
This commit is contained in:
Joel Dice 2012-09-12 17:23:19 -06:00
parent 2190d0e99a
commit 3a5abaf58a

View File

@ -273,6 +273,8 @@ killZombies(Thread* t, Thread* o)
unsigned
footprint(Thread* t)
{
expect(t, t->criticalLevel == 0);
unsigned n = t->heapOffset + t->heapIndex + t->backupHeapIndex;
for (Thread* c = t->child; c; c = c->peer) {
@ -592,6 +594,8 @@ postVisit(Thread* t, Heap::Visitor* v)
m->tenuredWeakReferences = firstNewTenuredWeakReference;
}
m->heap->postVisit();
for (Reference* r = m->jniReferences; r; r = r->next) {
if (r->weak) {
if (m->heap->status(r->target) == Heap::Unreachable) {
@ -2693,8 +2697,6 @@ class HeapClient: public Heap::Client {
virtual void visitRoots(Heap::Visitor* v) {
::visitRoots(m, v);
m->heap->postVisit();
postVisit(m->rootThread, v);
}