--- a/hotspot/src/share/vm/code/nmethod.cpp Fri Mar 18 09:03:43 2011 -0700
+++ b/hotspot/src/share/vm/code/nmethod.cpp Fri Mar 18 15:52:42 2011 -0700
@@ -1105,6 +1105,20 @@
}
+void nmethod::verify_oop_relocations() {
+ // Ensure sure that the code matches the current oop values
+ RelocIterator iter(this, NULL, NULL);
+ while (iter.next()) {
+ if (iter.type() == relocInfo::oop_type) {
+ oop_Relocation* reloc = iter.oop_reloc();
+ if (!reloc->oop_is_immediate()) {
+ reloc->verify_oop_relocation();
+ }
+ }
+ }
+}
+
+
ScopeDesc* nmethod::scope_desc_at(address pc) {
PcDesc* pd = pc_desc_at(pc);
guarantee(pd != NULL, "scope must be present");
@@ -1823,6 +1837,7 @@
assert(cur != NULL, "not NULL-terminated");
nmethod* next = cur->_oops_do_mark_link;
cur->_oops_do_mark_link = NULL;
+ cur->fix_oop_relocations();
NOT_PRODUCT(if (TraceScavenge) cur->print_on(tty, "oops_do, unmark\n"));
cur = next;
}