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 #include "precompiled.hpp"
26 #include "memory/allocation.inline.hpp"
27 #include "memory/cardTableRS.hpp"
28 #include "memory/genCollectedHeap.hpp"
29 #include "memory/generation.hpp"
30 #include "memory/space.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "runtime/atomic.inline.hpp"
33 #include "runtime/java.hpp"
34 #include "runtime/os.hpp"
35 #include "utilities/macros.hpp"
36 #if INCLUDE_ALL_GCS
37 #include "gc_implementation/g1/concurrentMark.hpp"
38 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp"
39 #endif // INCLUDE_ALL_GCS
40
41 CardTableRS::CardTableRS(MemRegion whole_heap) :
42 GenRemSet(),
43 _cur_youngergen_card_val(youngergenP1_card)
44 {
45 #if INCLUDE_ALL_GCS
46 if (UseG1GC) {
47 _ct_bs = new G1SATBCardTableLoggingModRefBS(whole_heap);
48 } else {
49 _ct_bs = new CardTableModRefBSForCTRS(whole_heap);
50 }
51 #else
52 _ct_bs = new CardTableModRefBSForCTRS(whole_heap);
53 #endif
54 _ct_bs->initialize();
55 set_bs(_ct_bs);
56 _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, GenCollectedHeap::max_gens + 1,
57 mtGC, CURRENT_PC, AllocFailStrategy::RETURN_NULL);
58 if (_last_cur_val_in_gen == NULL) {
59 vm_exit_during_initialization("Could not create last_cur_val_in_gen array.");
60 }
61 for (int i = 0; i < GenCollectedHeap::max_gens + 1; i++) {
62 _last_cur_val_in_gen[i] = clean_card_val();
63 }
64 _ct_bs->set_CTRS(this);
65 }
66
67 CardTableRS::~CardTableRS() {
68 if (_ct_bs) {
69 delete _ct_bs;
70 _ct_bs = NULL;
71 }
72 if (_last_cur_val_in_gen) {
73 FREE_C_HEAP_ARRAY(jbyte, _last_cur_val_in_gen);
|
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 #include "precompiled.hpp"
26 #include "memory/allocation.inline.hpp"
27 #include "memory/cardTableRS.hpp"
28 #include "memory/genCollectedHeap.hpp"
29 #include "memory/generation.hpp"
30 #include "memory/space.hpp"
31 #include "oops/oop.inline.hpp"
32 #include "runtime/atomic.inline.hpp"
33 #include "runtime/java.hpp"
34 #include "runtime/os.hpp"
35 #include "utilities/macros.hpp"
36
37 CardTableRS::CardTableRS(MemRegion whole_heap) :
38 GenRemSet(),
39 _cur_youngergen_card_val(youngergenP1_card)
40 {
41 guarantee(UseSerialGC || UseConcMarkSweepGC, "sanity");
42 _ct_bs = new CardTableModRefBSForCTRS(whole_heap);
43 _ct_bs->initialize();
44 set_bs(_ct_bs);
45 _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, GenCollectedHeap::max_gens + 1,
46 mtGC, CURRENT_PC, AllocFailStrategy::RETURN_NULL);
47 if (_last_cur_val_in_gen == NULL) {
48 vm_exit_during_initialization("Could not create last_cur_val_in_gen array.");
49 }
50 for (int i = 0; i < GenCollectedHeap::max_gens + 1; i++) {
51 _last_cur_val_in_gen[i] = clean_card_val();
52 }
53 _ct_bs->set_CTRS(this);
54 }
55
56 CardTableRS::~CardTableRS() {
57 if (_ct_bs) {
58 delete _ct_bs;
59 _ct_bs = NULL;
60 }
61 if (_last_cur_val_in_gen) {
62 FREE_C_HEAP_ARRAY(jbyte, _last_cur_val_in_gen);
|