Ejemplo n.º 1
0
 @Override
 public void emitCode(TargetMethodAssembler tasm, SPARCMacroAssembler masm) {
   final int pos = masm.codeBuffer.position();
   Register scratch = ((RegisterValue) temp).getRegister();
   new Setx(config.safepointPollingAddress, scratch).emit(masm);
   tasm.recordInfopoint(pos, state, InfopointReason.SAFEPOINT);
   new Ldx(new SPARCAddress(scratch, 0), g0).emit(masm);
 }
Ejemplo n.º 2
0
 public static void emit(
     TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Compare opcode, Value x, Value y) {
   if (isRegister(y)) {
     switch (opcode) {
       case ICMP:
         masm.cmpl(asIntReg(x), asIntReg(y));
         break;
       case LCMP:
         masm.cmpq(asLongReg(x), asLongReg(y));
         break;
       case ACMP:
         masm.cmpptr(asObjectReg(x), asObjectReg(y));
         break;
       case FCMP:
         masm.ucomiss(asFloatReg(x), asFloatReg(y));
         break;
       case DCMP:
         masm.ucomisd(asDoubleReg(x), asDoubleReg(y));
         break;
       default:
         throw GraalInternalError.shouldNotReachHere();
     }
   } else if (isConstant(y)) {
     switch (opcode) {
       case ICMP:
         masm.cmpl(asIntReg(x), tasm.asIntConst(y));
         break;
       case LCMP:
         masm.cmpq(asLongReg(x), tasm.asIntConst(y));
         break;
       case ACMP:
         if (((Constant) y).isNull()) {
           masm.cmpq(asObjectReg(x), 0);
           break;
         } else {
           throw GraalInternalError.shouldNotReachHere(
               "Only null object constants are allowed in comparisons");
         }
       case FCMP:
         masm.ucomiss(asFloatReg(x), (AMD64Address) tasm.asFloatConstRef(y));
         break;
       case DCMP:
         masm.ucomisd(asDoubleReg(x), (AMD64Address) tasm.asDoubleConstRef(y));
         break;
       default:
         throw GraalInternalError.shouldNotReachHere();
     }
   } else {
     switch (opcode) {
       case ICMP:
         masm.cmpl(asIntReg(x), (AMD64Address) tasm.asIntAddr(y));
         break;
       case LCMP:
         masm.cmpq(asLongReg(x), (AMD64Address) tasm.asLongAddr(y));
         break;
       case ACMP:
         masm.cmpptr(asObjectReg(x), (AMD64Address) tasm.asObjectAddr(y));
         break;
       case FCMP:
         masm.ucomiss(asFloatReg(x), (AMD64Address) tasm.asFloatAddr(y));
         break;
       case DCMP:
         masm.ucomisd(asDoubleReg(x), (AMD64Address) tasm.asDoubleAddr(y));
         break;
       default:
         throw GraalInternalError.shouldNotReachHere();
     }
   }
 }