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_GC_IMPLEMENTATION_G1_G1HOTCARDCACHE_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1HOTCARDCACHE_HPP
27
28 #include "gc_implementation/g1/g1_globals.hpp"
29 #include "gc_implementation/g1/g1CardCounts.hpp"
30 #include "memory/allocation.hpp"
31 #include "runtime/safepoint.hpp"
32 #include "runtime/thread.hpp"
33 #include "utilities/globalDefinitions.hpp"
34
35 class DirtyCardQueue;
36 class G1CollectedHeap;
37 class G1RemSet;
38 class HeapRegion;
39
40 // An evicting cache of cards that have been logged by the G1 post
41 // write barrier. Placing a card in the cache delays the refinement
42 // of the card until the card is evicted, or the cache is drained
43 // during the next evacuation pause.
44 //
45 // The first thing the G1 post write barrier does is to check whether
46 // the card containing the updated pointer is already dirty and, if
47 // so, skips the remaining code in the barrier.
48 //
49 // Delaying the refinement of a card will make the card fail the
128 reset_hot_cache_internal();
129 }
130 }
131
132 // Zeros the values in the card counts table for entire committed heap
133 void reset_card_counts();
134
135 // Zeros the values in the card counts table for the given region
136 void reset_card_counts(HeapRegion* hr);
137
138 private:
139 void reset_hot_cache_internal() {
140 assert(_hot_cache != NULL, "Logic");
141 _hot_cache_idx = 0;
142 for (size_t i = 0; i < _hot_cache_size; i++) {
143 _hot_cache[i] = NULL;
144 }
145 }
146 };
147
148 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1HOTCARDCACHE_HPP
|
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_GC_G1_G1HOTCARDCACHE_HPP
26 #define SHARE_VM_GC_G1_G1HOTCARDCACHE_HPP
27
28 #include "gc/g1/g1CardCounts.hpp"
29 #include "gc/g1/g1_globals.hpp"
30 #include "memory/allocation.hpp"
31 #include "runtime/safepoint.hpp"
32 #include "runtime/thread.hpp"
33 #include "utilities/globalDefinitions.hpp"
34
35 class DirtyCardQueue;
36 class G1CollectedHeap;
37 class G1RemSet;
38 class HeapRegion;
39
40 // An evicting cache of cards that have been logged by the G1 post
41 // write barrier. Placing a card in the cache delays the refinement
42 // of the card until the card is evicted, or the cache is drained
43 // during the next evacuation pause.
44 //
45 // The first thing the G1 post write barrier does is to check whether
46 // the card containing the updated pointer is already dirty and, if
47 // so, skips the remaining code in the barrier.
48 //
49 // Delaying the refinement of a card will make the card fail the
128 reset_hot_cache_internal();
129 }
130 }
131
132 // Zeros the values in the card counts table for entire committed heap
133 void reset_card_counts();
134
135 // Zeros the values in the card counts table for the given region
136 void reset_card_counts(HeapRegion* hr);
137
138 private:
139 void reset_hot_cache_internal() {
140 assert(_hot_cache != NULL, "Logic");
141 _hot_cache_idx = 0;
142 for (size_t i = 0; i < _hot_cache_size; i++) {
143 _hot_cache[i] = NULL;
144 }
145 }
146 };
147
148 #endif // SHARE_VM_GC_G1_G1HOTCARDCACHE_HPP
|