hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
changeset 590 2954744d7bba
parent 1 489c9b5090e2
child 670 ddf3e9583f2f
--- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp	Wed May 21 10:45:07 2008 -0700
+++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp	Wed May 21 13:46:23 2008 -0700
@@ -87,6 +87,17 @@
 #ifdef _LP64
     jint inst2;
     guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
+    if (format() != 0) {
+      assert(type() == relocInfo::oop_type, "only narrow oops case");
+      jint np = oopDesc::encode_heap_oop((oop)x);
+      inst &= ~Assembler::hi22(-1);
+      inst |=  Assembler::hi22((intptr_t)np);
+      ip->set_long_at(0, inst);
+      inst2 = ip->long_at( NativeInstruction::nop_instruction_size );
+      guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op");
+      ip->set_long_at(NativeInstruction::nop_instruction_size, ip->set_data32_simm13( inst2, (intptr_t)np));
+      break;
+    }
     ip->set_data64_sethi( ip->addr_at(0), (intptr_t)x );
 #ifdef COMPILER2
     // [RGV] Someone must have missed putting in a reloc entry for the