1447 #endif // INCLUDE_ALL_GCS
1448 case BarrierSet::CardTableForRS:
1449 case BarrierSet::CardTableExtension:
1450 CardTableModRef_post_barrier(addr, new_val);
1451 break;
1452 case BarrierSet::ModRef:
1453 // No post barriers
1454 break;
1455 default :
1456 ShouldNotReachHere();
1457 }
1458 }
1459
1460 ////////////////////////////////////////////////////////////////////////
1461 #if INCLUDE_ALL_GCS
1462
1463 void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
1464 bool do_load, bool patch, CodeEmitInfo* info) {
1465 // First we test whether marking is in progress.
1466 BasicType flag_type;
1467 if (in_bytes(PtrQueue::byte_width_of_active()) == 4) {
1468 flag_type = T_INT;
1469 } else {
1470 guarantee(in_bytes(PtrQueue::byte_width_of_active()) == 1,
1471 "Assumption");
1472 // Use unsigned type T_BOOLEAN here rather than signed T_BYTE since some platforms, eg. ARM,
1473 // need to use unsigned instructions to use the large offset to load the satb_mark_queue.
1474 flag_type = T_BOOLEAN;
1475 }
1476 LIR_Opr thrd = getThreadPointer();
1477 LIR_Address* mark_active_flag_addr =
1478 new LIR_Address(thrd,
1479 in_bytes(JavaThread::satb_mark_queue_offset() +
1480 PtrQueue::byte_offset_of_active()),
1481 flag_type);
1482 // Read the marking-in-progress flag.
1483 LIR_Opr flag_val = new_register(T_INT);
1484 __ load(mark_active_flag_addr, flag_val);
1485 __ cmp(lir_cond_notEqual, flag_val, LIR_OprFact::intConst(0));
1486
1487 LIR_PatchCode pre_val_patch_code = lir_patch_none;
1488
1489 CodeStub* slow;
1490
1491 if (do_load) {
1492 assert(pre_val == LIR_OprFact::illegalOpr, "sanity");
1493 assert(addr_opr != LIR_OprFact::illegalOpr, "sanity");
1494
1495 if (patch)
1496 pre_val_patch_code = lir_patch_normal;
1497
1498 pre_val = new_register(T_OBJECT);
1499
1500 if (!addr_opr->is_address()) {
|
1447 #endif // INCLUDE_ALL_GCS
1448 case BarrierSet::CardTableForRS:
1449 case BarrierSet::CardTableExtension:
1450 CardTableModRef_post_barrier(addr, new_val);
1451 break;
1452 case BarrierSet::ModRef:
1453 // No post barriers
1454 break;
1455 default :
1456 ShouldNotReachHere();
1457 }
1458 }
1459
1460 ////////////////////////////////////////////////////////////////////////
1461 #if INCLUDE_ALL_GCS
1462
1463 void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val,
1464 bool do_load, bool patch, CodeEmitInfo* info) {
1465 // First we test whether marking is in progress.
1466 BasicType flag_type;
1467 if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
1468 flag_type = T_INT;
1469 } else {
1470 guarantee(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1,
1471 "Assumption");
1472 // Use unsigned type T_BOOLEAN here rather than signed T_BYTE since some platforms, eg. ARM,
1473 // need to use unsigned instructions to use the large offset to load the satb_mark_queue.
1474 flag_type = T_BOOLEAN;
1475 }
1476 LIR_Opr thrd = getThreadPointer();
1477 LIR_Address* mark_active_flag_addr =
1478 new LIR_Address(thrd,
1479 in_bytes(JavaThread::satb_mark_queue_offset() +
1480 SATBMarkQueue::byte_offset_of_active()),
1481 flag_type);
1482 // Read the marking-in-progress flag.
1483 LIR_Opr flag_val = new_register(T_INT);
1484 __ load(mark_active_flag_addr, flag_val);
1485 __ cmp(lir_cond_notEqual, flag_val, LIR_OprFact::intConst(0));
1486
1487 LIR_PatchCode pre_val_patch_code = lir_patch_none;
1488
1489 CodeStub* slow;
1490
1491 if (do_load) {
1492 assert(pre_val == LIR_OprFact::illegalOpr, "sanity");
1493 assert(addr_opr != LIR_OprFact::illegalOpr, "sanity");
1494
1495 if (patch)
1496 pre_val_patch_code = lir_patch_normal;
1497
1498 pre_val = new_register(T_OBJECT);
1499
1500 if (!addr_opr->is_address()) {
|