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 classpath = classpath
test = test test = test
input = $(cls)/Exceptions.class
cxx = g++ cxx = g++
cc = gcc cc = gcc
vg = nice valgrind --leak-check=full --num-callers=32 --db-attach=yes \ 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-sources = $(shell find $(test) -name '*.java')
test-classes = $(call java-classes,$(test-sources),$(test)) test-classes = $(call java-classes,$(test-sources),$(test))
input = $(cls)/Hello.class
classpath-objects = $(classpath-classes) $(jni-library) classpath-objects = $(classpath-classes) $(jni-library)
class-name = $(patsubst $(cls)/%.class,%,$(1)) class-name = $(patsubst $(cls)/%.class,%,$(1))

View File

@ -1358,12 +1358,18 @@ exit(Thread* t)
joinAll(t, t->vm->rootThread); 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)) reinterpret_cast<void (*)(Thread*, object)>(finalizerFinalize(t, f))
(t, finalizerTarget(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)) reinterpret_cast<void (*)(Thread*, object)>(finalizerFinalize(t, f))
(t, finalizerTarget(t, f)); (t, finalizerTarget(t, f));
} }

View File

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