1 /* 2 * Copyright (c) 2001, 2009, 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 # include "incls/_precompiled.incl" 26 # include "incls/_cardTableRS.cpp.incl" 27 28 CardTableRS::CardTableRS(MemRegion whole_heap, 29 int max_covered_regions) : 30 GenRemSet(), 31 _cur_youngergen_card_val(youngergenP1_card), 32 _regions_to_iterate(max_covered_regions - 1) 33 { 34 #ifndef SERIALGC 35 if (UseG1GC) { 36 _ct_bs = new G1SATBCardTableLoggingModRefBS(whole_heap, 37 max_covered_regions); 38 } else { 39 _ct_bs = new CardTableModRefBSForCTRS(whole_heap, max_covered_regions); 40 } 41 #else 42 _ct_bs = new CardTableModRefBSForCTRS(whole_heap, max_covered_regions); 43 #endif 44 set_bs(_ct_bs); 45 _last_cur_val_in_gen = new jbyte[GenCollectedHeap::max_gens + 1]; 46 if (_last_cur_val_in_gen == NULL) { | 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 #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/java.hpp" 33 #include "runtime/os.hpp" 34 #ifndef SERIALGC 35 #include "gc_implementation/g1/concurrentMark.hpp" 36 #include "gc_implementation/g1/g1SATBCardTableModRefBS.hpp" 37 #endif 38 39 CardTableRS::CardTableRS(MemRegion whole_heap, 40 int max_covered_regions) : 41 GenRemSet(), 42 _cur_youngergen_card_val(youngergenP1_card), 43 _regions_to_iterate(max_covered_regions - 1) 44 { 45 #ifndef SERIALGC 46 if (UseG1GC) { 47 _ct_bs = new G1SATBCardTableLoggingModRefBS(whole_heap, 48 max_covered_regions); 49 } else { 50 _ct_bs = new CardTableModRefBSForCTRS(whole_heap, max_covered_regions); 51 } 52 #else 53 _ct_bs = new CardTableModRefBSForCTRS(whole_heap, max_covered_regions); 54 #endif 55 set_bs(_ct_bs); 56 _last_cur_val_in_gen = new jbyte[GenCollectedHeap::max_gens + 1]; 57 if (_last_cur_val_in_gen == NULL) { |