equal
deleted
inserted
replaced
28 #include "gc/g1/g1BarrierSet.hpp" |
28 #include "gc/g1/g1BarrierSet.hpp" |
29 #include "gc/g1/g1CardTable.hpp" |
29 #include "gc/g1/g1CardTable.hpp" |
30 #include "gc/g1/heapRegion.hpp" |
30 #include "gc/g1/heapRegion.hpp" |
31 #include "gc/shared/barrierSet.hpp" |
31 #include "gc/shared/barrierSet.hpp" |
32 #include "gc/shared/cardTable.hpp" |
32 #include "gc/shared/cardTable.hpp" |
33 #include "gc/shared/cardTableModRefBS.hpp" |
33 #include "gc/shared/cardTableBarrierSet.hpp" |
34 #include "gc/shared/collectedHeap.hpp" |
34 #include "gc/shared/collectedHeap.hpp" |
35 #include "memory/resourceArea.hpp" |
35 #include "memory/resourceArea.hpp" |
36 #include "opto/addnode.hpp" |
36 #include "opto/addnode.hpp" |
37 #include "opto/castnode.hpp" |
37 #include "opto/castnode.hpp" |
38 #include "opto/convertnode.hpp" |
38 #include "opto/convertnode.hpp" |
1563 switch (bs->kind()) { |
1563 switch (bs->kind()) { |
1564 case BarrierSet::G1BarrierSet: |
1564 case BarrierSet::G1BarrierSet: |
1565 g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); |
1565 g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); |
1566 break; |
1566 break; |
1567 |
1567 |
1568 case BarrierSet::CardTableModRef: |
1568 case BarrierSet::CardTableBarrierSet: |
1569 break; |
1569 break; |
1570 |
1570 |
1571 default : |
1571 default : |
1572 ShouldNotReachHere(); |
1572 ShouldNotReachHere(); |
1573 |
1573 |
1578 BarrierSet* bs = Universe::heap()->barrier_set(); |
1578 BarrierSet* bs = Universe::heap()->barrier_set(); |
1579 switch (bs->kind()) { |
1579 switch (bs->kind()) { |
1580 case BarrierSet::G1BarrierSet: |
1580 case BarrierSet::G1BarrierSet: |
1581 return true; // Can move it if no safepoint |
1581 return true; // Can move it if no safepoint |
1582 |
1582 |
1583 case BarrierSet::CardTableModRef: |
1583 case BarrierSet::CardTableBarrierSet: |
1584 return true; // There is no pre-barrier |
1584 return true; // There is no pre-barrier |
1585 |
1585 |
1586 default : |
1586 default : |
1587 ShouldNotReachHere(); |
1587 ShouldNotReachHere(); |
1588 } |
1588 } |
1602 switch (bs->kind()) { |
1602 switch (bs->kind()) { |
1603 case BarrierSet::G1BarrierSet: |
1603 case BarrierSet::G1BarrierSet: |
1604 g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise); |
1604 g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise); |
1605 break; |
1605 break; |
1606 |
1606 |
1607 case BarrierSet::CardTableModRef: |
1607 case BarrierSet::CardTableBarrierSet: |
1608 write_barrier_post(store, obj, adr, adr_idx, val, use_precise); |
1608 write_barrier_post(store, obj, adr, adr_idx, val, use_precise); |
1609 break; |
1609 break; |
1610 |
1610 |
1611 default : |
1611 default : |
1612 ShouldNotReachHere(); |
1612 ShouldNotReachHere(); |
3809 //----------------------------- store barriers ---------------------------- |
3809 //----------------------------- store barriers ---------------------------- |
3810 #define __ ideal. |
3810 #define __ ideal. |
3811 |
3811 |
3812 bool GraphKit::use_ReduceInitialCardMarks() { |
3812 bool GraphKit::use_ReduceInitialCardMarks() { |
3813 BarrierSet *bs = Universe::heap()->barrier_set(); |
3813 BarrierSet *bs = Universe::heap()->barrier_set(); |
3814 return bs->is_a(BarrierSet::CardTableModRef) |
3814 return bs->is_a(BarrierSet::CardTableBarrierSet) |
3815 && barrier_set_cast<CardTableModRefBS>(bs)->can_elide_tlab_store_barriers() |
3815 && barrier_set_cast<CardTableBarrierSet>(bs)->can_elide_tlab_store_barriers() |
3816 && ReduceInitialCardMarks; |
3816 && ReduceInitialCardMarks; |
3817 } |
3817 } |
3818 |
3818 |
3819 void GraphKit::sync_kit(IdealKit& ideal) { |
3819 void GraphKit::sync_kit(IdealKit& ideal) { |
3820 set_all_memory(__ merged_memory()); |
3820 set_all_memory(__ merged_memory()); |
3879 |
3879 |
3880 // Convert the pointer to an int prior to doing math on it |
3880 // Convert the pointer to an int prior to doing math on it |
3881 Node* cast = __ CastPX(__ ctrl(), adr); |
3881 Node* cast = __ CastPX(__ ctrl(), adr); |
3882 |
3882 |
3883 // Divide by card size |
3883 // Divide by card size |
3884 assert(Universe::heap()->barrier_set()->is_a(BarrierSet::CardTableModRef), |
3884 assert(Universe::heap()->barrier_set()->is_a(BarrierSet::CardTableBarrierSet), |
3885 "Only one we handle so far."); |
3885 "Only one we handle so far."); |
3886 Node* card_offset = __ URShiftX( cast, __ ConI(CardTable::card_shift) ); |
3886 Node* card_offset = __ URShiftX( cast, __ ConI(CardTable::card_shift) ); |
3887 |
3887 |
3888 // Combine card table base and card offset |
3888 // Combine card table base and card offset |
3889 Node* card_adr = __ AddP(__ top(), byte_map_base_node(), card_offset ); |
3889 Node* card_adr = __ AddP(__ top(), byte_map_base_node(), card_offset ); |
4157 * |
4157 * |
4158 * In the case of slow allocation the allocation code must handle the barrier |
4158 * In the case of slow allocation the allocation code must handle the barrier |
4159 * as part of the allocation in the case the allocated object is not located |
4159 * as part of the allocation in the case the allocated object is not located |
4160 * in the nursery, this would happen for humongous objects. This is similar to |
4160 * in the nursery, this would happen for humongous objects. This is similar to |
4161 * how CMS is required to handle this case, see the comments for the method |
4161 * how CMS is required to handle this case, see the comments for the method |
4162 * CardTableModRefBS::on_allocation_slowpath_exit and OptoRuntime::new_deferred_store_barrier. |
4162 * CardTableBarrierSet::on_allocation_slowpath_exit and OptoRuntime::new_deferred_store_barrier. |
4163 * A deferred card mark is required for these objects and handled in the above |
4163 * A deferred card mark is required for these objects and handled in the above |
4164 * mentioned methods. |
4164 * mentioned methods. |
4165 * |
4165 * |
4166 * Returns true if the post barrier can be removed |
4166 * Returns true if the post barrier can be removed |
4167 */ |
4167 */ |