1 /*
2 * Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 class Space;
26 class OopsInGenClosure;
27 class DirtyCardToOopClosure;
28
29 // This kind of "GenRemSet" uses a card table both as shared data structure
30 // for a mod ref barrier set and for the rem set information.
31
32 class CardTableRS: public GenRemSet {
33 friend class VMStructs;
34 // Below are private classes used in impl.
35 friend class VerifyCTSpaceClosure;
36 friend class ClearNoncleanCardWrapper;
37
38 static jbyte clean_card_val() {
39 return CardTableModRefBS::clean_card;
40 }
41
42 static bool
43 card_is_dirty_wrt_gen_iter(jbyte cv) {
44 return CardTableModRefBS::card_is_dirty_wrt_gen_iter(cv);
141 static uintx ct_max_alignment_constraint() {
142 return CardTableModRefBS::ct_max_alignment_constraint();
143 }
144
145 jbyte* byte_for(void* p) { return _ct_bs->byte_for(p); }
146 jbyte* byte_after(void* p) { return _ct_bs->byte_after(p); }
147 HeapWord* addr_for(jbyte* p) { return _ct_bs->addr_for(p); }
148
149 bool is_prev_nonclean_card_val(jbyte v) {
150 return
151 youngergen_card <= v &&
152 v <= cur_youngergen_and_prev_nonclean_card &&
153 v != _cur_youngergen_card_val;
154 }
155
156 static bool youngergen_may_have_been_dirty(jbyte cv) {
157 return cv == CardTableRS::cur_youngergen_and_prev_nonclean_card;
158 }
159
160 };
|
1 /*
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_MEMORY_CARDTABLERS_HPP
26 #define SHARE_VM_MEMORY_CARDTABLERS_HPP
27
28 #include "memory/cardTableModRefBS.hpp"
29 #include "memory/genRemSet.hpp"
30 #include "memory/memRegion.hpp"
31
32 class Space;
33 class OopsInGenClosure;
34 class DirtyCardToOopClosure;
35
36 // This kind of "GenRemSet" uses a card table both as shared data structure
37 // for a mod ref barrier set and for the rem set information.
38
39 class CardTableRS: public GenRemSet {
40 friend class VMStructs;
41 // Below are private classes used in impl.
42 friend class VerifyCTSpaceClosure;
43 friend class ClearNoncleanCardWrapper;
44
45 static jbyte clean_card_val() {
46 return CardTableModRefBS::clean_card;
47 }
48
49 static bool
50 card_is_dirty_wrt_gen_iter(jbyte cv) {
51 return CardTableModRefBS::card_is_dirty_wrt_gen_iter(cv);
148 static uintx ct_max_alignment_constraint() {
149 return CardTableModRefBS::ct_max_alignment_constraint();
150 }
151
152 jbyte* byte_for(void* p) { return _ct_bs->byte_for(p); }
153 jbyte* byte_after(void* p) { return _ct_bs->byte_after(p); }
154 HeapWord* addr_for(jbyte* p) { return _ct_bs->addr_for(p); }
155
156 bool is_prev_nonclean_card_val(jbyte v) {
157 return
158 youngergen_card <= v &&
159 v <= cur_youngergen_and_prev_nonclean_card &&
160 v != _cur_youngergen_card_val;
161 }
162
163 static bool youngergen_may_have_been_dirty(jbyte cv) {
164 return cv == CardTableRS::cur_youngergen_and_prev_nonclean_card;
165 }
166
167 };
168
169 #endif // SHARE_VM_MEMORY_CARDTABLERS_HPP
|