Skip to content

Commit adf3952

Browse files
Vishal ChandThomas Schatzl
authored andcommitted
8277372: Add getters for BOT and card table members
Reviewed-by: tschatzl, sjohanss, ayang
1 parent 7c6f57f commit adf3952

40 files changed

+205
-176
lines changed

src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
222222

223223
const Register card_addr = tmp;
224224

225-
__ lsr(card_addr, store_addr, CardTable::card_shift);
225+
__ lsr(card_addr, store_addr, CardTable::card_shift());
226226

227227
// get the address of the card
228228
__ load_byte_map_base(tmp2);
@@ -444,7 +444,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
444444
assert_different_registers(card_offset, byte_map_base, rscratch1);
445445

446446
__ load_parameter(0, card_offset);
447-
__ lsr(card_offset, card_offset, CardTable::card_shift);
447+
__ lsr(card_offset, card_offset, CardTable::card_shift());
448448
__ load_byte_map_base(byte_map_base);
449449
__ ldrb(rscratch1, Address(byte_map_base, card_offset));
450450
__ cmpw(rscratch1, (int)G1CardTable::g1_young_card_val());

src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register ob
3838
BarrierSet* bs = BarrierSet::barrier_set();
3939
assert(bs->kind() == BarrierSet::CardTableBarrierSet, "Wrong barrier set kind");
4040

41-
__ lsr(obj, obj, CardTable::card_shift);
41+
__ lsr(obj, obj, CardTable::card_shift());
4242

4343
assert(CardTable::dirty_card_val() == 0, "must be");
4444

@@ -64,8 +64,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl
6464

6565
__ lea(end, Address(start, count, Address::lsl(LogBytesPerHeapOop))); // end = start + count << LogBytesPerHeapOop
6666
__ sub(end, end, BytesPerHeapOop); // last element address to make inclusive
67-
__ lsr(start, start, CardTable::card_shift);
68-
__ lsr(end, end, CardTable::card_shift);
67+
__ lsr(start, start, CardTable::card_shift());
68+
__ lsr(end, end, CardTable::card_shift());
6969
__ sub(count, end, start); // number of bytes to copy
7070

7171
__ load_byte_map_base(scratch);

