681 } else {
682 masm.movflt(result, (AMD64Address) crb.asFloatConstRef(input));
683 }
684 break;
685 case Double:
686 // This is *not* the same as 'constant == 0.0d' in the case where constant is -0.0d
687 if (Double.doubleToRawLongBits(input.asDouble()) == Double.doubleToRawLongBits(0.0d)) {
688 masm.xorpd(result, result);
689 } else {
690 masm.movdbl(result, (AMD64Address) crb.asDoubleConstRef(input));
691 }
692 break;
693 case Object:
694 // Do not optimize with an XOR as this instruction may be between
695 // a CMP and a Jcc in which case the XOR will modify the condition
696 // flags and interfere with the Jcc.
697 if (input.isNull()) {
698 if (crb.mustReplaceWithNullRegister(input)) {
699 masm.movq(result, crb.nullRegister);
700 } else {
701 masm.movq(result, 0x0L);
702 }
703 } else if (crb.target.inlineObjects) {
704 crb.recordInlineDataInCode(input);
705 masm.movq(result, 0xDEADDEADDEADDEADL, true);
706 } else {
707 masm.movq(result, (AMD64Address) crb.recordDataReferenceInCode(input, 0));
708 }
709 break;
710 default:
711 throw GraalError.shouldNotReachHere();
712 }
713 }
714
715 public static boolean canMoveConst2Stack(JavaConstant input) {
716 switch (input.getJavaKind().getStackKind()) {
717 case Int:
718 break;
719 case Long:
720 break;
721 case Float:
|
681 } else {
682 masm.movflt(result, (AMD64Address) crb.asFloatConstRef(input));
683 }
684 break;
685 case Double:
686 // This is *not* the same as 'constant == 0.0d' in the case where constant is -0.0d
687 if (Double.doubleToRawLongBits(input.asDouble()) == Double.doubleToRawLongBits(0.0d)) {
688 masm.xorpd(result, result);
689 } else {
690 masm.movdbl(result, (AMD64Address) crb.asDoubleConstRef(input));
691 }
692 break;
693 case Object:
694 // Do not optimize with an XOR as this instruction may be between
695 // a CMP and a Jcc in which case the XOR will modify the condition
696 // flags and interfere with the Jcc.
697 if (input.isNull()) {
698 if (crb.mustReplaceWithNullRegister(input)) {
699 masm.movq(result, crb.nullRegister);
700 } else {
701 masm.movslq(result, 0);
702 }
703 } else if (crb.target.inlineObjects) {
704 crb.recordInlineDataInCode(input);
705 masm.movq(result, 0xDEADDEADDEADDEADL, true);
706 } else {
707 masm.movq(result, (AMD64Address) crb.recordDataReferenceInCode(input, 0));
708 }
709 break;
710 default:
711 throw GraalError.shouldNotReachHere();
712 }
713 }
714
715 public static boolean canMoveConst2Stack(JavaConstant input) {
716 switch (input.getJavaKind().getStackKind()) {
717 case Int:
718 break;
719 case Long:
720 break;
721 case Float:
|