< prev index next >
src/share/vm/gc/g1/g1AllocRegion.inline.hpp
Print this page
*** 26,39 ****
#define SHARE_VM_GC_G1_G1ALLOCREGION_INLINE_HPP
#include "gc/g1/g1AllocRegion.hpp"
#include "gc/g1/heapRegion.inline.hpp"
inline HeapWord* G1AllocRegion::allocate(HeapRegion* alloc_region,
size_t word_size,
bool bot_updates) {
! assert(alloc_region != NULL, err_msg("pre-condition"));
if (!bot_updates) {
return alloc_region->allocate_no_bot_updates(word_size);
} else {
return alloc_region->allocate(word_size);
--- 26,47 ----
#define SHARE_VM_GC_G1_G1ALLOCREGION_INLINE_HPP
#include "gc/g1/g1AllocRegion.hpp"
#include "gc/g1/heapRegion.inline.hpp"
+ #define G1_ALLOC_REGION_ASSERT(p, message) \
+ do { \
+ assert((p), "[%s] %s c: %u b: %s r: " PTR_FORMAT " u: " SIZE_FORMAT, \
+ _name, (message), _count, BOOL_TO_STR(_bot_updates), \
+ p2i(_alloc_region), _used_bytes_before); \
+ } while (0)
+
+
inline HeapWord* G1AllocRegion::allocate(HeapRegion* alloc_region,
size_t word_size,
bool bot_updates) {
! assert(alloc_region != NULL, "pre-condition");
if (!bot_updates) {
return alloc_region->allocate_no_bot_updates(word_size);
} else {
return alloc_region->allocate(word_size);
*** 48,59 ****
inline HeapWord* G1AllocRegion::par_allocate(HeapRegion* alloc_region,
size_t min_word_size,
size_t desired_word_size,
size_t* actual_word_size,
bool bot_updates) {
! assert(alloc_region != NULL, err_msg("pre-condition"));
! assert(!alloc_region->is_empty(), err_msg("pre-condition"));
if (!bot_updates) {
return alloc_region->par_allocate_no_bot_updates(min_word_size, desired_word_size, actual_word_size);
} else {
return alloc_region->par_allocate(min_word_size, desired_word_size, actual_word_size);
--- 56,67 ----
inline HeapWord* G1AllocRegion::par_allocate(HeapRegion* alloc_region,
size_t min_word_size,
size_t desired_word_size,
size_t* actual_word_size,
bool bot_updates) {
! assert(alloc_region != NULL, "pre-condition");
! assert(!alloc_region->is_empty(), "pre-condition");
if (!bot_updates) {
return alloc_region->par_allocate_no_bot_updates(min_word_size, desired_word_size, actual_word_size);
} else {
return alloc_region->par_allocate(min_word_size, desired_word_size, actual_word_size);
*** 67,80 ****
inline HeapWord* G1AllocRegion::attempt_allocation(size_t min_word_size,
size_t desired_word_size,
size_t* actual_word_size,
bool bot_updates) {
! assert(bot_updates == _bot_updates, ar_ext_msg(this, "pre-condition"));
HeapRegion* alloc_region = _alloc_region;
! assert(alloc_region != NULL, ar_ext_msg(this, "not initialized properly"));
HeapWord* result = par_allocate(alloc_region, min_word_size, desired_word_size, actual_word_size, bot_updates);
if (result != NULL) {
trace("alloc", min_word_size, desired_word_size, *actual_word_size, result);
return result;
--- 75,88 ----
inline HeapWord* G1AllocRegion::attempt_allocation(size_t min_word_size,
size_t desired_word_size,
size_t* actual_word_size,
bool bot_updates) {
! G1_ALLOC_REGION_ASSERT(bot_updates == _bot_updates, "pre-condition");
HeapRegion* alloc_region = _alloc_region;
! G1_ALLOC_REGION_ASSERT(alloc_region != NULL, "not initialized properly");
HeapWord* result = par_allocate(alloc_region, min_word_size, desired_word_size, actual_word_size, bot_updates);
if (result != NULL) {
trace("alloc", min_word_size, desired_word_size, *actual_word_size, result);
return result;
*** 111,122 ****
return NULL;
}
inline HeapWord* G1AllocRegion::attempt_allocation_force(size_t word_size,
bool bot_updates) {
! assert(bot_updates == _bot_updates, ar_ext_msg(this, "pre-condition"));
! assert(_alloc_region != NULL, ar_ext_msg(this, "not initialized properly"));
trace("forcing alloc", word_size, word_size);
HeapWord* result = new_alloc_region_and_allocate(word_size, true /* force */);
if (result != NULL) {
trace("alloc forced", word_size, word_size, word_size, result);
--- 119,130 ----
return NULL;
}
inline HeapWord* G1AllocRegion::attempt_allocation_force(size_t word_size,
bool bot_updates) {
! G1_ALLOC_REGION_ASSERT(bot_updates == _bot_updates, "pre-condition");
! G1_ALLOC_REGION_ASSERT(_alloc_region != NULL, "not initialized properly");
trace("forcing alloc", word_size, word_size);
HeapWord* result = new_alloc_region_and_allocate(word_size, true /* force */);
if (result != NULL) {
trace("alloc forced", word_size, word_size, word_size, result);
< prev index next >