924 LIRItem buf(x->argument_at(1), this);
925 LIRItem off(x->argument_at(2), this);
926 LIRItem len(x->argument_at(3), this);
927 buf.load_item();
928 off.load_nonconstant();
929
930 LIR_Opr index = off.result();
931 int offset = is_updateBytes ? arrayOopDesc::base_offset_in_bytes(T_BYTE) : 0;
932 if(off.result()->is_constant()) {
933 index = LIR_OprFact::illegalOpr;
934 offset += off.result()->as_jint();
935 }
936 LIR_Opr base_op = buf.result();
937
938 if (index->is_valid()) {
939 LIR_Opr tmp = new_register(T_LONG);
940 __ convert(Bytecodes::_i2l, index, tmp);
941 index = tmp;
942 }
943
944 if (offset) {
945 LIR_Opr tmp = new_pointer_register();
946 __ add(base_op, LIR_OprFact::intConst(offset), tmp);
947 base_op = tmp;
948 offset = 0;
949 }
950
951 LIR_Address* a = new LIR_Address(base_op,
952 index,
953 offset,
954 T_BYTE);
955 BasicTypeList signature(3);
956 signature.append(T_INT);
957 signature.append(T_ADDRESS);
958 signature.append(T_INT);
959 CallingConvention* cc = frame_map()->c_calling_convention(&signature);
960 const LIR_Opr result_reg = result_register_for(x->type());
961
962 LIR_Opr addr = new_pointer_register();
963 __ leal(LIR_OprFact::address(a), addr);
1000 // len = end - off
1001 LIR_Opr len = end.result();
1002 LIR_Opr tmpA = new_register(T_INT);
1003 LIR_Opr tmpB = new_register(T_INT);
1004 __ move(end.result(), tmpA);
1005 __ move(off.result(), tmpB);
1006 __ sub(tmpA, tmpB, tmpA);
1007 len = tmpA;
1008
1009 LIR_Opr index = off.result();
1010 if(off.result()->is_constant()) {
1011 index = LIR_OprFact::illegalOpr;
1012 offset += off.result()->as_jint();
1013 }
1014 LIR_Opr base_op = buf.result();
1015
1016 if (index->is_valid()) {
1017 LIR_Opr tmp = new_register(T_LONG);
1018 __ convert(Bytecodes::_i2l, index, tmp);
1019 index = tmp;
1020 }
1021
1022 if (offset) {
1023 LIR_Opr tmp = new_pointer_register();
1024 __ add(base_op, LIR_OprFact::intConst(offset), tmp);
1025 base_op = tmp;
1026 offset = 0;
1027 }
1028
1029 LIR_Address* a = new LIR_Address(base_op,
1030 index,
1031 offset,
1032 T_BYTE);
1033 BasicTypeList signature(3);
1034 signature.append(T_INT);
1035 signature.append(T_ADDRESS);
1036 signature.append(T_INT);
1037 CallingConvention* cc = frame_map()->c_calling_convention(&signature);
1038 const LIR_Opr result_reg = result_register_for(x->type());
1039
|
924 LIRItem buf(x->argument_at(1), this);
925 LIRItem off(x->argument_at(2), this);
926 LIRItem len(x->argument_at(3), this);
927 buf.load_item();
928 off.load_nonconstant();
929
930 LIR_Opr index = off.result();
931 int offset = is_updateBytes ? arrayOopDesc::base_offset_in_bytes(T_BYTE) : 0;
932 if(off.result()->is_constant()) {
933 index = LIR_OprFact::illegalOpr;
934 offset += off.result()->as_jint();
935 }
936 LIR_Opr base_op = buf.result();
937
938 if (index->is_valid()) {
939 LIR_Opr tmp = new_register(T_LONG);
940 __ convert(Bytecodes::_i2l, index, tmp);
941 index = tmp;
942 }
943
944 if (is_updateBytes) {
945 base_op = access_resolve(IN_HEAP | ACCESS_READ, base_op, NULL);
946 }
947
948 if (offset) {
949 LIR_Opr tmp = new_pointer_register();
950 __ add(base_op, LIR_OprFact::intConst(offset), tmp);
951 base_op = tmp;
952 offset = 0;
953 }
954
955 LIR_Address* a = new LIR_Address(base_op,
956 index,
957 offset,
958 T_BYTE);
959 BasicTypeList signature(3);
960 signature.append(T_INT);
961 signature.append(T_ADDRESS);
962 signature.append(T_INT);
963 CallingConvention* cc = frame_map()->c_calling_convention(&signature);
964 const LIR_Opr result_reg = result_register_for(x->type());
965
966 LIR_Opr addr = new_pointer_register();
967 __ leal(LIR_OprFact::address(a), addr);
1004 // len = end - off
1005 LIR_Opr len = end.result();
1006 LIR_Opr tmpA = new_register(T_INT);
1007 LIR_Opr tmpB = new_register(T_INT);
1008 __ move(end.result(), tmpA);
1009 __ move(off.result(), tmpB);
1010 __ sub(tmpA, tmpB, tmpA);
1011 len = tmpA;
1012
1013 LIR_Opr index = off.result();
1014 if(off.result()->is_constant()) {
1015 index = LIR_OprFact::illegalOpr;
1016 offset += off.result()->as_jint();
1017 }
1018 LIR_Opr base_op = buf.result();
1019
1020 if (index->is_valid()) {
1021 LIR_Opr tmp = new_register(T_LONG);
1022 __ convert(Bytecodes::_i2l, index, tmp);
1023 index = tmp;
1024 }
1025
1026 if (is_updateBytes) {
1027 base_op = access_resolve(IN_HEAP | ACCESS_READ, base_op, NULL);
1028 }
1029
1030 if (offset) {
1031 LIR_Opr tmp = new_pointer_register();
1032 __ add(base_op, LIR_OprFact::intConst(offset), tmp);
1033 base_op = tmp;
1034 offset = 0;
1035 }
1036
1037 LIR_Address* a = new LIR_Address(base_op,
1038 index,
1039 offset,
1040 T_BYTE);
1041 BasicTypeList signature(3);
1042 signature.append(T_INT);
1043 signature.append(T_ADDRESS);
1044 signature.append(T_INT);
1045 CallingConvention* cc = frame_map()->c_calling_convention(&signature);
1046 const LIR_Opr result_reg = result_register_for(x->type());
1047
|