< prev index next >

src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp

Print this page




1187         // This address is precise
1188         post_barrier(LIR_OprFact::address(addr), data);
1189       }
1190     }
1191 }
1192 
1193 
1194 void LIRGenerator::get_Object_unsafe(LIR_Opr dst, LIR_Opr src, LIR_Opr offset,
1195                                      BasicType type, bool is_volatile) {
1196 #ifndef _LP64
1197   if (is_volatile && type == T_LONG) {
1198     __ volatile_load_unsafe_reg(src, offset, dst, type, NULL, lir_patch_none);
1199   } else
1200 #endif
1201     {
1202     LIR_Address* addr = new LIR_Address(src, offset, type);
1203     __ load(addr, dst);
1204   }
1205 }
1206 











1207 void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
1208   BasicType type = x->basic_type();
1209   LIRItem src(x->object(), this);
1210   LIRItem off(x->offset(), this);
1211   LIRItem value(x->value(), this);
1212 
1213   src.load_item();
1214   value.load_item();
1215   off.load_nonconstant();
1216 
1217   LIR_Opr dst = rlock_result(x, type);
1218   LIR_Opr data = value.result();
1219   bool is_obj = (type == T_ARRAY || type == T_OBJECT);
1220   LIR_Opr offset = off.result();
1221 
1222   // Because we want a 2-arg form of xchg
1223   __ move(data, dst);
1224 
1225   assert (!x->is_add() && (type == T_INT || (is_obj LP64_ONLY(&& UseCompressedOops))), "unexpected type");
1226   LIR_Address* addr;




1187         // This address is precise
1188         post_barrier(LIR_OprFact::address(addr), data);
1189       }
1190     }
1191 }
1192 
1193 
1194 void LIRGenerator::get_Object_unsafe(LIR_Opr dst, LIR_Opr src, LIR_Opr offset,
1195                                      BasicType type, bool is_volatile) {
1196 #ifndef _LP64
1197   if (is_volatile && type == T_LONG) {
1198     __ volatile_load_unsafe_reg(src, offset, dst, type, NULL, lir_patch_none);
1199   } else
1200 #endif
1201     {
1202     LIR_Address* addr = new LIR_Address(src, offset, type);
1203     __ load(addr, dst);
1204   }
1205 }
1206 
1207 LIR_Opr LIRGenerator::unpack_offset(LIR_Opr src, LIR_Opr off) {
1208   LIR_Opr tmp = new_register(T_LONG);
1209   LabelObj* Lcont = new LabelObj();
1210   __ move(off, tmp);
1211   __ cmp(lir_cond_equal, src, LIR_OprFact::oopConst(NULL));
1212   __ branch(lir_cond_equal, T_OBJECT, Lcont->label());
1213   __ shift_right(tmp, Unsafe::offset_shift, tmp);
1214   __ branch_destination(Lcont->label());
1215   return tmp;
1216 }
1217 
1218 void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
1219   BasicType type = x->basic_type();
1220   LIRItem src(x->object(), this);
1221   LIRItem off(x->offset(), this);
1222   LIRItem value(x->value(), this);
1223 
1224   src.load_item();
1225   value.load_item();
1226   off.load_nonconstant();
1227 
1228   LIR_Opr dst = rlock_result(x, type);
1229   LIR_Opr data = value.result();
1230   bool is_obj = (type == T_ARRAY || type == T_OBJECT);
1231   LIR_Opr offset = off.result();
1232 
1233   // Because we want a 2-arg form of xchg
1234   __ move(data, dst);
1235 
1236   assert (!x->is_add() && (type == T_INT || (is_obj LP64_ONLY(&& UseCompressedOops))), "unexpected type");
1237   LIR_Address* addr;


< prev index next >