src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.inline.hpp
changeset 51578 31b159f30fb2
parent 47885 5caa1d5f74c1
child 53244 9807daeb47c4
--- a/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.inline.hpp	Wed Aug 29 19:48:28 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1ConcurrentMarkBitMap.inline.hpp	Wed Aug 29 20:15:09 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,6 +26,7 @@
 #define SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_INLINE_HPP
 
 #include "gc/g1/g1ConcurrentMarkBitMap.hpp"
+#include "gc/shared/markBitMap.inline.hpp"
 #include "memory/memRegion.hpp"
 #include "utilities/align.hpp"
 #include "utilities/bitMap.inline.hpp"
@@ -50,49 +51,4 @@
   return true;
 }
 
-inline HeapWord* G1CMBitMap::get_next_marked_addr(const HeapWord* addr,
-                                                  const HeapWord* limit) const {
-  assert(limit != NULL, "limit must not be NULL");
-  // Round addr up to a possible object boundary to be safe.
-  size_t const addr_offset = addr_to_offset(align_up(addr, HeapWordSize << _shifter));
-  size_t const limit_offset = addr_to_offset(limit);
-  size_t const nextOffset = _bm.get_next_one_offset(addr_offset, limit_offset);
-  return offset_to_addr(nextOffset);
-}
-
-#ifdef ASSERT
-inline void G1CMBitMap::check_mark(HeapWord* addr) {
-  assert(G1CollectedHeap::heap()->is_in_exact(addr),
-         "Trying to access bitmap " PTR_FORMAT " for address " PTR_FORMAT " not in the heap.",
-         p2i(this), p2i(addr));
-}
-#endif
-
-inline void G1CMBitMap::mark(HeapWord* addr) {
-  check_mark(addr);
-  _bm.set_bit(addr_to_offset(addr));
-}
-
-inline void G1CMBitMap::clear(HeapWord* addr) {
-  check_mark(addr);
-  _bm.clear_bit(addr_to_offset(addr));
-}
-
-inline bool G1CMBitMap::par_mark(HeapWord* addr) {
-  check_mark(addr);
-  return _bm.par_set_bit(addr_to_offset(addr));
-}
-
-inline bool G1CMBitMap::par_mark(oop obj) {
-  return par_mark((HeapWord*) obj);
-}
-
-inline bool G1CMBitMap::is_marked(oop obj) const{
-  return is_marked((HeapWord*) obj);
-}
-
-inline void G1CMBitMap::clear(oop obj) {
-  clear((HeapWord*) obj);
-}
-
 #endif // SHARE_VM_GC_G1_G1CONCURRENTMARKBITMAP_INLINE_HPP