< prev index next >

src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp

Print this page


1662     assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
1663   }
1664   Label profile_cast_success, profile_cast_failure;
1665   Label *success_target = op->should_profile() ? &profile_cast_success : success;
1666   Label *failure_target = op->should_profile() ? &profile_cast_failure : failure;
1667 
1668   if (obj == k_RInfo) {
1669     k_RInfo = dst;
1670   } else if (obj == klass_RInfo) {
1671     klass_RInfo = dst;
1672   }
1673   if (k->is_loaded() && !UseCompressedClassPointers) {
1674     select_different_registers(obj, dst, k_RInfo, klass_RInfo);
1675   } else {
1676     Rtmp1 = op->tmp3()->as_register();
1677     select_different_registers(obj, dst, k_RInfo, klass_RInfo, Rtmp1);
1678   }
1679 
1680   assert_different_registers(obj, k_RInfo, klass_RInfo);
1681 

1682   __ cmpptr(obj, (int32_t)NULL_WORD);
1683   if (op->should_profile()) {
1684     Label not_null;
1685     __ jccb(Assembler::notEqual, not_null);
1686     // Object is null; update MDO and exit
1687     Register mdo  = klass_RInfo;
1688     __ mov_metadata(mdo, md->constant_encoding());
1689     Address data_addr(mdo, md->byte_offset_of_slot(data, DataLayout::flags_offset()));
1690     int header_bits = BitData::null_seen_byte_constant();
1691     __ orb(data_addr, header_bits);
1692     __ jmp(*obj_is_null);
1693     __ bind(not_null);
1694   } else {
1695     __ jcc(Assembler::equal, *obj_is_null);

1696   }
1697 
1698   if (!k->is_loaded()) {
1699     klass2reg_with_patching(k_RInfo, op->info_for_patch());
1700   } else {
1701 #ifdef _LP64
1702     __ mov_metadata(k_RInfo, k->constant_encoding());
1703 #endif // _LP64
1704   }
1705   __ verify_oop(obj);
1706 
1707   if (op->fast_check()) {
1708     // get object class
1709     // not a safepoint as obj null check happens earlier
1710 #ifdef _LP64
1711     if (UseCompressedClassPointers) {
1712       __ load_klass(Rtmp1, obj);
1713       __ cmpptr(k_RInfo, Rtmp1);
1714     } else {
1715       __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));




1662     assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check");
1663   }
1664   Label profile_cast_success, profile_cast_failure;
1665   Label *success_target = op->should_profile() ? &profile_cast_success : success;
1666   Label *failure_target = op->should_profile() ? &profile_cast_failure : failure;
1667 
1668   if (obj == k_RInfo) {
1669     k_RInfo = dst;
1670   } else if (obj == klass_RInfo) {
1671     klass_RInfo = dst;
1672   }
1673   if (k->is_loaded() && !UseCompressedClassPointers) {
1674     select_different_registers(obj, dst, k_RInfo, klass_RInfo);
1675   } else {
1676     Rtmp1 = op->tmp3()->as_register();
1677     select_different_registers(obj, dst, k_RInfo, klass_RInfo, Rtmp1);
1678   }
1679 
1680   assert_different_registers(obj, k_RInfo, klass_RInfo);
1681 
1682   if (op->need_null_check()) {
1683     __ cmpptr(obj, (int32_t)NULL_WORD);
1684     if (op->should_profile()) {
1685       Label not_null;
1686       __ jccb(Assembler::notEqual, not_null);
1687       // Object is null; update MDO and exit
1688       Register mdo  = klass_RInfo;
1689       __ mov_metadata(mdo, md->constant_encoding());
1690       Address data_addr(mdo, md->byte_offset_of_slot(data, DataLayout::flags_offset()));
1691       int header_bits = BitData::null_seen_byte_constant();
1692       __ orb(data_addr, header_bits);
1693       __ jmp(*obj_is_null);
1694       __ bind(not_null);
1695     } else {
1696       __ jcc(Assembler::equal, *obj_is_null);
1697     }
1698   }
1699 
1700   if (!k->is_loaded()) {
1701     klass2reg_with_patching(k_RInfo, op->info_for_patch());
1702   } else {
1703 #ifdef _LP64
1704     __ mov_metadata(k_RInfo, k->constant_encoding());
1705 #endif // _LP64
1706   }
1707   __ verify_oop(obj);
1708 
1709   if (op->fast_check()) {
1710     // get object class
1711     // not a safepoint as obj null check happens earlier
1712 #ifdef _LP64
1713     if (UseCompressedClassPointers) {
1714       __ load_klass(Rtmp1, obj);
1715       __ cmpptr(k_RInfo, Rtmp1);
1716     } else {
1717       __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));


< prev index next >