791 val.load_item();
792 cmp.load_item();
793
794 LIR_Address* a;
795 if(offset.result()->is_constant()) {
796 jlong c = offset.result()->as_jlong();
797 if ((jlong)((jint)c) == c) {
798 a = new LIR_Address(obj.result(),
799 (jint)c,
800 as_BasicType(type));
801 } else {
802 LIR_Opr tmp = new_register(T_LONG);
803 __ move(offset.result(), tmp);
804 a = new LIR_Address(obj.result(),
805 tmp,
806 as_BasicType(type));
807 }
808 } else {
809 a = new LIR_Address(obj.result(),
810 offset.result(),
811 LIR_Address::times_1,
812 0,
813 as_BasicType(type));
814 }
815 LIR_Opr addr = new_pointer_register();
816 __ leal(LIR_OprFact::address(a), addr);
817
818 if (type == objectType) { // Write-barrier needed for Object fields.
819 // Do the pre-write barrier, if any.
820 pre_barrier(addr, LIR_OprFact::illegalOpr /* pre_val */,
821 true /* do_load */, false /* patch */, NULL);
822 }
823
824 LIR_Opr result = rlock_result(x);
825
826 LIR_Opr ill = LIR_OprFact::illegalOpr; // for convenience
827 if (type == objectType)
828 __ cas_obj(addr, cmp.result(), val.result(), new_register(T_INT), new_register(T_INT),
829 result);
830 else if (type == intType)
831 __ cas_int(addr, cmp.result(), val.result(), ill, ill);
985 index = LIR_OprFact::illegalOpr;
986 offset += off.result()->as_jint();
987 }
988 LIR_Opr base_op = buf.result();
989
990 if (index->is_valid()) {
991 LIR_Opr tmp = new_register(T_LONG);
992 __ convert(Bytecodes::_i2l, index, tmp);
993 index = tmp;
994 }
995
996 if (offset) {
997 LIR_Opr tmp = new_pointer_register();
998 __ add(base_op, LIR_OprFact::intConst(offset), tmp);
999 base_op = tmp;
1000 offset = 0;
1001 }
1002
1003 LIR_Address* a = new LIR_Address(base_op,
1004 index,
1005 LIR_Address::times_1,
1006 offset,
1007 T_BYTE);
1008 BasicTypeList signature(3);
1009 signature.append(T_INT);
1010 signature.append(T_ADDRESS);
1011 signature.append(T_INT);
1012 CallingConvention* cc = frame_map()->c_calling_convention(&signature);
1013 const LIR_Opr result_reg = result_register_for(x->type());
1014
1015 LIR_Opr addr = new_pointer_register();
1016 __ leal(LIR_OprFact::address(a), addr);
1017
1018 crc.load_item_force(cc->at(0));
1019 __ move(addr, cc->at(1));
1020 len.load_item_force(cc->at(2));
1021
1022 __ call_runtime_leaf(StubRoutines::updateBytesCRC32(), getThreadTemp(), result_reg, cc->args());
1023 __ move(result_reg, result);
1024
1025 break;
|
791 val.load_item();
792 cmp.load_item();
793
794 LIR_Address* a;
795 if(offset.result()->is_constant()) {
796 jlong c = offset.result()->as_jlong();
797 if ((jlong)((jint)c) == c) {
798 a = new LIR_Address(obj.result(),
799 (jint)c,
800 as_BasicType(type));
801 } else {
802 LIR_Opr tmp = new_register(T_LONG);
803 __ move(offset.result(), tmp);
804 a = new LIR_Address(obj.result(),
805 tmp,
806 as_BasicType(type));
807 }
808 } else {
809 a = new LIR_Address(obj.result(),
810 offset.result(),
811 0,
812 as_BasicType(type));
813 }
814 LIR_Opr addr = new_pointer_register();
815 __ leal(LIR_OprFact::address(a), addr);
816
817 if (type == objectType) { // Write-barrier needed for Object fields.
818 // Do the pre-write barrier, if any.
819 pre_barrier(addr, LIR_OprFact::illegalOpr /* pre_val */,
820 true /* do_load */, false /* patch */, NULL);
821 }
822
823 LIR_Opr result = rlock_result(x);
824
825 LIR_Opr ill = LIR_OprFact::illegalOpr; // for convenience
826 if (type == objectType)
827 __ cas_obj(addr, cmp.result(), val.result(), new_register(T_INT), new_register(T_INT),
828 result);
829 else if (type == intType)
830 __ cas_int(addr, cmp.result(), val.result(), ill, ill);
984 index = LIR_OprFact::illegalOpr;
985 offset += off.result()->as_jint();
986 }
987 LIR_Opr base_op = buf.result();
988
989 if (index->is_valid()) {
990 LIR_Opr tmp = new_register(T_LONG);
991 __ convert(Bytecodes::_i2l, index, tmp);
992 index = tmp;
993 }
994
995 if (offset) {
996 LIR_Opr tmp = new_pointer_register();
997 __ add(base_op, LIR_OprFact::intConst(offset), tmp);
998 base_op = tmp;
999 offset = 0;
1000 }
1001
1002 LIR_Address* a = new LIR_Address(base_op,
1003 index,
1004 offset,
1005 T_BYTE);
1006 BasicTypeList signature(3);
1007 signature.append(T_INT);
1008 signature.append(T_ADDRESS);
1009 signature.append(T_INT);
1010 CallingConvention* cc = frame_map()->c_calling_convention(&signature);
1011 const LIR_Opr result_reg = result_register_for(x->type());
1012
1013 LIR_Opr addr = new_pointer_register();
1014 __ leal(LIR_OprFact::address(a), addr);
1015
1016 crc.load_item_force(cc->at(0));
1017 __ move(addr, cc->at(1));
1018 len.load_item_force(cc->at(2));
1019
1020 __ call_runtime_leaf(StubRoutines::updateBytesCRC32(), getThreadTemp(), result_reg, cc->args());
1021 __ move(result_reg, result);
1022
1023 break;
|