more GC stress fixes

This commit is contained in:
Joel Dice 2007-07-16 18:23:23 -06:00
parent 6dec1cbd42
commit 6bac351874
4 changed files with 16 additions and 4 deletions

View File

@ -1419,7 +1419,8 @@ makeHeap(System* system)
return Reachable;
} else if (c.nextGen2.contains(p)
or (c.gen2.contains(p)
and c.gen2.indexOf(p) >= c.gen2Base))
and (c.mode == ::MinorCollection
or c.gen2.indexOf(p) >= c.gen2Base)))
{
return Tenured;
} else if (wasCollected(&c, p)) {

View File

@ -1341,6 +1341,11 @@ Thread::dispose()
systemThread = 0;
}
#ifdef VM_STRESS
vm->system->free(heap);
heap = 0;
#endif // VM_STRESS
if (allocator) {
allocator->free(this);
}
@ -1377,7 +1382,8 @@ enter(Thread* t, Thread::State s)
switch (s) {
case Thread::ExclusiveState: {
assert(t, t->state == Thread::ActiveState);
assert(t, t->state == Thread::ActiveState
or t->state == Thread::ExitState);
while (t->vm->exclusive) {
// another thread got here first.

View File

@ -22,7 +22,7 @@
namespace vm {
const bool Verbose = false;
const bool DebugRun = true;
const bool DebugRun = false;
const bool DebugStack = false;
const bool DebugMonitors = false;
@ -1221,7 +1221,10 @@ collect(Thread* t, Heap::CollectionType type);
inline void
stress(Thread* t)
{
if ((not t->stress) and t->state != Thread::NoState) {
if ((not t->stress)
and t->state != Thread::NoState
and t->state != Thread::IdleState)
{
t->stress = true;
{ ENTER(t, Thread::ExclusiveState);

View File

@ -396,6 +396,8 @@ invokeNative(Thread* t, object method)
return VoidField;
}
PROTECT(t, data);
pushFrame(t, method);
unsigned count = methodParameterCount(t, method);