src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 52568 40474b7105f4
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
   415   IdealKit ideal(kit, true);
   415   IdealKit ideal(kit, true);
   416 
   416 
   417   Node* tls = __ thread(); // ThreadLocalStorage
   417   Node* tls = __ thread(); // ThreadLocalStorage
   418 
   418 
   419   Node* no_base = __ top();
   419   Node* no_base = __ top();
   420   float unlikely  = PROB_UNLIKELY(0.999);
   420   float likely = PROB_LIKELY_MAG(3);
       
   421   float unlikely = PROB_UNLIKELY_MAG(3);
   421   Node* young_card = __ ConI((jint)G1CardTable::g1_young_card_val());
   422   Node* young_card = __ ConI((jint)G1CardTable::g1_young_card_val());
   422   Node* dirty_card = __ ConI((jint)G1CardTable::dirty_card_val());
   423   Node* dirty_card = __ ConI((jint)G1CardTable::dirty_card_val());
   423   Node* zeroX = __ ConX(0);
   424   Node* zeroX = __ ConX(0);
   424 
   425 
   425   const TypeFunc *tf = write_ref_field_post_entry_Type();
   426   const TypeFunc *tf = write_ref_field_post_entry_Type();
   458     // and extra shift. Do we have an unsigned compare??
   459     // and extra shift. Do we have an unsigned compare??
   459     // Node* region_size = __ ConI(1 << HeapRegion::LogOfHRGrainBytes);
   460     // Node* region_size = __ ConI(1 << HeapRegion::LogOfHRGrainBytes);
   460     Node* xor_res =  __ URShiftX ( __ XorX( cast,  __ CastPX(__ ctrl(), val)), __ ConI(HeapRegion::LogOfHRGrainBytes));
   461     Node* xor_res =  __ URShiftX ( __ XorX( cast,  __ CastPX(__ ctrl(), val)), __ ConI(HeapRegion::LogOfHRGrainBytes));
   461 
   462 
   462     // if (xor_res == 0) same region so skip
   463     // if (xor_res == 0) same region so skip
   463     __ if_then(xor_res, BoolTest::ne, zeroX); {
   464     __ if_then(xor_res, BoolTest::ne, zeroX, likely); {
   464 
   465 
   465       // No barrier if we are storing a NULL
   466       // No barrier if we are storing a NULL
   466       __ if_then(val, BoolTest::ne, kit->null(), unlikely); {
   467       __ if_then(val, BoolTest::ne, kit->null(), likely); {
   467 
   468 
   468         // Ok must mark the card if not already dirty
   469         // Ok must mark the card if not already dirty
   469 
   470 
   470         // load the original value of the card
   471         // load the original value of the card
   471         Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw);
   472         Node* card_val = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw);
   472 
   473 
   473         __ if_then(card_val, BoolTest::ne, young_card); {
   474         __ if_then(card_val, BoolTest::ne, young_card, unlikely); {
   474           kit->sync_kit(ideal);
   475           kit->sync_kit(ideal);
   475           kit->insert_mem_bar(Op_MemBarVolatile, oop_store);
   476           kit->insert_mem_bar(Op_MemBarVolatile, oop_store);
   476           __ sync_kit(kit);
   477           __ sync_kit(kit);
   477 
   478 
   478           Node* card_val_reload = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw);
   479           Node* card_val_reload = __ load(__ ctrl(), card_adr, TypeInt::INT, T_BYTE, Compile::AliasIdxRaw);