From 3a452309b36e3fc654d1f5a8a5d36fc20e1abde3 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sat, 6 Oct 2012 15:25:12 -0600 Subject: [PATCH] update static table class reference in updateClassTables Commit c918cbc added this reference to ensure sun.misc.Unsafe.getLongVolatile could be implemented efficiently on 32-bit platforms. However, I neglected to ensure the reference was updated to point to the final class instance instead of the temporary one used in parseClass. This led to extra memory usage and inconsistent locking behavior, plus broken bootimage builds. --- src/machine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/machine.cpp b/src/machine.cpp index 743f56e41a..828de31fc0 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -2296,6 +2296,11 @@ updateClassTables(Thread* t, object newClass, object oldClass) } } + object staticTable = classStaticTable(t, newClass); + if (staticTable) { + set(t, staticTable, SingletonBody, newClass); + } + if (classFlags(t, newClass) & ACC_INTERFACE) { object virtualTable = classVirtualTable(t, newClass); if (virtualTable) {