< prev index next >

src/hotspot/share/gc/g1/satbMarkQueue.cpp

G1BarrierSet_merge

22  */                                                                                                                                  
23 
24 #include "precompiled.hpp"                                                                                                           
25 #include "jvm.h"                                                                                                                     
26 #include "gc/g1/g1CollectedHeap.inline.hpp"                                                                                          
27 #include "gc/g1/satbMarkQueue.hpp"                                                                                                   
28 #include "gc/shared/collectedHeap.hpp"                                                                                               
29 #include "memory/allocation.inline.hpp"                                                                                              
30 #include "oops/oop.inline.hpp"                                                                                                       
31 #include "runtime/mutexLocker.hpp"                                                                                                   
32 #include "runtime/safepoint.hpp"                                                                                                     
33 #include "runtime/thread.hpp"                                                                                                        
34 #include "runtime/threadSMR.hpp"                                                                                                     
35 #include "runtime/vmThread.hpp"                                                                                                      
36 
37 SATBMarkQueue::SATBMarkQueue(SATBMarkQueueSet* qset, bool permanent) :                                                               
38   // SATB queues are only active during marking cycles. We create                                                                    
39   // them with their active field set to false. If a thread is                                                                       
40   // created during a cycle and its SATB queue needs to be activated                                                                 
41   // before the thread starts running, we'll need to set its active                                                                  
42   // field to true. This is done in G1SATBCardTableLoggingModRefBS::                                                                 
43   // on_thread_attach().                                                                                                             
44   PtrQueue(qset, permanent, false /* active */)                                                                                      
45 { }                                                                                                                                  
46 
47 void SATBMarkQueue::flush() {                                                                                                        
48   // Filter now to possibly save work later.  If filtering empties the                                                               
49   // buffer then flush_impl can deallocate the buffer.                                                                               
50   filter();                                                                                                                          
51   flush_impl();                                                                                                                      
52 }                                                                                                                                    
53 
54 // Return true if a SATB buffer entry refers to an object that                                                                       
55 // requires marking.                                                                                                                 
56 //                                                                                                                                   
57 // The entry must point into the G1 heap.  In particular, it must not                                                                
58 // be a NULL pointer.  NULL pointers are pre-filtered and never                                                                      
59 // inserted into a SATB buffer.                                                                                                      
60 //                                                                                                                                   
61 // An entry that is below the NTAMS pointer for the containing heap                                                                  
62 // region requires marking. Such an entry must point to a valid object.                                                              

22  */
23 
24 #include "precompiled.hpp"
25 #include "jvm.h"
26 #include "gc/g1/g1CollectedHeap.inline.hpp"
27 #include "gc/g1/satbMarkQueue.hpp"
28 #include "gc/shared/collectedHeap.hpp"
29 #include "memory/allocation.inline.hpp"
30 #include "oops/oop.inline.hpp"
31 #include "runtime/mutexLocker.hpp"
32 #include "runtime/safepoint.hpp"
33 #include "runtime/thread.hpp"
34 #include "runtime/threadSMR.hpp"
35 #include "runtime/vmThread.hpp"
36 
37 SATBMarkQueue::SATBMarkQueue(SATBMarkQueueSet* qset, bool permanent) :
38   // SATB queues are only active during marking cycles. We create
39   // them with their active field set to false. If a thread is
40   // created during a cycle and its SATB queue needs to be activated
41   // before the thread starts running, we'll need to set its active
42   // field to true. This is done in G1SBarrierSet::on_thread_attach().

43   PtrQueue(qset, permanent, false /* active */)
44 { }
45 
46 void SATBMarkQueue::flush() {
47   // Filter now to possibly save work later.  If filtering empties the
48   // buffer then flush_impl can deallocate the buffer.
49   filter();
50   flush_impl();
51 }
52 
53 // Return true if a SATB buffer entry refers to an object that
54 // requires marking.
55 //
56 // The entry must point into the G1 heap.  In particular, it must not
57 // be a NULL pointer.  NULL pointers are pre-filtered and never
58 // inserted into a SATB buffer.
59 //
60 // An entry that is below the NTAMS pointer for the containing heap
61 // region requires marking. Such an entry must point to a valid object.
< prev index next >