src/hotspot/cpu/arm/c1_LIRGenerator_arm.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ void LIRGenerator::CardTableBarrierSet_post_barrier_helper(LIR_Opr addr, LIR_Con
377377

378378
// Use unsigned type T_BOOLEAN here rather than (signed) T_BYTE since signed load
379379
// byte instruction does not support the addressing mode we need.
380-
LIR_Address* card_addr = new LIR_Address(tmp, addr, (LIR_Address::Scale) -CardTable::card_shift, 0, T_BOOLEAN);
380+
LIR_Address* card_addr = new LIR_Address(tmp, addr, (LIR_Address::Scale) -CardTable::card_shift(), 0, T_BOOLEAN);
381381
if (UseCondCardMark) {
382382
LIR_Opr cur_value = new_register(T_INT);
383383
__ move(card_addr, cur_value);

src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
218218
const Register card_addr = tmp1;
219219

220220
__ mov_address(tmp2, (address)ct->byte_map_base());
221-
__ add(card_addr, tmp2, AsmOperand(store_addr, lsr, CardTable::card_shift));
221+
__ add(card_addr, tmp2, AsmOperand(store_addr, lsr, CardTable::card_shift()));
222222

223223
__ ldrb(tmp2, Address(card_addr));
224224
__ cmp(tmp2, (int)G1CardTable::g1_young_card_val());
@@ -452,7 +452,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
452452
// explicitly specify that 'cardtable' has a relocInfo::none
453453
// type.
454454
__ lea(r_card_base_1, cardtable);
455-
__ add(r_card_addr_0, r_card_base_1, AsmOperand(r_obj_0, lsr, CardTable::card_shift));
455+
__ add(r_card_addr_0, r_card_base_1, AsmOperand(r_obj_0, lsr, CardTable::card_shift()));
456456

457457
// first quick check without barrier
458458
__ ldrb(r_tmp2, Address(r_card_addr_0));

src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl
5555
__ add_ptr_scaled_int32(count, addr, count, LogBytesPerHeapOop);
5656
__ sub(count, count, BytesPerHeapOop); // last addr
5757

58-
__ logical_shift_right(addr, addr, CardTable::card_shift);
59-
__ logical_shift_right(count, count, CardTable::card_shift);
58+
__ logical_shift_right(addr, addr, CardTable::card_shift());
59+
__ logical_shift_right(count, count, CardTable::card_shift());
6060
__ sub(count, count, addr); // nb of cards
6161

6262
// warning: Rthread has not been preserved
@@ -129,7 +129,7 @@ void CardTableBarrierSetAssembler::store_check_part2(MacroAssembler* masm, Regis
129129
"Wrong barrier set kind");
130130

131131
assert(CardTable::dirty_card_val() == 0, "Dirty card value must be 0 due to optimizations.");
132-
Address card_table_addr(card_table_base, obj, lsr, CardTable::card_shift);
132+
Address card_table_addr(card_table_base, obj, lsr, CardTable::card_shift());
133133

134134
if (UseCondCardMark) {
135135
Label already_dirty;

src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato
245245
Register Rbase = tmp2;
246246
__ load_const_optimized(Rbase, (address)(ct->card_table()->byte_map_base()), /*temp*/ tmp3);
247247

248-
__ srdi(Rcard_addr, store_addr, CardTable::card_shift);
248+
__ srdi(Rcard_addr, store_addr, CardTable::card_shift());
249249

250250
// Get the address of the card.
251251
__ lbzx(/*card value*/ tmp3, Rbase, Rcard_addr);
@@ -516,7 +516,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
516516
__ std(addr, -8, R1_SP);
517517
__ std(tmp2, -16, R1_SP);
518518

519-
__ srdi(addr, R0, CardTable::card_shift); // Addr is passed in R0.
519+
__ srdi(addr, R0, CardTable::card_shift()); // Addr is passed in R0.
520520
__ load_const_optimized(/*cardtable*/ tmp2, byte_map_base, tmp);
521521
__ add(addr, tmp2, addr);
522522
__ lbz(tmp, 0, addr); // tmp := [addr + cardtable]

src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl
5454
__ addi(count, count, -BytesPerHeapOop);
5555
__ add(count, addr, count);
5656
// Use two shifts to clear out those low order two bits! (Cannot opt. into 1.)
57-
__ srdi(addr, addr, CardTable::card_shift);
58-
__ srdi(count, count, CardTable::card_shift);
57+
__ srdi(addr, addr, CardTable::card_shift());
58+
__ srdi(count, count, CardTable::card_shift());
5959
__ subf(count, addr, count);
6060
__ add_const_optimized(addr, addr, (address)ct->byte_map_base(), R0);
6161
__ addi(count, count, 1);
@@ -74,7 +74,7 @@ void CardTableBarrierSetAssembler::card_table_write(MacroAssembler* masm,
7474
Register tmp, Register obj) {
7575
assert_different_registers(obj, tmp, R0);
7676
__ load_const_optimized(tmp, (address)byte_map_base, R0);
77-
__ srdi(obj, obj, CardTable::card_shift);
77+
__ srdi(obj, obj, CardTable::card_shift());
7878
__ li(R0, CardTable::dirty_card_val());
7979
__ stbx(R0, tmp, obj);
8080
}

src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, Decorato
305305

306306
// calculate address of card
307307
__ load_const_optimized(Rbase, (address)ct->card_table()->byte_map_base()); // Card table base.
308-
__ z_srlg(Rcard_addr, Rstore_addr, CardTable::card_shift); // Index into card table.
308+
__ z_srlg(Rcard_addr, Rstore_addr, CardTable::card_shift()); // Index into card table.
309309
__ z_algr(Rcard_addr, Rbase); // Explicit calculation needed for cli.
310310
Rbase = noreg; // end of lifetime
311311

@@ -548,7 +548,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
548548

549549
// Calculate address of card corresponding to the updated oop slot.
550550
AddressLiteral rs(byte_map_base);
551-
__ z_srlg(addr_card, addr_oop, CardTable::card_shift);
551+
__ z_srlg(addr_card, addr_oop, CardTable::card_shift());
552552
addr_oop = noreg; // dead now
553553
__ load_const_optimized(cardtable, rs); // cardtable := <card table base>
554554
__ z_agr(addr_card, cardtable); // addr_card := addr_oop>>card_shift + cardtable

src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl
7070
__ load_const_optimized(Z_R1, (address)ct->byte_map_base());
7171

7272
// count = (count>>shift) - (addr>>shift)
73-
__ z_srlg(addr, addr, CardTable::card_shift);
74-
__ z_srlg(count, count, CardTable::card_shift);
73+
__ z_srlg(addr, addr, CardTable::card_shift());
74+
__ z_srlg(count, count, CardTable::card_shift());
7575

7676
// Prefetch first elements of card table for update.
7777
if (VM_Version::has_Prefetch()) {
@@ -146,7 +146,7 @@ void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register st
146146

147147
assert_different_registers(store_addr, tmp);
148148

149-
__ z_srlg(store_addr, store_addr, CardTable::card_shift);
149+
__ z_srlg(store_addr, store_addr, CardTable::card_shift());
150150
__ load_absolute_address(tmp, (address)ct->byte_map_base());
151151
__ z_agr(store_addr, tmp);
152152
__ z_mvi(0, store_addr, CardTable::dirty_card_val());

src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm,
298298
const Register cardtable = tmp2;
299299

300300
__ movptr(card_addr, store_addr);
301-
__ shrptr(card_addr, CardTable::card_shift);
301+
__ shrptr(card_addr, CardTable::card_shift());
302302
// Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT
303303
// a valid address and therefore is not properly handled by the relocation code.
304304
__ movptr(cardtable, (intptr_t)ct->card_table()->byte_map_base());
@@ -540,7 +540,7 @@ void G1BarrierSetAssembler::generate_c1_post_barrier_runtime_stub(StubAssembler*
540540
const Register card_addr = rcx;
541541

542542
__ load_parameter(0, card_addr);
543-
__ shrptr(card_addr, CardTable::card_shift);
543+
__ shrptr(card_addr, CardTable::card_shift());
544544
// Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT
545545
// a valid address and therefore is not properly handled by the relocation code.
546546
__ movptr(cardtable, (intptr_t)ct->card_table()->byte_map_base());

src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ void CardTableBarrierSetAssembler::gen_write_ref_array_post_barrier(MacroAssembl
6060
#ifdef _LP64
6161
__ leaq(end, Address(addr, count, TIMES_OOP, 0)); // end == addr+count*oop_size
6262
__ subptr(end, BytesPerHeapOop); // end - 1 to make inclusive
63-
__ shrptr(addr, CardTable::card_shift);
64-
__ shrptr(end, CardTable::card_shift);
63+
__ shrptr(addr, CardTable::card_shift());
64+
__ shrptr(end, CardTable::card_shift());
6565
__ subptr(end, addr); // end --> cards count
6666

6767
__ mov64(tmp, disp);
@@ -72,8 +72,8 @@ __ BIND(L_loop);
7272
__ jcc(Assembler::greaterEqual, L_loop);
7373
#else
7474
__ lea(end, Address(addr, count, Address::times_ptr, -wordSize));
75-
__ shrptr(addr, CardTable::card_shift);
76-
__ shrptr(end, CardTable::card_shift);
75+
__ shrptr(addr, CardTable::card_shift());
76+
__ shrptr(end, CardTable::card_shift());
7777
__ subptr(end, addr); // end --> count
7878
__ BIND(L_loop);
7979
Address cardtable(addr, count, Address::times_1, disp);
@@ -93,7 +93,7 @@ void CardTableBarrierSetAssembler::store_check(MacroAssembler* masm, Register ob
9393
CardTableBarrierSet* ctbs = barrier_set_cast<CardTableBarrierSet>(bs);
9494
CardTable* ct = ctbs->card_table();
9595

96-
__ shrptr(obj, CardTable::card_shift);
96+
__ shrptr(obj, CardTable::card_shift());
9797

9898
Address card_addr;
9999

src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ void G1BarrierSetC2::post_barrier(GraphKit* kit,
442442
Node* cast = __ CastPX(__ ctrl(), adr);
443443

444444
// Divide pointer by card size
445-
Node* card_offset = __ URShiftX( cast, __ ConI(CardTable::card_shift) );
445+
Node* card_offset = __ URShiftX( cast, __ ConI(CardTable::card_shift()) );
446446

447447
// Combine card table base and card offset
448448
Node* card_adr = __ AddP(no_base, byte_map_base_node(kit), card_offset );

src/hotspot/share/gc/g1/g1AllocRegion.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ HeapRegion* OldGCAllocRegion::release() {
371371
// Determine how far we are from the next card boundary. If it is smaller than
372372
// the minimum object size we can allocate into, expand into the next card.
373373
HeapWord* top = cur->top();
374-
HeapWord* aligned_top = align_up(top, BOTConstants::N_bytes);
374+
HeapWord* aligned_top = align_up(top, BOTConstants::card_size());
375375

376376
size_t to_allocate_words = pointer_delta(aligned_top, top, HeapWordSize);
377377

src/hotspot/share/gc/g1/g1Arguments.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ void G1Arguments::initialize_card_set_configuration() {
135135
uint region_size_log_mb = (uint)MAX2(HeapRegion::LogOfHRGrainBytes - LOG_M, 0);
136136

137137
if (FLAG_IS_DEFAULT(G1RemSetArrayOfCardsEntries)) {
138-
uint max_cards_in_inline_ptr = G1CardSetConfiguration::max_cards_in_inline_ptr(HeapRegion::LogOfHRGrainBytes - CardTable::card_shift);
138+
uint max_cards_in_inline_ptr = G1CardSetConfiguration::max_cards_in_inline_ptr(HeapRegion::LogOfHRGrainBytes - CardTable::card_shift());
139139
FLAG_SET_ERGO(G1RemSetArrayOfCardsEntries, MAX2(max_cards_in_inline_ptr * 2,
140140
G1RemSetArrayOfCardsEntriesBase * (1u << (region_size_log_mb + 1))));
141141
}

0 commit comments

Comments
 (0)