8079330: Circular dependency between G1CollectedHeap and G1BlockOffsetSharedArray

Reviewed-by: tschatzl, mgerdin
This commit is contained in:
Per Lidén 2015-05-05 11:17:12 +02:00
parent 7e9f9f9107
commit e5b7417b04
4 changed files with 19 additions and 17 deletions

@ -24,7 +24,7 @@
#include "precompiled.hpp"
#include "gc_implementation/g1/g1Allocator.hpp"
#include "gc_implementation/g1/g1CollectedHeap.hpp"
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
#include "gc_implementation/g1/g1CollectorPolicy.hpp"
#include "gc_implementation/g1/heapRegion.inline.hpp"
#include "gc_implementation/g1/heapRegionSet.inline.hpp"

@ -23,8 +23,8 @@
*/
#include "precompiled.hpp"
#include "gc_implementation/g1/g1CollectedHeap.hpp"
#include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp"
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
#include "gc_implementation/g1/heapRegion.hpp"
#include "memory/space.hpp"
#include "oops/oop.inline.hpp"
@ -66,6 +66,20 @@ bool G1BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const {
return (delta & right_n_bits(LogN_words)) == (size_t)NoBits;
}
#ifdef ASSERT
void G1BlockOffsetSharedArray::check_index(size_t index, const char* msg) const {
assert((index) < (_reserved.word_size() >> LogN_words),
err_msg("%s - index: "SIZE_FORMAT", _vs.committed_size: "SIZE_FORMAT,
msg, (index), (_reserved.word_size() >> LogN_words)));
assert(G1CollectedHeap::heap()->is_in_exact(address_for_index_raw(index)),
err_msg("Index "SIZE_FORMAT" corresponding to "PTR_FORMAT
" (%u) is not in committed area.",
(index),
p2i(address_for_index_raw(index)),
G1CollectedHeap::heap()->addr_to_region(address_for_index_raw(index))));
}
#endif // ASSERT
//////////////////////////////////////////////////////////////////////
// G1BlockOffsetArray
//////////////////////////////////////////////////////////////////////

@ -170,6 +170,8 @@ private:
bool is_card_boundary(HeapWord* p) const;
void check_index(size_t index, const char* msg) const NOT_DEBUG_RETURN;
public:
// Return the number of slots needed for an offset array

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2015, 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,7 +26,6 @@
#define SHARE_VM_GC_IMPLEMENTATION_G1_G1BLOCKOFFSETTABLE_INLINE_HPP
#include "gc_implementation/g1/g1BlockOffsetTable.hpp"
#include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
#include "gc_implementation/g1/heapRegion.inline.hpp"
#include "memory/space.hpp"
@ -47,17 +46,6 @@ G1BlockOffsetTable::block_start_const(const void* addr) const {
}
}
#define check_index(index, msg) \
assert((index) < (_reserved.word_size() >> LogN_words), \
err_msg("%s - index: "SIZE_FORMAT", _vs.committed_size: "SIZE_FORMAT, \
msg, (index), (_reserved.word_size() >> LogN_words))); \
assert(G1CollectedHeap::heap()->is_in_exact(address_for_index_raw(index)), \
err_msg("Index "SIZE_FORMAT" corresponding to "PTR_FORMAT \
" (%u) is not in committed area.", \
(index), \
p2i(address_for_index_raw(index)), \
G1CollectedHeap::heap()->addr_to_region(address_for_index_raw(index))));
u_char G1BlockOffsetSharedArray::offset_array(size_t index) const {
check_index(index, "index out of range");
return _offset_array[index];
@ -119,8 +107,6 @@ G1BlockOffsetSharedArray::address_for_index(size_t index) const {
return result;
}
#undef check_index
inline size_t
G1BlockOffsetArray::block_size(const HeapWord* p) const {
return gsp()->block_size(p);