< prev index next >

src/hotspot/share/gc/g1/g1CardTable.cpp

Print this page




  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 "gc/g1/g1CardTable.hpp"
  27 #include "gc/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc/shared/memset_with_concurrent_readers.hpp"
  29 #include "logging/log.hpp"
  30 #include "runtime/atomic.hpp"
  31 
  32 void G1CardTable::g1_mark_as_young(const MemRegion& mr) {
  33   CardValue *const first = byte_for(mr.start());
  34   CardValue *const last = byte_after(mr.last());
  35 
  36   memset_with_concurrent_readers(first, g1_young_gen, last - first);
  37 }
  38 
  39 #ifndef PRODUCT
  40 void G1CardTable::verify_g1_young_region(MemRegion mr) {
  41   verify_region(mr, g1_young_gen,  true);
  42 }
  43 #endif
  44 
  45 void G1CardTableChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
  46   // Default value for a clean card on the card table is -1. So we cannot take advantage of the zero_filled parameter.
  47   MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_idx), num_regions * HeapRegion::GrainWords);
  48   _card_table->clear(mr);
  49 }
  50 




  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 "gc/g1/g1CardTable.hpp"
  27 #include "gc/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc/shared/memset_with_concurrent_readers.hpp"
  29 #include "logging/log.hpp"

  30 
  31 void G1CardTable::g1_mark_as_young(const MemRegion& mr) {
  32   CardValue *const first = byte_for(mr.start());
  33   CardValue *const last = byte_after(mr.last());
  34 
  35   memset_with_concurrent_readers(first, g1_young_gen, last - first);
  36 }
  37 
  38 #ifndef PRODUCT
  39 void G1CardTable::verify_g1_young_region(MemRegion mr) {
  40   verify_region(mr, g1_young_gen,  true);
  41 }
  42 #endif
  43 
  44 void G1CardTableChangedListener::on_commit(uint start_idx, size_t num_regions, bool zero_filled) {
  45   // Default value for a clean card on the card table is -1. So we cannot take advantage of the zero_filled parameter.
  46   MemRegion mr(G1CollectedHeap::heap()->bottom_addr_for_region(start_idx), num_regions * HeapRegion::GrainWords);
  47   _card_table->clear(mr);
  48 }
  49 


< prev index next >