< prev index next >

src/hotspot/share/gc/shared/cardTableModRefBS.cpp

8198949_arraycopy

5  * under the terms of the GNU General Public License version 2 only, as                                                              
6  * published by the Free Software Foundation.                                                                                        
7  *                                                                                                                                   
8  * This code is distributed in the hope that it will be useful, but WITHOUT                                                          
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or                                                             
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License                                                             
11  * version 2 for more details (a copy is included in the LICENSE file that                                                           
12  * accompanied this code).                                                                                                           
13  *                                                                                                                                   
14  * You should have received a copy of the GNU General Public License version                                                         
15  * 2 along with this work; if not, write to the Free Software Foundation,                                                            
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.                                                                     
17  *                                                                                                                                   
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA                                                           
19  * or visit www.oracle.com if you need additional information or have any                                                            
20  * questions.                                                                                                                        
21  *                                                                                                                                   
22  */                                                                                                                                  
23 
24 #include "precompiled.hpp"                                                                                                           
                                                                                                                                     
25 #include "gc/shared/cardTableModRefBS.inline.hpp"                                                                                    
26 #include "gc/shared/collectedHeap.hpp"                                                                                               
27 #include "gc/shared/genCollectedHeap.hpp"                                                                                            
28 #include "gc/shared/space.inline.hpp"                                                                                                
29 #include "logging/log.hpp"                                                                                                           
30 #include "memory/virtualspace.hpp"                                                                                                   
31 #include "oops/oop.inline.hpp"                                                                                                       
32 #include "runtime/thread.hpp"                                                                                                        
33 #include "services/memTracker.hpp"                                                                                                   
34 #include "utilities/align.hpp"                                                                                                       
35 #include "utilities/macros.hpp"                                                                                                      
36 
37 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and                                                                  
38 // enumerate ref fields that have been modified (since the last                                                                      
39 // enumeration.)                                                                                                                     
40 
41 CardTableModRefBS::CardTableModRefBS(                                                                                                
42   CardTable* card_table,                                                                                                             
43   const BarrierSet::FakeRtti& fake_rtti) :                                                                                           
44   ModRefBarrierSet(fake_rtti.add_tag(BarrierSet::CardTableModRef)),                                                                  
45   _defer_initial_card_mark(false),                                                                                                   
46   _card_table(card_table)                                                                                                            
47 {}                                                                                                                                   
48 
49 CardTableModRefBS::CardTableModRefBS(CardTable* card_table) :                                                                        
50   ModRefBarrierSet(BarrierSet::FakeRtti(BarrierSet::CardTableModRef)),                                                               
51   _defer_initial_card_mark(false),                                                                                                   
52   _card_table(card_table)                                                                                                            
53 {}                                                                                                                                   
54 
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
                                                                                                                                     
55 void CardTableModRefBS::initialize() {                                                                                               
                                                                                                                                     
56   initialize_deferred_card_mark_barriers();                                                                                          
57 }                                                                                                                                    
58 
59 CardTableModRefBS::~CardTableModRefBS() {                                                                                            
60   delete _card_table;                                                                                                                
61 }                                                                                                                                    
62 
63 void CardTableModRefBS::write_ref_array_work(MemRegion mr) {                                                                         
64   _card_table->dirty_MemRegion(mr);                                                                                                  
65 }                                                                                                                                    
66 
67 void CardTableModRefBS::invalidate(MemRegion mr) {                                                                                   
68   _card_table->invalidate(mr);                                                                                                       
69 }                                                                                                                                    
70 
71 void CardTableModRefBS::print_on(outputStream* st) const {                                                                           
72   _card_table->print_on(st);                                                                                                         
73 }                                                                                                                                    
74 

5  * under the terms of the GNU General Public License version 2 only, as
6  * published by the Free Software Foundation.
7  *
8  * This code is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * version 2 for more details (a copy is included in the LICENSE file that
12  * accompanied this code).
13  *
14  * You should have received a copy of the GNU General Public License version
15  * 2 along with this work; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19  * or visit www.oracle.com if you need additional information or have any
20  * questions.
21  *
22  */
23 
24 #include "precompiled.hpp"
25 #include "gc/shared/cardTableModRefBSCodeGen.hpp"
26 #include "gc/shared/cardTableModRefBS.inline.hpp"
27 #include "gc/shared/collectedHeap.hpp"
28 #include "gc/shared/genCollectedHeap.hpp"
29 #include "gc/shared/space.inline.hpp"
30 #include "logging/log.hpp"
31 #include "memory/virtualspace.hpp"
32 #include "oops/oop.inline.hpp"
33 #include "runtime/thread.hpp"
34 #include "services/memTracker.hpp"
35 #include "utilities/align.hpp"
36 #include "utilities/macros.hpp"
37 
38 // This kind of "BarrierSet" allows a "CollectedHeap" to detect and
39 // enumerate ref fields that have been modified (since the last
40 // enumeration.)
41 
42 CardTableModRefBS::CardTableModRefBS(
43   CardTable* card_table,
44   const BarrierSet::FakeRtti& fake_rtti) :
45   ModRefBarrierSet(fake_rtti.add_tag(BarrierSet::CardTableModRef)),
46   _defer_initial_card_mark(false),
47   _card_table(card_table)
48 {}
49 
50 CardTableModRefBS::CardTableModRefBS(CardTable* card_table) :
51   ModRefBarrierSet(BarrierSet::FakeRtti(BarrierSet::CardTableModRef)),
52   _defer_initial_card_mark(false),
53   _card_table(card_table)
54 {}
55 
56 BarrierSetCodeGen* CardTableModRefBS::make_code_gen() {
57   return new CardTableModRefBSCodeGen();
58 }
59 
60 void CardTableModRefBS::initialize() {
61   ModRefBarrierSet::initialize();
62   initialize_deferred_card_mark_barriers();
63 }
64 
65 CardTableModRefBS::~CardTableModRefBS() {
66   delete _card_table;
67 }
68 
69 void CardTableModRefBS::write_ref_array_work(MemRegion mr) {
70   _card_table->dirty_MemRegion(mr);
71 }
72 
73 void CardTableModRefBS::invalidate(MemRegion mr) {
74   _card_table->invalidate(mr);
75 }
76 
77 void CardTableModRefBS::print_on(outputStream* st) const {
78   _card_table->print_on(st);
79 }
80 
< prev index next >