Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
// Does store cross heap regions?

__ eor(tmp1, store_addr, new_val);
__ lsr(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes);
__ lsr(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes);
__ cbz(tmp1, done);

// crosses regions, storing null?
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
// Does store cross heap regions?

__ eor(tmp1, store_addr, new_val);
__ movs(tmp1, AsmOperand(tmp1, lsr, HeapRegion::LogOfHRGrainBytes));
__ movs(tmp1, AsmOperand(tmp1, lsr, G1HeapRegion::LogOfHRGrainBytes));
__ b(done, eq);

// crosses regions, storing null?
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato

// Does store cross heap regions?
__ xorr(tmp1, store_addr, new_val);
__ srdi_(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes);
__ srdi_(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes);
__ beq(CCR0, filtered);

// Crosses regions, storing null?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
// Does store cross heap regions?

__ xorr(tmp1, store_addr, new_val);
__ srli(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes);
__ srli(tmp1, tmp1, G1HeapRegion::LogOfHRGrainBytes);
__ beqz(tmp1, done);

// crosses regions, storing null?
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato
__ z_lgr(Rtmp1, Rstore_addr);
__ z_xgr(Rtmp1, Rnew_val);
}
__ z_srag(Rtmp1, Rtmp1, HeapRegion::LogOfHRGrainBytes);
__ z_srag(Rtmp1, Rtmp1, G1HeapRegion::LogOfHRGrainBytes);
__ z_bre(filtered);

// Crosses regions, storing null?
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,

__ movptr(tmp, store_addr);
__ xorptr(tmp, new_val);
__ shrptr(tmp, HeapRegion::LogOfHRGrainBytes);
__ shrptr(tmp, G1HeapRegion::LogOfHRGrainBytes);
__ jcc(Assembler::equal, done);

// crosses regions, storing null?
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/cds/archiveHeapWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void ArchiveHeapWriter::init() {
_source_objs = new GrowableArrayCHeap<oop, mtClassShared>(10000);

guarantee(UseG1GC, "implementation limitation");
guarantee(MIN_GC_REGION_ALIGNMENT <= /*G1*/HeapRegion::min_region_size_in_words() * HeapWordSize, "must be");
guarantee(MIN_GC_REGION_ALIGNMENT <= G1HeapRegion::min_region_size_in_words() * HeapWordSize, "must be");
}
}

