< prev index next >

src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp

Print this page




1905         imm = opr2->as_constant_ptr()->as_jlong();
1906         break;
1907       case T_ADDRESS:
1908         imm = opr2->as_constant_ptr()->as_jint();
1909         break;
1910       case T_OBJECT:
1911       case T_ARRAY:
1912         jobject2reg(opr2->as_constant_ptr()->as_jobject(), rscratch1);
1913         __ cmpoop(reg1, rscratch1);
1914         return;
1915       default:
1916         ShouldNotReachHere();
1917         imm = 0;  // unreachable
1918         break;
1919       }
1920 
1921       if (Assembler::operand_valid_for_add_sub_immediate(imm)) {
1922         if (is_32bit)
1923           __ cmpw(reg1, imm);
1924         else
1925           __ cmp(reg1, imm);
1926         return;
1927       } else {
1928         __ mov(rscratch1, imm);
1929         if (is_32bit)
1930           __ cmpw(reg1, rscratch1);
1931         else
1932           __ cmp(reg1, rscratch1);
1933         return;
1934       }
1935     } else
1936       ShouldNotReachHere();
1937   } else if (opr1->is_single_fpu()) {
1938     FloatRegister reg1 = opr1->as_float_reg();
1939     assert(opr2->is_single_fpu(), "expect single float register");
1940     FloatRegister reg2 = opr2->as_float_reg();
1941     __ fcmps(reg1, reg2);
1942   } else if (opr1->is_double_fpu()) {
1943     FloatRegister reg1 = opr1->as_double_reg();
1944     assert(opr2->is_double_fpu(), "expect double float register");
1945     FloatRegister reg2 = opr2->as_double_reg();


2688 #endif
2689     if (!no_conflict) {
2690       if (exact_klass == NULL || TypeEntries::is_type_none(current_klass)) {
2691         if (exact_klass != NULL) {
2692           __ mov_metadata(tmp, exact_klass->constant_encoding());
2693         } else {
2694           __ load_klass(tmp, tmp);
2695         }
2696 
2697         __ ldr(rscratch2, mdo_addr);
2698         __ eor(tmp, tmp, rscratch2);
2699         __ andr(rscratch1, tmp, TypeEntries::type_klass_mask);
2700         // klass seen before, nothing to do. The unknown bit may have been
2701         // set already but no need to check.
2702         __ cbz(rscratch1, next);
2703 
2704         __ tbnz(tmp, exact_log2(TypeEntries::type_unknown), next); // already unknown. Nothing to do anymore.
2705 
2706         if (TypeEntries::is_type_none(current_klass)) {
2707           __ cbz(rscratch2, none);
2708           __ cmp(rscratch2, TypeEntries::null_seen);
2709           __ br(Assembler::EQ, none);
2710           // There is a chance that the checks above (re-reading profiling
2711           // data from memory) fail if another thread has just set the
2712           // profiling to this obj's klass
2713           __ dmb(Assembler::ISHLD);
2714           __ ldr(rscratch2, mdo_addr);
2715           __ eor(tmp, tmp, rscratch2);
2716           __ andr(rscratch1, tmp, TypeEntries::type_klass_mask);
2717           __ cbz(rscratch1, next);
2718         }
2719       } else {
2720         assert(ciTypeEntries::valid_ciklass(current_klass) != NULL &&
2721                ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "conflict only");
2722 
2723         __ ldr(tmp, mdo_addr);
2724         __ tbnz(tmp, exact_log2(TypeEntries::type_unknown), next); // already unknown. Nothing to do anymore.
2725       }
2726 
2727       // different than before. Cannot keep accurate profile.
2728       __ ldr(rscratch2, mdo_addr);


2733         __ b(next);
2734 
2735         __ bind(none);
2736         // first time here. Set profile type.
2737         __ str(tmp, mdo_addr);
2738       }
2739     } else {
2740       // There's a single possible klass at this profile point
2741       assert(exact_klass != NULL, "should be");
2742       if (TypeEntries::is_type_none(current_klass)) {
2743         __ mov_metadata(tmp, exact_klass->constant_encoding());
2744         __ ldr(rscratch2, mdo_addr);
2745         __ eor(tmp, tmp, rscratch2);
2746         __ andr(rscratch1, tmp, TypeEntries::type_klass_mask);
2747         __ cbz(rscratch1, next);
2748 #ifdef ASSERT
2749         {
2750           Label ok;
2751           __ ldr(rscratch1, mdo_addr);
2752           __ cbz(rscratch1, ok);
2753           __ cmp(rscratch1, TypeEntries::null_seen);
2754           __ br(Assembler::EQ, ok);
2755           // may have been set by another thread
2756           __ dmb(Assembler::ISHLD);
2757           __ mov_metadata(rscratch1, exact_klass->constant_encoding());
2758           __ ldr(rscratch2, mdo_addr);
2759           __ eor(rscratch2, rscratch1, rscratch2);
2760           __ andr(rscratch2, rscratch2, TypeEntries::type_mask);
2761           __ cbz(rscratch2, ok);
2762 
2763           __ stop("unexpected profiling mismatch");
2764           __ bind(ok);
2765         }
2766 #endif
2767         // first time here. Set profile type.
2768         __ ldr(tmp, mdo_addr);
2769       } else {
2770         assert(ciTypeEntries::valid_ciklass(current_klass) != NULL &&
2771                ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent");
2772 
2773         __ ldr(tmp, mdo_addr);




1905         imm = opr2->as_constant_ptr()->as_jlong();
1906         break;
1907       case T_ADDRESS:
1908         imm = opr2->as_constant_ptr()->as_jint();
1909         break;
1910       case T_OBJECT:
1911       case T_ARRAY:
1912         jobject2reg(opr2->as_constant_ptr()->as_jobject(), rscratch1);
1913         __ cmpoop(reg1, rscratch1);
1914         return;
1915       default:
1916         ShouldNotReachHere();
1917         imm = 0;  // unreachable
1918         break;
1919       }
1920 
1921       if (Assembler::operand_valid_for_add_sub_immediate(imm)) {
1922         if (is_32bit)
1923           __ cmpw(reg1, imm);
1924         else
1925           __ subs(zr, reg1, imm);
1926         return;
1927       } else {
1928         __ mov(rscratch1, imm);
1929         if (is_32bit)
1930           __ cmpw(reg1, rscratch1);
1931         else
1932           __ cmp(reg1, rscratch1);
1933         return;
1934       }
1935     } else
1936       ShouldNotReachHere();
1937   } else if (opr1->is_single_fpu()) {
1938     FloatRegister reg1 = opr1->as_float_reg();
1939     assert(opr2->is_single_fpu(), "expect single float register");
1940     FloatRegister reg2 = opr2->as_float_reg();
1941     __ fcmps(reg1, reg2);
1942   } else if (opr1->is_double_fpu()) {
1943     FloatRegister reg1 = opr1->as_double_reg();
1944     assert(opr2->is_double_fpu(), "expect double float register");
1945     FloatRegister reg2 = opr2->as_double_reg();


2688 #endif
2689     if (!no_conflict) {
2690       if (exact_klass == NULL || TypeEntries::is_type_none(current_klass)) {
2691         if (exact_klass != NULL) {
2692           __ mov_metadata(tmp, exact_klass->constant_encoding());
2693         } else {
2694           __ load_klass(tmp, tmp);
2695         }
2696 
2697         __ ldr(rscratch2, mdo_addr);
2698         __ eor(tmp, tmp, rscratch2);
2699         __ andr(rscratch1, tmp, TypeEntries::type_klass_mask);
2700         // klass seen before, nothing to do. The unknown bit may have been
2701         // set already but no need to check.
2702         __ cbz(rscratch1, next);
2703 
2704         __ tbnz(tmp, exact_log2(TypeEntries::type_unknown), next); // already unknown. Nothing to do anymore.
2705 
2706         if (TypeEntries::is_type_none(current_klass)) {
2707           __ cbz(rscratch2, none);
2708           __ cmp(rscratch2, (u1)TypeEntries::null_seen);
2709           __ br(Assembler::EQ, none);
2710           // There is a chance that the checks above (re-reading profiling
2711           // data from memory) fail if another thread has just set the
2712           // profiling to this obj's klass
2713           __ dmb(Assembler::ISHLD);
2714           __ ldr(rscratch2, mdo_addr);
2715           __ eor(tmp, tmp, rscratch2);
2716           __ andr(rscratch1, tmp, TypeEntries::type_klass_mask);
2717           __ cbz(rscratch1, next);
2718         }
2719       } else {
2720         assert(ciTypeEntries::valid_ciklass(current_klass) != NULL &&
2721                ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "conflict only");
2722 
2723         __ ldr(tmp, mdo_addr);
2724         __ tbnz(tmp, exact_log2(TypeEntries::type_unknown), next); // already unknown. Nothing to do anymore.
2725       }
2726 
2727       // different than before. Cannot keep accurate profile.
2728       __ ldr(rscratch2, mdo_addr);


2733         __ b(next);
2734 
2735         __ bind(none);
2736         // first time here. Set profile type.
2737         __ str(tmp, mdo_addr);
2738       }
2739     } else {
2740       // There's a single possible klass at this profile point
2741       assert(exact_klass != NULL, "should be");
2742       if (TypeEntries::is_type_none(current_klass)) {
2743         __ mov_metadata(tmp, exact_klass->constant_encoding());
2744         __ ldr(rscratch2, mdo_addr);
2745         __ eor(tmp, tmp, rscratch2);
2746         __ andr(rscratch1, tmp, TypeEntries::type_klass_mask);
2747         __ cbz(rscratch1, next);
2748 #ifdef ASSERT
2749         {
2750           Label ok;
2751           __ ldr(rscratch1, mdo_addr);
2752           __ cbz(rscratch1, ok);
2753           __ cmp(rscratch1, (u1)TypeEntries::null_seen);
2754           __ br(Assembler::EQ, ok);
2755           // may have been set by another thread
2756           __ dmb(Assembler::ISHLD);
2757           __ mov_metadata(rscratch1, exact_klass->constant_encoding());
2758           __ ldr(rscratch2, mdo_addr);
2759           __ eor(rscratch2, rscratch1, rscratch2);
2760           __ andr(rscratch2, rscratch2, TypeEntries::type_mask);
2761           __ cbz(rscratch2, ok);
2762 
2763           __ stop("unexpected profiling mismatch");
2764           __ bind(ok);
2765         }
2766 #endif
2767         // first time here. Set profile type.
2768         __ ldr(tmp, mdo_addr);
2769       } else {
2770         assert(ciTypeEntries::valid_ciklass(current_klass) != NULL &&
2771                ciTypeEntries::valid_ciklass(current_klass) != exact_klass, "inconsistent");
2772 
2773         __ ldr(tmp, mdo_addr);


< prev index next >