hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
changeset 33807 9f8b0f8a3f29
parent 33160 c59f1676d27e
child 46381 020219e46c86
equal deleted inserted replaced
33806:4160a3c28ce8 33807:9f8b0f8a3f29
    82     int simm13 = Assembler::low10((intptr_t)x) + o;
    82     int simm13 = Assembler::low10((intptr_t)x) + o;
    83     guarantee(Assembler::is_simm13(simm13), "offset can't overflow simm13");
    83     guarantee(Assembler::is_simm13(simm13), "offset can't overflow simm13");
    84     inst &= ~Assembler::simm(    -1, 13);
    84     inst &= ~Assembler::simm(    -1, 13);
    85     inst |=  Assembler::simm(simm13, 13);
    85     inst |=  Assembler::simm(simm13, 13);
    86     if (verify_only) {
    86     if (verify_only) {
    87       assert(ip->long_at(0) == inst, "instructions must match");
    87       guarantee(ip->long_at(0) == inst, "instructions must match");
    88     } else {
    88     } else {
    89       ip->set_long_at(0, inst);
    89       ip->set_long_at(0, inst);
    90     }
    90     }
    91     }
    91     }
    92     break;
    92     break;
   100       assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type, "only narrow oops or klasses case");
   100       assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type, "only narrow oops or klasses case");
   101       jint np = type() == relocInfo::oop_type ? oopDesc::encode_heap_oop((oop)x) : Klass::encode_klass((Klass*)x);
   101       jint np = type() == relocInfo::oop_type ? oopDesc::encode_heap_oop((oop)x) : Klass::encode_klass((Klass*)x);
   102       inst &= ~Assembler::hi22(-1);
   102       inst &= ~Assembler::hi22(-1);
   103       inst |=  Assembler::hi22((intptr_t)np);
   103       inst |=  Assembler::hi22((intptr_t)np);
   104       if (verify_only) {
   104       if (verify_only) {
   105         assert(ip->long_at(0) == inst, "instructions must match");
   105         guarantee(ip->long_at(0) == inst, "instructions must match");
   106       } else {
   106       } else {
   107         ip->set_long_at(0, inst);
   107         ip->set_long_at(0, inst);
   108       }
   108       }
   109       inst2 = ip->long_at( NativeInstruction::nop_instruction_size );
   109       inst2 = ip->long_at( NativeInstruction::nop_instruction_size );
   110       guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op");
   110       guarantee(Assembler::inv_op(inst2)==Assembler::arith_op, "arith op");
   111       if (verify_only) {
   111       if (verify_only) {
   112         assert(ip->long_at(NativeInstruction::nop_instruction_size) == NativeInstruction::set_data32_simm13( inst2, (intptr_t)np),
   112         guarantee(ip->long_at(NativeInstruction::nop_instruction_size) == NativeInstruction::set_data32_simm13( inst2, (intptr_t)np),
   113                "instructions must match");
   113                   "instructions must match");
   114       } else {
   114       } else {
   115         ip->set_long_at(NativeInstruction::nop_instruction_size, NativeInstruction::set_data32_simm13( inst2, (intptr_t)np));
   115         ip->set_long_at(NativeInstruction::nop_instruction_size, NativeInstruction::set_data32_simm13( inst2, (intptr_t)np));
   116       }
   116       }
   117       break;
   117       break;
   118     }
   118     }
   125     guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
   125     guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
   126     inst &= ~Assembler::hi22(     -1);
   126     inst &= ~Assembler::hi22(     -1);
   127     inst |=  Assembler::hi22((intptr_t)x);
   127     inst |=  Assembler::hi22((intptr_t)x);
   128     // (ignore offset; it doesn't play into the sethi)
   128     // (ignore offset; it doesn't play into the sethi)
   129     if (verify_only) {
   129     if (verify_only) {
   130       assert(ip->long_at(0) == inst, "instructions must match");
   130       guarantee(ip->long_at(0) == inst, "instructions must match");
   131     } else {
   131     } else {
   132       ip->set_long_at(0, inst);
   132       ip->set_long_at(0, inst);
   133     }
   133     }
   134 #endif
   134 #endif
   135     }
   135     }