From 4020f13fb07e15c417c9832a32273421a49af596 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 29 Jun 2007 20:38:16 -0600 Subject: [PATCH] update references to class in fields and methods in updateBootstrapClass() --- makefile | 8 ++++---- src/vm.cpp | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/makefile b/makefile index 63603eae5c..81d9ae93cf 100644 --- a/makefile +++ b/makefile @@ -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:') diff --git a/src/vm.cpp b/src/vm.cpp index d27680a068..1dae025c20 100644 --- a/src/vm.cpp +++ b/src/vm.cpp @@ -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); }