< prev index next >

test/hotspot/gtest/gc/g1/test_heapRegion.cpp

Print this page
rev 52821 : [mq]: 8214850-rename-vm_operations


  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 #include "precompiled.hpp"
  25 #include "gc/g1/g1BlockOffsetTable.hpp"
  26 #include "gc/g1/g1CollectedHeap.hpp"
  27 #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
  28 #include "gc/g1/heapRegion.inline.hpp"
  29 #include "gc/shared/referenceProcessor.hpp"
  30 #include "runtime/interfaceSupport.inline.hpp"
  31 #include "runtime/vm_operations.hpp"
  32 #include "runtime/vmThread.hpp"
  33 #include "unittest.hpp"
  34 
  35 class VerifyAndCountMarkClosure : public StackObj {
  36   int _count;
  37   G1CMBitMap* _bm;
  38 
  39   void ensure_marked(HeapWord* addr) {
  40     ASSERT_TRUE(_bm->is_marked(addr));
  41   }
  42 
  43 public:
  44   VerifyAndCountMarkClosure(G1CMBitMap* bm) : _count(0), _bm(bm) { }
  45 
  46   virtual size_t apply(oop object) {
  47     _count++;
  48     ensure_marked((HeapWord*) object);
  49     // Must return positive size to advance the iteration.
  50     return MinObjAlignment;
  51   }




  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 #include "precompiled.hpp"
  25 #include "gc/g1/g1BlockOffsetTable.hpp"
  26 #include "gc/g1/g1CollectedHeap.hpp"
  27 #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp"
  28 #include "gc/g1/heapRegion.inline.hpp"
  29 #include "gc/shared/referenceProcessor.hpp"
  30 #include "runtime/interfaceSupport.inline.hpp"
  31 #include "runtime/vmOperations.hpp"
  32 #include "runtime/vmThread.hpp"
  33 #include "unittest.hpp"
  34 
  35 class VerifyAndCountMarkClosure : public StackObj {
  36   int _count;
  37   G1CMBitMap* _bm;
  38 
  39   void ensure_marked(HeapWord* addr) {
  40     ASSERT_TRUE(_bm->is_marked(addr));
  41   }
  42 
  43 public:
  44   VerifyAndCountMarkClosure(G1CMBitMap* bm) : _count(0), _bm(bm) { }
  45 
  46   virtual size_t apply(oop object) {
  47     _count++;
  48     ensure_marked((HeapWord*) object);
  49     // Must return positive size to advance the iteration.
  50     return MinObjAlignment;
  51   }


< prev index next >