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 #if INCLUDE_ALL_GCS
42 guarantee(!UseG1GC, "sanity");
43 #endif
44 _ct_bs = new CardTableModRefBSForCTRS(whole_heap);
45 _ct_bs->initialize();
46 set_bs(_ct_bs);
47 _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, GenCollectedHeap::max_gens + 1,
48 mtGC, CURRENT_PC, AllocFailStrategy::RETURN_NULL);
49 if (_last_cur_val_in_gen == NULL) {
50 vm_exit_during_initialization("Could not create last_cur_val_in_gen array.");
51 }
52 for (int i = 0; i < GenCollectedHeap::max_gens + 1; i++) {
53 _last_cur_val_in_gen[i] = clean_card_val();
54 }
55 _ct_bs->set_CTRS(this);
56 }
57
58 CardTableRS::~CardTableRS() {
59 if (_ct_bs) {
60 delete _ct_bs;
61 _ct_bs = NULL;
62 }
63 if (_last_cur_val_in_gen) {
64 FREE_C_HEAP_ARRAY(jbyte, _last_cur_val_in_gen);
|