Expand Down Expand Up @@ -439,7 +439,7 @@ void ArchiveHeapWriter::set_requested_address(ArchiveHeapInfo* info) {


if (UseCompressedOops) {
_requested_bottom = align_down(heap_end - heap_region_byte_size, HeapRegion::GrainBytes);
_requested_bottom = align_down(heap_end - heap_region_byte_size, G1HeapRegion::GrainBytes);
} else {
// We always write the objects as if the heap started at this address. This
// makes the contents of the archive heap deterministic.
Expand All @@ -449,7 +449,7 @@ void ArchiveHeapWriter::set_requested_address(ArchiveHeapInfo* info) {
_requested_bottom = (address)NOCOOPS_REQUESTED_BASE;
}

assert(is_aligned(_requested_bottom, HeapRegion::GrainBytes), "sanity");
assert(is_aligned(_requested_bottom, G1HeapRegion::GrainBytes), "sanity");

_requested_top = _requested_bottom + _buffer_used;

Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/cds/filemap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,8 +2064,8 @@ bool FileMapInfo::can_use_heap_region() {
archive_narrow_klass_shift);
log_info(cds)(" narrow_oop_mode = %d, narrow_oop_base = " PTR_FORMAT ", narrow_oop_shift = %d",
narrow_oop_mode(), p2i(narrow_oop_base()), narrow_oop_shift());
log_info(cds)("The current max heap size = " SIZE_FORMAT "M, HeapRegion::GrainBytes = " SIZE_FORMAT,
MaxHeapSize/M, HeapRegion::GrainBytes);
log_info(cds)("The current max heap size = " SIZE_FORMAT "M, G1HeapRegion::GrainBytes = " SIZE_FORMAT,
MaxHeapSize/M, G1HeapRegion::GrainBytes);
log_info(cds)(" narrow_klass_base = " PTR_FORMAT ", narrow_klass_shift = %d",
p2i(CompressedKlassPointers::base()), CompressedKlassPointers::shift());
log_info(cds)(" narrow_oop_mode = %d, narrow_oop_base = " PTR_FORMAT ", narrow_oop_shift = %d",
Expand Down Expand Up @@ -2130,7 +2130,7 @@ bool FileMapInfo::map_heap_region() {
#ifdef ASSERT
// The "old" regions must be parsable -- we cannot have any unused space
// at the start of the lowest G1 region that contains archived objects.
assert(is_aligned(_mapped_heap_memregion.start(), HeapRegion::GrainBytes), "must be");
assert(is_aligned(_mapped_heap_memregion.start(), G1HeapRegion::GrainBytes), "must be");

// Make sure we map at the very top of the heap - see comments in
// init_heap_region_relocation().
Expand All @@ -2140,7 +2140,7 @@ bool FileMapInfo::map_heap_region() {
address heap_end = (address)heap_range.end();
address mapped_heap_region_end = (address)_mapped_heap_memregion.end();
assert(heap_end >= mapped_heap_region_end, "must be");
assert(heap_end - mapped_heap_region_end < (intx)(HeapRegion::GrainBytes),
assert(heap_end - mapped_heap_region_end < (intx)(G1HeapRegion::GrainBytes),
"must be at the top of the heap to avoid fragmentation");
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ void G1BarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Opr new_v
__ logical_xor(xor_res, new_val, xor_res);
__ move(xor_res, xor_shift_res);
__ unsigned_shift_right(xor_shift_res,
LIR_OprFact::intConst(checked_cast<jint>(HeapRegion::LogOfHRGrainBytes)),
LIR_OprFact::intConst(checked_cast<jint>(G1HeapRegion::LogOfHRGrainBytes)),
xor_shift_res,
LIR_Opr::illegalOpr());
} else {
__ logical_xor(addr, new_val, xor_res);
__ unsigned_shift_right(xor_res,
LIR_OprFact::intConst(checked_cast<jint>(HeapRegion::LogOfHRGrainBytes)),
LIR_OprFact::intConst(checked_cast<jint>(G1HeapRegion::LogOfHRGrainBytes)),
xor_shift_res,
LIR_Opr::illegalOpr());
}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,8 @@ void G1BarrierSetC2::post_barrier(GraphKit* kit,

// Should be able to do an unsigned compare of region_size instead of
// and extra shift. Do we have an unsigned compare??
// Node* region_size = __ ConI(1 << HeapRegion::LogOfHRGrainBytes);
Node* xor_res = __ URShiftX ( __ XorX( cast, __ CastPX(__ ctrl(), val)), __ ConI(checked_cast<jint>(HeapRegion::LogOfHRGrainBytes)));
// Node* region_size = __ ConI(1 << G1HeapRegion::LogOfHRGrainBytes);
Node* xor_res = __ URShiftX ( __ XorX( cast, __ CastPX(__ ctrl(), val)), __ ConI(checked_cast<jint>(G1HeapRegion::LogOfHRGrainBytes)));

// if (xor_res == 0) same region so skip
__ if_then(xor_res, BoolTest::ne, zeroX, likely); {
Expand Down
42 changes: 21 additions & 21 deletions src/hotspot/share/gc/g1/g1AllocRegion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
#include "utilities/align.hpp"

G1CollectedHeap* G1AllocRegion::_g1h = nullptr;
HeapRegion* G1AllocRegion::_dummy_region = nullptr;
G1HeapRegion* G1AllocRegion::_dummy_region = nullptr;

void G1AllocRegion::setup(G1CollectedHeap* g1h, HeapRegion* dummy_region) {
void G1AllocRegion::setup(G1CollectedHeap* g1h, G1HeapRegion* dummy_region) {
assert(_dummy_region == nullptr, "should be set once");
assert(dummy_region != nullptr, "pre-condition");
assert(dummy_region->free() == 0, "pre-condition");
Expand All @@ -50,7 +50,7 @@ void G1AllocRegion::setup(G1CollectedHeap* g1h, HeapRegion* dummy_region) {
_dummy_region = dummy_region;
}

size_t G1AllocRegion::fill_up_remaining_space(HeapRegion* alloc_region) {
size_t G1AllocRegion::fill_up_remaining_space(G1HeapRegion* alloc_region) {
assert(alloc_region != nullptr && alloc_region != _dummy_region,
"pre-condition");
size_t result = 0;
Expand Down Expand Up @@ -94,7 +94,7 @@ size_t G1AllocRegion::fill_up_remaining_space(HeapRegion* alloc_region) {
return result;
}

size_t G1AllocRegion::retire_internal(HeapRegion* alloc_region, bool fill_up) {
size_t G1AllocRegion::retire_internal(G1HeapRegion* alloc_region, bool fill_up) {
// We never have to check whether the active region is empty or not,
// and potentially free it if it is, given that it's guaranteed that
// it will never be empty.
Expand All @@ -120,7 +120,7 @@ size_t G1AllocRegion::retire(bool fill_up) {
size_t waste = 0;

trace("retiring");
HeapRegion* alloc_region = _alloc_region;
G1HeapRegion* alloc_region = _alloc_region;
if (alloc_region != _dummy_region) {
waste = retire_internal(alloc_region, fill_up);
reset_alloc_region();
Expand All @@ -135,7 +135,7 @@ HeapWord* G1AllocRegion::new_alloc_region_and_allocate(size_t word_size) {
assert_alloc_region(_used_bytes_before == 0, "pre-condition");

trace("attempting region allocation");
HeapRegion* new_alloc_region = allocate_new_region(word_size);
G1HeapRegion* new_alloc_region = allocate_new_region(word_size);
if (new_alloc_region != nullptr) {
new_alloc_region->reset_pre_dummy_top();
// Need to do this before the allocation
Expand Down Expand Up @@ -166,7 +166,7 @@ void G1AllocRegion::init() {
trace("initialized");
}

void G1AllocRegion::set(HeapRegion* alloc_region) {
void G1AllocRegion::set(G1HeapRegion* alloc_region) {
trace("setting");
// We explicitly check that the region is not empty to make sure we
// maintain the "the alloc region cannot be empty" invariant.
Expand All @@ -181,7 +181,7 @@ void G1AllocRegion::set(HeapRegion* alloc_region) {
trace("set");
}

void G1AllocRegion::update_alloc_region(HeapRegion* alloc_region) {
void G1AllocRegion::update_alloc_region(G1HeapRegion* alloc_region) {
trace("update");
// We explicitly check that the region is not empty to make sure we
// maintain the "the alloc region cannot be empty" invariant.
Expand All @@ -192,9 +192,9 @@ void G1AllocRegion::update_alloc_region(HeapRegion* alloc_region) {
trace("updated");
}

HeapRegion* G1AllocRegion::release() {
G1HeapRegion* G1AllocRegion::release() {
trace("releasing");
HeapRegion* alloc_region = _alloc_region;
G1HeapRegion* alloc_region = _alloc_region;
retire(false /* fill_up */);
assert_alloc_region(_alloc_region == _dummy_region, "post-condition of retire()");
_alloc_region = nullptr;
Expand Down Expand Up @@ -257,11 +257,11 @@ G1AllocRegion::G1AllocRegion(const char* name,
_node_index(node_index)
{ }

HeapRegion* MutatorAllocRegion::allocate_new_region(size_t word_size) {
G1HeapRegion* MutatorAllocRegion::allocate_new_region(size_t word_size) {
return _g1h->new_mutator_alloc_region(word_size, _node_index);
}

void MutatorAllocRegion::retire_region(HeapRegion* alloc_region,
void MutatorAllocRegion::retire_region(G1HeapRegion* alloc_region,
size_t allocated_bytes) {
_g1h->retire_mutator_alloc_region(alloc_region, allocated_bytes);
}
Expand All @@ -272,7 +272,7 @@ void MutatorAllocRegion::init() {
_wasted_bytes = 0;
}

bool MutatorAllocRegion::should_retain(HeapRegion* region) {
bool MutatorAllocRegion::should_retain(G1HeapRegion* region) {
size_t free_bytes = region->free();
if (free_bytes < MinTLABSize) {
return false;
Expand All @@ -289,7 +289,7 @@ bool MutatorAllocRegion::should_retain(HeapRegion* region) {
size_t MutatorAllocRegion::retire(bool fill_up) {
size_t waste = 0;
trace("retiring");
HeapRegion* current_region = get();
G1HeapRegion* current_region = get();
if (current_region != nullptr) {
// Retain the current region if it fits a TLAB and has more
// free than the currently retained region.
Expand All @@ -312,7 +312,7 @@ size_t MutatorAllocRegion::retire(bool fill_up) {

size_t MutatorAllocRegion::used_in_alloc_regions() {
size_t used = 0;
HeapRegion* hr = get();
G1HeapRegion* hr = get();
if (hr != nullptr) {
used += hr->used();
}
Expand All @@ -324,8 +324,8 @@ size_t MutatorAllocRegion::used_in_alloc_regions() {
return used;
}

HeapRegion* MutatorAllocRegion::release() {
HeapRegion* ret = G1AllocRegion::release();
G1HeapRegion* MutatorAllocRegion::release() {
G1HeapRegion* ret = G1AllocRegion::release();

// The retained alloc region must be retired and this must be
// done after the above call to release the mutator alloc region,
Expand All @@ -338,21 +338,21 @@ HeapRegion* MutatorAllocRegion::release() {
count(),
byte_size_in_proper_unit(_wasted_bytes),
proper_unit_for_byte_size(_wasted_bytes),
percent_of(_wasted_bytes, count() * HeapRegion::GrainBytes));
percent_of(_wasted_bytes, count() * G1HeapRegion::GrainBytes));
return ret;
}

HeapRegion* G1GCAllocRegion::allocate_new_region(size_t word_size) {
G1HeapRegion* G1GCAllocRegion::allocate_new_region(size_t word_size) {
return _g1h->new_gc_alloc_region(word_size, _purpose, _node_index);
}

void G1GCAllocRegion::retire_region(HeapRegion* alloc_region,
void G1GCAllocRegion::retire_region(G1HeapRegion* alloc_region,
size_t allocated_bytes) {
_g1h->retire_gc_alloc_region(alloc_region, allocated_bytes, _purpose);
}

size_t G1GCAllocRegion::retire(bool fill_up) {
HeapRegion* retired = get();
G1HeapRegion* retired = get();
size_t end_waste = G1AllocRegion::retire(fill_up);
// Do not count retirement of the dummy allocation region.
if (retired != nullptr) {
Expand Down
Loading