more GC stress fixes

This commit is contained in:
Joel Dice 2007-07-16 19:55:49 -06:00
parent 6bac351874
commit e3e9981031
3 changed files with 13 additions and 7 deletions

View File

@ -16,6 +16,8 @@ src = src
classpath = classpath
test = test
input = $(cls)/Exceptions.class
cxx = g++
cc = gcc
vg = nice valgrind --leak-check=full --num-callers=32 --db-attach=yes \
@ -119,8 +121,6 @@ classpath-objects = $(classpath-classes) $(jni-library)
test-sources = $(shell find $(test) -name '*.java')
test-classes = $(call java-classes,$(test-sources),$(test))
input = $(cls)/Hello.class
classpath-objects = $(classpath-classes) $(jni-library)
class-name = $(patsubst $(cls)/%.class,%,$(1))

View File

@ -1358,12 +1358,18 @@ exit(Thread* t)
joinAll(t, t->vm->rootThread);
for (object f = t->vm->finalizers; f; f = finalizerNext(t, f)) {
for (object* p = &(t->vm->finalizers); *p;) {
object f = *p;
*p = finalizerNext(t, *p);
reinterpret_cast<void (*)(Thread*, object)>(finalizerFinalize(t, f))
(t, finalizerTarget(t, f));
}
for (object f = t->vm->tenuredFinalizers; f; f = finalizerNext(t, f)) {
for (object* p = &(t->vm->tenuredFinalizers); *p;) {
object f = *p;
*p = finalizerNext(t, *p);
reinterpret_cast<void (*)(Thread*, object)>(finalizerFinalize(t, f))
(t, finalizerTarget(t, f));
}

View File

@ -872,9 +872,7 @@ run(Thread* t)
} goto loop;
case getfield: {
object instance = popObject(t);
if (LIKELY(instance)) {
if (LIKELY(peekObject(t, sp - 1))) {
uint8_t index1 = codeBody(t, code, ip++);
uint8_t index2 = codeBody(t, code, ip++);
uint16_t index = (index1 << 8) | index2;
@ -882,6 +880,8 @@ run(Thread* t)
object field = resolveField(t, codePool(t, code), index - 1);
if (UNLIKELY(exception)) goto throw_;
object instance = popObject(t);
switch (fieldCode(t, field)) {
case ByteField:
case BooleanField: