< prev index next >
src/hotspot/share/gc/shared/oopStorage.inline.hpp
Print this page
rev 50951 : imported patch rename_AllocateList
rev 50952 : imported patch rename_AllocateEntry
rev 50953 : imported patch rename_allocate_entry
rev 50954 : imported patch rename_allocate_list
*** 105,148 ****
inline OopStorage::Block* OopStorage::ActiveArray::at(size_t index) const {
assert(index < _block_count, "precondition");
return *block_ptr(index);
}
! // A Block has an embedded AllocateEntry to provide the links between
! // Blocks in a AllocateList.
! class OopStorage::AllocateEntry {
! friend class OopStorage::AllocateList;
// Members are mutable, and we deal exclusively with pointers to
// const, to make const blocks easier to use; a block being const
// doesn't prevent modifying its list state.
mutable const Block* _prev;
mutable const Block* _next;
// Noncopyable.
! AllocateEntry(const AllocateEntry&);
! AllocateEntry& operator=(const AllocateEntry&);
public:
! AllocateEntry();
! ~AllocateEntry();
};
// Fixed-sized array of oops, plus bookkeeping data.
// All blocks are in the storage's _active_array, at the block's _active_index.
! // Non-full blocks are in the storage's _allocate_list, linked through the
! // block's _allocate_entry. Empty blocks are at the end of that list.
class OopStorage::Block /* No base class, to avoid messing up alignment. */ {
// _data must be the first non-static data member, for alignment.
oop _data[BitsPerWord];
static const unsigned _data_pos = 0; // Position of _data.
volatile uintx _allocated_bitmask; // One bit per _data element.
const OopStorage* _owner;
void* _memory; // Unaligned storage containing block.
size_t _active_index;
! AllocateEntry _allocate_entry;
Block* volatile _deferred_updates_next;
volatile uintx _release_refcount;
Block(const OopStorage* owner, void* memory);
~Block();
--- 105,148 ----
inline OopStorage::Block* OopStorage::ActiveArray::at(size_t index) const {
assert(index < _block_count, "precondition");
return *block_ptr(index);
}
! // A Block has an embedded AllocationListEntry to provide the links between
! // Blocks in a AllocationList.
! class OopStorage::AllocationListEntry {
! friend class OopStorage::AllocationList;
// Members are mutable, and we deal exclusively with pointers to
// const, to make const blocks easier to use; a block being const
// doesn't prevent modifying its list state.
mutable const Block* _prev;
mutable const Block* _next;
// Noncopyable.
! AllocationListEntry(const AllocationListEntry&);
! AllocationListEntry& operator=(const AllocationListEntry&);
public:
! AllocationListEntry();
! ~AllocationListEntry();
};
// Fixed-sized array of oops, plus bookkeeping data.
// All blocks are in the storage's _active_array, at the block's _active_index.
! // Non-full blocks are in the storage's _allocation_list, linked through the
! // block's _allocation_list_entry. Empty blocks are at the end of that list.
class OopStorage::Block /* No base class, to avoid messing up alignment. */ {
// _data must be the first non-static data member, for alignment.
oop _data[BitsPerWord];
static const unsigned _data_pos = 0; // Position of _data.
volatile uintx _allocated_bitmask; // One bit per _data element.
const OopStorage* _owner;
void* _memory; // Unaligned storage containing block.
size_t _active_index;
! AllocationListEntry _allocation_list_entry;
Block* volatile _deferred_updates_next;
volatile uintx _release_refcount;
Block(const OopStorage* owner, void* memory);
~Block();
*** 156,166 ****
// Noncopyable.
Block(const Block&);
Block& operator=(const Block&);
public:
! const AllocateEntry& allocate_entry() const;
static size_t allocation_size();
static size_t allocation_alignment_shift();
oop* get_pointer(unsigned index);
--- 156,166 ----
// Noncopyable.
Block(const Block&);
Block& operator=(const Block&);
public:
! const AllocationListEntry& allocation_list_entry() const;
static size_t allocation_size();
static size_t allocation_alignment_shift();
oop* get_pointer(unsigned index);
*** 195,234 ****
template<typename F> bool iterate(F f);
template<typename F> bool iterate(F f) const;
}; // class Block
! inline OopStorage::Block* OopStorage::AllocateList::head() {
return const_cast<Block*>(_head);
}
! inline OopStorage::Block* OopStorage::AllocateList::tail() {
return const_cast<Block*>(_tail);
}
! inline const OopStorage::Block* OopStorage::AllocateList::chead() const {
return _head;
}
! inline const OopStorage::Block* OopStorage::AllocateList::ctail() const {
return _tail;
}
! inline OopStorage::Block* OopStorage::AllocateList::prev(Block& block) {
! return const_cast<Block*>(block.allocate_entry()._prev);
}
! inline OopStorage::Block* OopStorage::AllocateList::next(Block& block) {
! return const_cast<Block*>(block.allocate_entry()._next);
}
! inline const OopStorage::Block* OopStorage::AllocateList::prev(const Block& block) const {
! return block.allocate_entry()._prev;
}
! inline const OopStorage::Block* OopStorage::AllocateList::next(const Block& block) const {
! return block.allocate_entry()._next;
}
template<typename Closure>
class OopStorage::OopFn {
public:
--- 195,234 ----
template<typename F> bool iterate(F f);
template<typename F> bool iterate(F f) const;
}; // class Block
! inline OopStorage::Block* OopStorage::AllocationList::head() {
return const_cast<Block*>(_head);
}
! inline OopStorage::Block* OopStorage::AllocationList::tail() {
return const_cast<Block*>(_tail);
}
! inline const OopStorage::Block* OopStorage::AllocationList::chead() const {
return _head;
}
! inline const OopStorage::Block* OopStorage::AllocationList::ctail() const {
return _tail;
}
! inline OopStorage::Block* OopStorage::AllocationList::prev(Block& block) {
! return const_cast<Block*>(block.allocation_list_entry()._prev);
}
! inline OopStorage::Block* OopStorage::AllocationList::next(Block& block) {
! return const_cast<Block*>(block.allocation_list_entry()._next);
}
! inline const OopStorage::Block* OopStorage::AllocationList::prev(const Block& block) const {
! return block.allocation_list_entry()._prev;
}
! inline const OopStorage::Block* OopStorage::AllocationList::next(const Block& block) const {
! return block.allocation_list_entry()._next;
}
template<typename Closure>
class OopStorage::OopFn {
public:
*** 296,307 ****
return SkipNullFn<F>(f);
}
// Inline Block accesses for use in iteration loops.
! inline const OopStorage::AllocateEntry& OopStorage::Block::allocate_entry() const {
! return _allocate_entry;
}
inline void OopStorage::Block::check_index(unsigned index) const {
assert(index < ARRAY_SIZE(_data), "Index out of bounds: %u", index);
}
--- 296,307 ----
return SkipNullFn<F>(f);
}
// Inline Block accesses for use in iteration loops.
! inline const OopStorage::AllocationListEntry& OopStorage::Block::allocation_list_entry() const {
! return _allocation_list_entry;
}
inline void OopStorage::Block::check_index(unsigned index) const {
assert(index < ARRAY_SIZE(_data), "Index out of bounds: %u", index);
}
< prev index next >