7035861: linux-armsflt: assert(ni->data() == (int)(x + o)) failed: instructions must match
authorvladidan
Wed, 20 Apr 2011 14:07:57 -0400
changeset 9318 c7acc13a9226
parent 9170 56670ec8e643
child 9319 1389411f24f6
7035861: linux-armsflt: assert(ni->data() == (int)(x + o)) failed: instructions must match Summary: The change avoids generating relocation info entry for the staging area patching stub on systems that don't support movw/movt instructions Reviewed-by: bdelsart
hotspot/src/share/vm/c1/c1_Runtime1.cpp
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Thu Apr 14 11:02:05 2011 -0400
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Wed Apr 20 14:07:57 2011 -0400
@@ -1026,9 +1026,21 @@
           // first replace the tail, then the call
 #ifdef ARM
           if(stub_id == Runtime1::load_klass_patching_id && !VM_Version::supports_movw()) {
+            nmethod* nm = CodeCache::find_nmethod(instr_pc);
+            oop* oop_addr = NULL;
+            assert(nm != NULL, "invalid nmethod_pc");
+            RelocIterator oops(nm, copy_buff, copy_buff + 1);
+            while (oops.next()) {
+              if (oops.type() == relocInfo::oop_type) {
+                oop_Relocation* r = oops.oop_reloc();
+                oop_addr = r->oop_addr();
+                break;
+              }
+            }
+            assert(oop_addr != NULL, "oop relocation must exist");
             copy_buff -= *byte_count;
             NativeMovConstReg* n_copy2 = nativeMovConstReg_at(copy_buff);
-            n_copy2->set_data((intx) (load_klass()), instr_pc);
+            n_copy2->set_pc_relative_offset((address)oop_addr, instr_pc);
           }
 #endif