The PhaseStringOpts::fetch_static_field function was not updated when the static fields were moved from the Klasses to the mirrors.
The failure is only apperent when we add/remove fields so that the offset of the Integer.sizeTable field is the same as any of the well-known fields in Klass.
Reproducer, which aligns Integer.sizeTable offset with Klass::_java_mirror:
diff -r b632e80fc9dc src/share/vm/oops/klass.hpp
--- a/src/share/vm/oops/klass.hpp Mon Apr 16 08:57:18 2012 +0200
+++ b/src/share/vm/oops/klass.hpp Mon Apr 16 15:59:21 2012 +0200
@@ -231,6 +231,9 @@
// iteration.
//
+ int _field1;
+ int _field2;
+
// Cache of last observed secondary supertype
klassOop _secondary_super_cache;
// Array of all secondary supertypes
and run this with SPECjbb2000:
~/hg/hsx-gc/build/linux/linux_amd64_compiler2/jvmg/hotspot -XX:-CICompilerCountPerCPU -XX:CICompilerCount=1 -XX:+DisableExplicitGC -XX:+ShowMessageBoxOnError -XX:+UnlockDiagnosticVMOptions -XX:+VerifyBeforeGC -XX:+VerifyAfterGC -Xmx3840M -Xmn2g -XX:+UseSerialGC -XX:+PrintGC -cp jbb.jar:check.jar:reporter.jar:jbb_no_precompile.jar spec.jbb.JBBmain -propfile SPECjbb.props
This gives:
Internal Error at memnode.cpp:1571, pid=27073, tid=139796898727680
assert(off != Type::OffsetBot || tp->is_oopptr()->klass()->is_java_lang_Object() || C->has_unsafe_access()) failed: Field accesses must be precise
Stack trace:
#2 0x00007f250a61edee in VMError::show_message_box (this=0x7f25007d15f0, buf=0x7f250adc0aa0 "gdb /proc/27073/exe 27073", buflen=2000) at /home/stefank/hg/hsx-gc/src/os/linux/vm/vmError_linux.cpp:60
#3 0x00007f250a61df82 in VMError::report_and_die (this=0x7f25007d15f0) at /home/stefank/hg/hsx-gc/src/share/vm/utilities/vmError.cpp:833
#4 0x00007f250a0b6d61 in report_vm_error (file=0x7f250a7ef200 "/home/stefank/hg/hsx-gc/src/share/vm/opto/memnode.cpp", line=1571, error_msg=0x7f250a7f1238 "assert(off != Type::OffsetBot || tp->is_oopptr()->klass()->is_java_lang_Object() || C->has_unsafe_access()) failed",
detail_msg=0x7f250a7f1218 "Field accesses must be precise") at /home/stefank/hg/hsx-gc/src/share/vm/utilities/debug.cpp:220
#5 0x00007f250a3f48ff in LoadNode::Value (this=0x7f24fd785780, phase=0x7f25007d2020) at /home/stefank/hg/hsx-gc/src/share/vm/opto/memnode.cpp:1566
#6 0x00007f250a4d2c87 in PhaseGVN::transform_no_reclaim (this=0x7f25007d2020, n=0x7f24fd785780) at /home/stefank/hg/hsx-gc/src/share/vm/opto/phaseX.cpp:689
#7 0x00007f250a4d2e0b in PhaseGVN::transform (this=0x7f25007d2020, n=0x7f24fd785780) at /home/stefank/hg/hsx-gc/src/share/vm/opto/phaseX.cpp:660
#8 0x00007f250a1c6d3e in GraphKit::make_load (this=0x7f25007d1bd0, ctl=0x0, adr=0x7f24fd7855f0, t=0x7f24fc0e1a18, bt=T_INT, adr_idx=13, require_atomic_access=false) at /home/stefank/hg/hsx-gc/src/share/vm/opto/graphKit.cpp:1429
#9 0x00007f2509f9b581 in GraphKit::make_load (this=0x7f25007d1bd0, ctl=0x0, adr=0x7f24fd7855f0, t=0x7f24fc0e1a18, bt=T_INT, adr_type=0x7f24fc0e3410, require_atomic_access=false) at /home/stefank/hg/hsx-gc/src/share/vm/opto/graphKit.hpp:474
#10 0x00007f250a1c6ef9 in GraphKit::load_array_element (this=0x7f25007d1bd0, ctl=0x0, ary=0x7f24fd785310, idx=0x7f24fd785058, arytype=0x7f24fc0e3410) at /home/stefank/hg/hsx-gc/src/share/vm/opto/graphKit.cpp:1618
#11 0x00007f250a561d51 in PhaseStringOpts::int_stringSize (this=0x7f25007d2a20, kit=..., arg=0x1bab748) at /home/stefank/hg/hsx-gc/src/share/vm/opto/stringopts.cpp:991
#12 0x00007f250a56481e in PhaseStringOpts::replace_string_concat (this=0x7f25007d2a20, sc=0x1b11538) at /home/stefank/hg/hsx-gc/src/share/vm/opto/stringopts.cpp:1291
#13 0x00007f250a565a6a in PhaseStringOpts::PhaseStringOpts (this=0x7f25007d2a20, gvn=0x7f25007d2020) at /home/stefank/hg/hsx-gc/src/share/vm/opto/stringopts.cpp:611
#14 0x00007f250a04feef in Compile::Compile (this=0x7f25007d2dc0, ci_env=0x7f25007d3790, compiler=0x1879398, target=0x7f24fd6d2a28, osr_bci=-1, subsume_loads=true, do_escape_analysis=true) at /home/stefank/hg/hsx-gc/src/share/vm/opto/compile.cpp:721
#15 0x00007f2509f94e24 in C2Compiler::compile_method (this=0x1879398, env=0x7f25007d3790, target=0x7f24fd6d2a28, entry_bci=-1) at /home/stefank/hg/hsx-gc/src/share/vm/opto/c2compiler.cpp:130
#16 0x00007f250a056eec in CompileBroker::invoke_compiler_on_method (task=0x19d4148) at /home/stefank/hg/hsx-gc/src/share/vm/compiler/compileBroker.cpp:1760
#17 0x00007f250a059872 in CompileBroker::compiler_thread_loop () at /home/stefank/hg/hsx-gc/src/share/vm/compiler/compileBroker.cpp:1597