@@ -2473,14 +2473,13 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr,
24732473 }
24742474#endif
24752475
2476- int profile_capture_ratio = ProfileCaptureRatio;
2477- int ratio_shift = exact_log2 (profile_capture_ratio);
2476+ int ratio_shift = exact_log2 (ProfileCaptureRatio);
24782477 uint64_t threshold = (UCONST64 (1 ) << 32 ) >> ratio_shift;
24792478
24802479 assert (threshold > 0 , " must be" );
24812480
24822481 ProfileStub *counter_stub
2483- = profile_capture_ratio > 1 ? new ProfileStub () : nullptr ;
2482+ = ProfileCaptureRatio > 1 ? new ProfileStub () : nullptr ;
24842483
24852484 Register dest = dest_opr->as_register ();
24862485
@@ -2544,7 +2543,7 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr,
25442543 }
25452544 }
25462545
2547- if (overflow_stub) {
2546+ if (overflow_stub != nullptr ) {
25482547 guarantee (step->is_valid (), " must be" );
25492548 if (!freq_opr->is_valid ()) {
25502549 if (!step->is_constant ()) {
@@ -2562,9 +2561,16 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr,
25622561 }
25632562 juint mask = freq_opr->as_jint ();
25642563 __ mov_slow (Rtemp, mask);
2565- __ tst (dest, Rtemp);
2566- __ b (*overflow_stub->entry (), eq);
2564+ __ andr (dest, dest, Rtemp);
2565+
2566+ if (step->is_register ()) {
2567+ __ cmp (dest, AsmOperand (step->as_register (), lsl, ratio_shift));
2568+ } else {
2569+ __ mov (Rtemp, step->as_constant_ptr ()->as_jint_bits () << ratio_shift);
2570+ __ cmp (dest, Rtemp);
2571+ }
25672572 }
2573+ __ b (*overflow_stub->entry (), lo);
25682574 }
25692575
25702576 if (counter_stub != nullptr ) {
0 commit comments