diff --git a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp index 1b804c4f943..a40eee0aaff 100644 --- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp @@ -2606,6 +2606,7 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr, LIR_Op } case T_LONG: { __ increment(counter_address, inc, dest); + break; } default: ShouldNotReachHere(); diff --git a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp index f5d880af4c9..dbb72a8e630 100644 --- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp +++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp @@ -241,6 +241,8 @@ int LIR_Assembler::emit_unwind_handler() { __ bind(_unwind_handler_entry); __ verify_not_null_oop(Rexception_obj); + __ restore_profile_rng(); + // Perform needed unlocking MonitorExitStub* stub = nullptr; if (method()->is_synchronized()) { diff --git a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp index 61644e46f39..f3c306912f5 100644 --- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp @@ -408,6 +408,8 @@ int LIR_Assembler::emit_unwind_handler() { __ mov(rbx, rax); // Preserve the exception (rbx is always callee-saved) } + __ restore_profile_rng(); + // Perform needed unlocking MonitorExitStub* stub = nullptr; if (method()->is_synchronized()) { diff --git a/src/hotspot/share/c1/c1_LIR.hpp b/src/hotspot/share/c1/c1_LIR.hpp index 9dd1ce07018..d1265526eb0 100644 --- a/src/hotspot/share/c1/c1_LIR.hpp +++ b/src/hotspot/share/c1/c1_LIR.hpp @@ -1957,7 +1957,9 @@ class LIR_OpIncrementCounter : public LIR_Op { , _md_reg(md_reg) , _md_op(md_op) , _md_offset_op(md_offset_op) - , _overflow_stub(overflow_stub) { } + , _overflow_stub(overflow_stub) { + assert(type2aelembytes(dest->type()) == wordSize, "must be"); + } LIR_Opr step() const { return _step; } LIR_Opr dest() const { return result_opr(); } diff --git a/src/hotspot/share/c1/c1_LIRGenerator.cpp b/src/hotspot/share/c1/c1_LIRGenerator.cpp index 6e2189aff4a..0fb30c8e613 100644 --- a/src/hotspot/share/c1/c1_LIRGenerator.cpp +++ b/src/hotspot/share/c1/c1_LIRGenerator.cpp @@ -964,7 +964,7 @@ void LIRGenerator::profile_branch(If* if_instr, If::Condition cond) { LIR_OprFact::intptrConst(not_taken_count_offset), data_offset_reg, as_BasicType(if_instr->x()->type())); - LIR_Opr tmp = new_register(T_INT); + LIR_Opr tmp = new_register(wordSize == 4 ? T_INT : T_LONG); LIR_Opr step = LIR_OprFact::intConst(DataLayout::counter_increment); __ increment_counter(step, tmp, md_reg, md->constant_encoding(), data_offset_reg); } @@ -2416,7 +2416,7 @@ void LIRGenerator::do_Goto(Goto* x) { } LIR_Opr md_reg = new_register(T_METADATA); #ifdef RANDOMIZED_PROFILE_CAPTURE - LIR_Opr tmp = new_register(T_INT); + LIR_Opr tmp = new_register(wordSize == 4 ? T_INT : T_LONG); LIR_Opr inc = LIR_OprFact::intConst(DataLayout::counter_increment); __ increment_counter(inc, tmp, md_reg, md->constant_encoding(), offset); #else @@ -3225,7 +3225,7 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info, ShouldNotReachHere(); } - LIR_Opr result = new_register(T_INT); + LIR_Opr result = new_register(wordSize == 4 ? T_INT : T_LONG); if (notify && (!backedge || UseOnStackReplacement)) { int ratio_shift = exact_log2(ProfileCaptureRatio); LIR_Opr meth = LIR_OprFact::metadataConst(method->constant_encoding());