update references to class in fields and methods in updateBootstrapClass()

This commit is contained in:
Joel Dice 2007-06-29 20:38:16 -06:00
parent b8e009075c
commit 4020f13fb0
2 changed files with 18 additions and 4 deletions

View File

@ -36,7 +36,8 @@ stress-cflags = -DDEBUG_MEMORY -DDEBUG_MEMORY_MAJOR
cpp-objects = $(foreach x,$(1),$(patsubst $(2)/%.cpp,$(bld)/%.o,$(x)))
asm-objects = $(foreach x,$(1),$(patsubst $(2)/%.S,$(bld)/%.o,$(x)))
java-classes = $(foreach x,$(1),$(patsubst $(2)/%.java,$(bld)/%.class,$(x)))
java-classes = \
$(foreach x,$(1),$(patsubst $(2)/%.java,$(bld)/classes/%.class,$(x)))
stdcpp-sources = $(src)/stdc++.cpp
stdcpp-objects = $(call cpp-objects,$(stdcpp-sources),$(src))
@ -123,13 +124,12 @@ fast-objects = \
fast-executable = $(bld)/fast-vm
fast-cflags = $(fast) $(cflags)
classpath-sources = $(shell find %(classpath)/java -name '*.java')
classpath-sources = $(shell find $(classpath)/java -name '*.java')
classpath-classes = $(call java-classes,$(classpath-sources),$(classpath))
input = $(bld)/classes/TestExceptions.class
input-depends = \
$(bld)/classes/java/lang/System.class \
$(bld)/classes/java/lang/Throwable.class \
$(classpath-classes) \
$(jni-library)
gen-run-arg = $(shell echo $(1) | sed -e 's:$(bld)/classes/\(.*\)\.class:\1:')

View File

@ -1996,6 +1996,20 @@ updateBootstrapClass(Thread* t, object bootstrapClass, object class_)
memcpy(bootstrapClass, class_, objectSize(t, class_) * BytesPerWord);
object fieldTable = classFieldTable(t, class_);
if (fieldTable) {
for (unsigned i = 0; i < arrayLength(t, fieldTable); ++i) {
set(t, fieldClass(t, arrayBody(t, fieldTable, i)), bootstrapClass);
}
}
object methodTable = classMethodTable(t, class_);
if (methodTable) {
for (unsigned i = 0; i < arrayLength(t, methodTable); ++i) {
set(t, methodClass(t, arrayBody(t, methodTable, i)), bootstrapClass);
}
}
enter(t, Thread::ActiveState);
}