From 3a3759eee5099ef7990750ca2226c8306b46dab9 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 23 Jun 2026 16:26:58 +0200 Subject: [PATCH] tests --- .../cpu/aarch64/c1_LIRAssembler_aarch64.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index 6e98fbbae05..b02d68d6eba 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -2558,16 +2558,18 @@ void LIR_Assembler::emit_load_klass(LIR_OpLoadKlass* op) { __ load_klass(result, obj); } +#ifndef PRODUCT uint64_t r_counts [2]; uint64_t r_steps [2]; constexpr uint64_t *r_counts2 = r_counts + 1; uint64_t zeroes; +#endif // PRODUCT void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr, LIR_Opr freq_opr, LIR_Opr md_reg, LIR_Opr md_opr, LIR_Opr md_offset_opr, CodeStub* overflow_stub) { - (void)r_counts2; #ifndef PRODUCT + (void)r_counts2; if (CommentedAssembly) { __ block_comment("increment_event_counter {"); } @@ -2610,9 +2612,11 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr, LIR_Op if (ProfileCaptureRatio > 1) { __ lsl(inc, inc, ratio_shift); } +#ifndef PRODUCT __ lea(rscratch2, Address((address)r_counts + wordSize)); __ mov(rscratch1, inc); __ ldadd(Assembler::xword, rscratch1, rscratch1, rscratch2); +#endif // PRODUCT __ ldrw(dest, counter_address); __ addw(dest, dest, inc); @@ -2624,9 +2628,11 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr, LIR_Op jint inc = step->as_constant_ptr()->as_jint_bits(); inc *= ProfileCaptureRatio; +#ifndef PRODUCT __ lea(rscratch2, Address((address)r_counts + wordSize)); __ mov(rscratch1, inc); __ ldadd(Assembler::xword, rscratch1, rscratch1, rscratch2); +#endif // PRODUCT switch (dest_opr->type()) { @@ -2682,37 +2688,47 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr, LIR_Op } else { __ mov(rscratch1, step->as_constant_ptr()->as_jint_bits()); } +#ifndef PRODUCT __ lea(rscratch2, Address((address)r_counts)); __ ldadd(Assembler::xword, rscratch1, rscratch1, rscratch2); +#endif // PRODUCT if (counter_stub != nullptr) { +#ifndef PRODUCT __ lea(rscratch2, Address((address)r_steps)); __ mov(rscratch1, 1); __ ldadd(Assembler::xword, rscratch1, rscratch1, rscratch2); +#endif // PRODUCT Label nope, nonzero; { +#ifndef PRODUCT // Check r_profile_rng isn't zero __ cbnzw(r_profile_rng, nonzero); __ lea(rscratch2, Address((address)&zeroes)); __ mov(rscratch1, 1); __ ldadd(Assembler::xword, rscratch1, rscratch1, rscratch2); __ bind(nonzero); +#endif // PRODUCT } { +#ifndef PRODUCT Label nope; // Check r_profile_rng is clean __ lsr(rscratch1, r_profile_rng, 32); __ cbz(rscratch1, nope); __ stop("Urrgg"); __ bind(nope); +#endif // PRODUCT } __ ubfx(rscratch1, r_profile_rng, 28 - ratio_shift, ratio_shift); __ cbnz(rscratch1, nope); { +#ifndef PRODUCT __ lea(rscratch2, Address((address)&r_steps[1])); __ mov(rscratch1, ProfileCaptureRatio); __ ldadd(Assembler::xword, rscratch1, rscratch1, rscratch2); +#endif // PRODUCT __ b(*counter_stub->entry()); __ bind(*counter_stub->continuation()); }