< prev index next >

src/hotspot/share/gc/shared/cardTableModRefBSForCTRS.hpp

RFE_8195103_reduce_initial_card_marks

0 /*                                                                                                                         
1  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.                                            
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.                                                           
3  *                                                                                                                         
4  * This code is free software; you can redistribute it and/or modify it                                                    
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.                                                                                                              

0 /*
1  * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3  *
4  * This code is free software; you can redistribute it and/or modify it
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.

24 #ifndef SHARE_VM_GC_SHARED_CARDTABLEMODREFBSFORCTRS_HPP                                                                    
25 #define SHARE_VM_GC_SHARED_CARDTABLEMODREFBSFORCTRS_HPP                                                                    
26 
27 #include "gc/shared/cardTableModRefBS.hpp"                                                                                 
28 
29 class CardTableRS;                                                                                                         
30 class DirtyCardToOopClosure;                                                                                               
31 class OopsInGenClosure;                                                                                                    
32 
33 // A specialization for the CardTableRS gen rem set.                                                                       
34 class CardTableModRefBSForCTRS: public CardTableModRefBS {                                                                 
35   friend class CardTableRS;                                                                                                
36 
37 public:                                                                                                                    
38   CardTableModRefBSForCTRS(MemRegion whole_heap);                                                                          
39   ~CardTableModRefBSForCTRS();                                                                                             
40 
41   virtual void initialize();                                                                                               
42 
43   void set_CTRS(CardTableRS* rs) { _rs = rs; }                                                                             
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
                                                                                                                           
44 
45 private:                                                                                                                   
46   CardTableRS* _rs;                                                                                                        
47 
48   // *** Support for parallel card scanning.                                                                               
49 
50   // dirty and precleaned are equivalent wrt younger_refs_iter.                                                            
51   static bool card_is_dirty_wrt_gen_iter(jbyte cv) {                                                                       
52     return cv == dirty_card || cv == precleaned_card;                                                                      
53   }                                                                                                                        
54 
55   // Returns "true" iff the value "cv" will cause the card containing it                                                   
56   // to be scanned in the current traversal.  May be overridden by                                                         
57   // subtypes.                                                                                                             
58   bool card_will_be_scanned(jbyte cv);                                                                                     
59 
60   // Returns "true" iff the value "cv" may have represented a dirty card at                                                
61   // some point.                                                                                                           
62   bool card_may_have_been_dirty(jbyte cv);                                                                                 

24 #ifndef SHARE_VM_GC_SHARED_CARDTABLEMODREFBSFORCTRS_HPP
25 #define SHARE_VM_GC_SHARED_CARDTABLEMODREFBSFORCTRS_HPP
26 
27 #include "gc/shared/cardTableModRefBS.hpp"
28 
29 class CardTableRS;
30 class DirtyCardToOopClosure;
31 class OopsInGenClosure;
32 
33 // A specialization for the CardTableRS gen rem set.
34 class CardTableModRefBSForCTRS: public CardTableModRefBS {
35   friend class CardTableRS;
36 
37 public:
38   CardTableModRefBSForCTRS(MemRegion whole_heap);
39   ~CardTableModRefBSForCTRS();
40 
41   virtual void initialize();
42 
43   void set_CTRS(CardTableRS* rs) { _rs = rs; }
44 
45   virtual bool card_mark_must_follow_store() const {
46     return UseConcMarkSweepGC;
47   }
48 
49   virtual bool is_in_young(oop obj) const;
50 
51 private:
52   CardTableRS* _rs;
53 
54   // *** Support for parallel card scanning.
55 
56   // dirty and precleaned are equivalent wrt younger_refs_iter.
57   static bool card_is_dirty_wrt_gen_iter(jbyte cv) {
58     return cv == dirty_card || cv == precleaned_card;
59   }
60 
61   // Returns "true" iff the value "cv" will cause the card containing it
62   // to be scanned in the current traversal.  May be overridden by
63   // subtypes.
64   bool card_will_be_scanned(jbyte cv);
65 
66   // Returns "true" iff the value "cv" may have represented a dirty card at
67   // some point.
68   bool card_may_have_been_dirty(jbyte cv);
< prev index next >