< prev index next >

src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp

Print this page




1317 }
1318 
1319 
1320 void LIRGenerator::put_Object_unsafe(LIR_Opr src, LIR_Opr offset, LIR_Opr data,
1321                                      BasicType type, bool is_volatile) {
1322   LIR_Address* addr = new LIR_Address(src, offset, type);
1323   bool is_obj = (type == T_ARRAY || type == T_OBJECT);
1324   if (is_obj) {
1325     // Do the pre-write barrier, if any.
1326     pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */,
1327                 true /* do_load */, false /* patch */, NULL);
1328     __ move(data, addr);
1329     assert(src->is_register(), "must be register");
1330     // Seems to be a precise address
1331     post_barrier(LIR_OprFact::address(addr), data);
1332   } else {
1333     __ move(data, addr);
1334   }
1335 }
1336 











1337 void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
1338   BasicType type = x->basic_type();
1339   LIRItem src(x->object(), this);
1340   LIRItem off(x->offset(), this);
1341   LIRItem value(x->value(), this);
1342 
1343   src.load_item();
1344   off.load_nonconstant();
1345 
1346   // We can cope with a constant increment in an xadd
1347   if (! (x->is_add()
1348          && value.is_constant()
1349          && can_inline_as_constant(x->value()))) {
1350     value.load_item();
1351   }
1352 
1353   LIR_Opr dst = rlock_result(x, type);
1354   LIR_Opr data = value.result();
1355   bool is_obj = (type == T_ARRAY || type == T_OBJECT);
1356   LIR_Opr offset = off.result();




1317 }
1318 
1319 
1320 void LIRGenerator::put_Object_unsafe(LIR_Opr src, LIR_Opr offset, LIR_Opr data,
1321                                      BasicType type, bool is_volatile) {
1322   LIR_Address* addr = new LIR_Address(src, offset, type);
1323   bool is_obj = (type == T_ARRAY || type == T_OBJECT);
1324   if (is_obj) {
1325     // Do the pre-write barrier, if any.
1326     pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */,
1327                 true /* do_load */, false /* patch */, NULL);
1328     __ move(data, addr);
1329     assert(src->is_register(), "must be register");
1330     // Seems to be a precise address
1331     post_barrier(LIR_OprFact::address(addr), data);
1332   } else {
1333     __ move(data, addr);
1334   }
1335 }
1336 
1337 LIR_Opr LIRGenerator::unpack_offset(LIR_Opr src, LIR_Opr off) {
1338   LIR_Opr tmp = new_register(T_LONG);
1339   LabelObj* Lcont = new LabelObj();
1340   __ move(off, tmp);
1341   __ cmp(lir_cond_equal, src, LIR_OprFact::oopConst(NULL));
1342   __ branch(lir_cond_equal, T_OBJECT, Lcont->label());
1343   __ shift_right(tmp, Unsafe::offset_shift, tmp);
1344   __ branch_destination(Lcont->label());
1345   return tmp;
1346 }
1347 
1348 void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
1349   BasicType type = x->basic_type();
1350   LIRItem src(x->object(), this);
1351   LIRItem off(x->offset(), this);
1352   LIRItem value(x->value(), this);
1353 
1354   src.load_item();
1355   off.load_nonconstant();
1356 
1357   // We can cope with a constant increment in an xadd
1358   if (! (x->is_add()
1359          && value.is_constant()
1360          && can_inline_as_constant(x->value()))) {
1361     value.load_item();
1362   }
1363 
1364   LIR_Opr dst = rlock_result(x, type);
1365   LIR_Opr data = value.result();
1366   bool is_obj = (type == T_ARRAY || type == T_OBJECT);
1367   LIR_Opr offset = off.result();


< prev index next >