Skip to content

Commit 1e5a278

Browse files
committed
8332676: Remove unused BarrierSetAssembler::incr_allocated_bytes
Reviewed-by: tschatzl, kbarrett
1 parent c2180d1 commit 1e5a278

13 files changed

+2
-130
lines changed

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -269,21 +269,6 @@ void BarrierSetAssembler::tlab_allocate(MacroAssembler* masm, Register obj,
269269
// verify_tlab();
270270
}
271271

272-
void BarrierSetAssembler::incr_allocated_bytes(MacroAssembler* masm,
273-
Register var_size_in_bytes,
274-
int con_size_in_bytes,
275-
Register t1) {
276-
assert(t1->is_valid(), "need temp reg");
277-
278-
__ ldr(t1, Address(rthread, in_bytes(JavaThread::allocated_bytes_offset())));
279-
if (var_size_in_bytes->is_valid()) {
280-
__ add(t1, t1, var_size_in_bytes);
281-
} else {
282-
__ add(t1, t1, con_size_in_bytes);
283-
}
284-
__ str(t1, Address(rthread, in_bytes(JavaThread::allocated_bytes_offset())));
285-
}
286-
287272
static volatile uint32_t _patching_epoch = 0;
288273

289274
address BarrierSetAssembler::patching_epoch_addr() {

src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ enum class NMethodPatchingType {
4444
};
4545

4646
class BarrierSetAssembler: public CHeapObj<mtGC> {
47-
private:
48-
void incr_allocated_bytes(MacroAssembler* masm,
49-
Register var_size_in_bytes, int con_size_in_bytes,
50-
Register t1 = noreg);
51-
5247
public:
5348
virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
5449
Register src, Register dst, Register count, RegSet saved_regs) {}

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

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -159,46 +159,6 @@ void BarrierSetAssembler::tlab_allocate(MacroAssembler* masm, Register obj, Regi
159159
__ str(obj_end, Address(Rthread, JavaThread::tlab_top_offset()));
160160
}
161161

162-
void BarrierSetAssembler::incr_allocated_bytes(MacroAssembler* masm, RegisterOrConstant size_in_bytes, Register tmp) {
163-
// Bump total bytes allocated by this thread
164-
Label done;
165-
166-
// Borrow the Rthread for alloc counter
167-
Register Ralloc = Rthread;
168-
__ add(Ralloc, Ralloc, in_bytes(JavaThread::allocated_bytes_offset()));
169-
__ ldr(tmp, Address(Ralloc));
170-
__ adds(tmp, tmp, size_in_bytes);
171-
__ str(tmp, Address(Ralloc), cc);
172-
__ b(done, cc);
173-
174-
// Increment the high word and store single-copy atomically (that is an unlikely scenario on typical embedded systems as it means >4GB has been allocated)
175-
// To do so ldrd/strd instructions used which require an even-odd pair of registers. Such a request could be difficult to satisfy by
176-
// allocating those registers on a higher level, therefore the routine is ready to allocate a pair itself.
177-
Register low, high;
178-
// Select ether R0/R1 or R2/R3
179-
180-
if (size_in_bytes.is_register() && (size_in_bytes.as_register() == R0 || size_in_bytes.as_register() == R1)) {
181-
low = R2;
182-
high = R3;
183-
} else {
184-
low = R0;
185-
high = R1;
186-
}
187-
__ push(RegisterSet(low, high));
188-
189-
__ ldrd(low, Address(Ralloc));
190-
__ adds(low, low, size_in_bytes);
191-
__ adc(high, high, 0);
192-
__ strd(low, Address(Ralloc));
193-
194-
__ pop(RegisterSet(low, high));
195-
196-
__ bind(done);
197-
198-
// Unborrow the Rthread
199-
__ sub(Rthread, Ralloc, in_bytes(JavaThread::allocated_bytes_offset()));
200-
}
201-
202162
void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm) {
203163

204164
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();

src/hotspot/cpu/arm/gc/shared/barrierSetAssembler_arm.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ enum class NMethodPatchingType {
4040
};
4141

4242
class BarrierSetAssembler: public CHeapObj<mtGC> {
43-
private:
44-
void incr_allocated_bytes(MacroAssembler* masm,
45-
RegisterOrConstant size_in_bytes,
46-
Register tmp
47-
);
48-
4943
public:
5044
virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
5145
Register addr, Register count, int callee_saved_regs) {}

src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void C1_MacroAssembler::try_allocate(
183183
Register obj, // result: pointer to object after successful allocation
184184
Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise
185185
int con_size_in_bytes, // object size in bytes if known at compile time
186-
Register t1, // temp register, must be global register for incr_allocated_bytes
186+
Register t1, // temp register
187187
Register t2, // temp register
188188
Label& slow_case // continuation point if fast allocation fails
189189
) {

src/hotspot/cpu/ppc/macroAssembler_ppc.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,9 +2209,6 @@ void MacroAssembler::tlab_allocate(
22092209
std(new_top, in_bytes(JavaThread::tlab_top_offset()), R16_thread);
22102210
//verify_tlab(); not implemented
22112211
}
2212-
void MacroAssembler::incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2) {
2213-
unimplemented("incr_allocated_bytes");
2214-
}
22152212

22162213
address MacroAssembler::emit_trampoline_stub(int destination_toc_offset,
22172214
int insts_call_instruction_offset, Register Rtoc) {

src/hotspot/cpu/ppc/macroAssembler_ppc.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,6 @@ class MacroAssembler: public Assembler {
626626
Register t1, // temp register
627627
Label& slow_case // continuation point if fast allocation fails
628628
);
629-
void incr_allocated_bytes(RegisterOrConstant size_in_bytes, Register t1, Register t2);
630629

631630
enum { trampoline_stub_size = 6 * 4 };
632631
address emit_trampoline_stub(int destination_toc_offset, int insts_call_instruction_offset, Register Rtoc = noreg);

src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,6 @@ void BarrierSetAssembler::tlab_allocate(MacroAssembler* masm, Register obj,
211211
}
212212
}
213213

214-
void BarrierSetAssembler::incr_allocated_bytes(MacroAssembler* masm,
215-
Register var_size_in_bytes,
216-
int con_size_in_bytes,
217-
Register tmp1) {
218-
assert(tmp1->is_valid(), "need temp reg");
219-
220-
__ ld(tmp1, Address(xthread, in_bytes(JavaThread::allocated_bytes_offset())));
221-
if (var_size_in_bytes->is_valid()) {
222-
__ add(tmp1, tmp1, var_size_in_bytes);
223-
} else {
224-
__ add(tmp1, tmp1, con_size_in_bytes);
225-
}
226-
__ sd(tmp1, Address(xthread, in_bytes(JavaThread::allocated_bytes_offset())));
227-
}
228-
229214
static volatile uint32_t _patching_epoch = 0;
230215

231216
address BarrierSetAssembler::patching_epoch_addr() {

src/hotspot/cpu/riscv/gc/shared/barrierSetAssembler_riscv.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ enum class NMethodPatchingType {
4545
};
4646

4747
class BarrierSetAssembler: public CHeapObj<mtGC> {
48-
private:
49-
void incr_allocated_bytes(MacroAssembler* masm,
50-
Register var_size_in_bytes, int con_size_in_bytes,
51-
Register t1 = noreg);
52-
5348
public:
5449
virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop,
5550
Register src, Register dst, Register count, RegSet saved_regs) {}

src/hotspot/cpu/s390/c1_MacroAssembler_s390.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void C1_MacroAssembler::try_allocate(
164164
Register obj, // result: Pointer to object after successful allocation.
165165
Register var_size_in_bytes, // Object size in bytes if unknown at compile time; invalid otherwise.
166166
int con_size_in_bytes, // Object size in bytes if known at compile time.
167-
Register t1, // Temp register: Must be global register for incr_allocated_bytes.
167+
Register t1, // Temp register.
168168
Label& slow_case // Continuation point if fast allocation fails.
169169
) {
170170
if (UseTLAB) {

0 commit comments

Comments
 (0)