1661 k_RInfo = dst; 1662 } else if (obj == klass_RInfo) { 1663 klass_RInfo = dst; 1664 } 1665 if (k->is_loaded() && !UseCompressedClassPointers) { 1666 select_different_registers(obj, dst, k_RInfo, klass_RInfo); 1667 } else { 1668 Rtmp1 = op->tmp3()->as_register(); 1669 select_different_registers(obj, dst, k_RInfo, klass_RInfo, Rtmp1); 1670 } 1671 1672 assert_different_registers(obj, k_RInfo, klass_RInfo); 1673 1674 __ cmpptr(obj, (int32_t)NULL_WORD); 1675 if (op->should_profile()) { 1676 Label not_null; 1677 __ jccb(Assembler::notEqual, not_null); 1678 // Object is null; update MDO and exit 1679 Register mdo = klass_RInfo; 1680 __ mov_metadata(mdo, md->constant_encoding()); 1681 Address data_addr(mdo, md->byte_offset_of_slot(data, DataLayout::header_offset())); 1682 int header_bits = DataLayout::flag_mask_to_header_mask(BitData::null_seen_byte_constant()); 1683 __ orl(data_addr, header_bits); 1684 __ jmp(*obj_is_null); 1685 __ bind(not_null); 1686 } else { 1687 __ jcc(Assembler::equal, *obj_is_null); 1688 } 1689 1690 if (!k->is_loaded()) { 1691 klass2reg_with_patching(k_RInfo, op->info_for_patch()); 1692 } else { 1693 #ifdef _LP64 1694 __ mov_metadata(k_RInfo, k->constant_encoding()); 1695 #endif // _LP64 1696 } 1697 __ verify_oop(obj); 1698 1699 if (op->fast_check()) { 1700 // get object class 1701 // not a safepoint as obj null check happens earlier 1702 #ifdef _LP64 1703 if (UseCompressedClassPointers) { 1807 ciMethod* method = op->profiled_method(); 1808 assert(method != NULL, "Should have method"); 1809 int bci = op->profiled_bci(); 1810 md = method->method_data_or_null(); 1811 assert(md != NULL, "Sanity"); 1812 data = md->bci_to_data(bci); 1813 assert(data != NULL, "need data for type check"); 1814 assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); 1815 } 1816 Label profile_cast_success, profile_cast_failure, done; 1817 Label *success_target = op->should_profile() ? &profile_cast_success : &done; 1818 Label *failure_target = op->should_profile() ? &profile_cast_failure : stub->entry(); 1819 1820 __ cmpptr(value, (int32_t)NULL_WORD); 1821 if (op->should_profile()) { 1822 Label not_null; 1823 __ jccb(Assembler::notEqual, not_null); 1824 // Object is null; update MDO and exit 1825 Register mdo = klass_RInfo; 1826 __ mov_metadata(mdo, md->constant_encoding()); 1827 Address data_addr(mdo, md->byte_offset_of_slot(data, DataLayout::header_offset())); 1828 int header_bits = DataLayout::flag_mask_to_header_mask(BitData::null_seen_byte_constant()); 1829 __ orl(data_addr, header_bits); 1830 __ jmp(done); 1831 __ bind(not_null); 1832 } else { 1833 __ jcc(Assembler::equal, done); 1834 } 1835 1836 add_debug_info_for_null_check_here(op->info_for_exception()); 1837 __ load_klass(k_RInfo, array); 1838 __ load_klass(klass_RInfo, value); 1839 1840 // get instance klass (it's already uncompressed) 1841 __ movptr(k_RInfo, Address(k_RInfo, ObjArrayKlass::element_klass_offset())); 1842 // perform the fast part of the checking logic 1843 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, NULL); 1844 // call out-of-line instance of __ check_klass_subtype_slow_path(...): 1845 __ push(klass_RInfo); 1846 __ push(k_RInfo); 1847 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); 1848 __ pop(klass_RInfo); 1849 __ pop(k_RInfo); | 1661 k_RInfo = dst; 1662 } else if (obj == klass_RInfo) { 1663 klass_RInfo = dst; 1664 } 1665 if (k->is_loaded() && !UseCompressedClassPointers) { 1666 select_different_registers(obj, dst, k_RInfo, klass_RInfo); 1667 } else { 1668 Rtmp1 = op->tmp3()->as_register(); 1669 select_different_registers(obj, dst, k_RInfo, klass_RInfo, Rtmp1); 1670 } 1671 1672 assert_different_registers(obj, k_RInfo, klass_RInfo); 1673 1674 __ cmpptr(obj, (int32_t)NULL_WORD); 1675 if (op->should_profile()) { 1676 Label not_null; 1677 __ jccb(Assembler::notEqual, not_null); 1678 // Object is null; update MDO and exit 1679 Register mdo = klass_RInfo; 1680 __ mov_metadata(mdo, md->constant_encoding()); 1681 Address data_addr(mdo, md->byte_offset_of_slot(data, DataLayout::flags_offset())); 1682 int header_bits = BitData::null_seen_byte_constant(); 1683 __ orb(data_addr, header_bits); 1684 __ jmp(*obj_is_null); 1685 __ bind(not_null); 1686 } else { 1687 __ jcc(Assembler::equal, *obj_is_null); 1688 } 1689 1690 if (!k->is_loaded()) { 1691 klass2reg_with_patching(k_RInfo, op->info_for_patch()); 1692 } else { 1693 #ifdef _LP64 1694 __ mov_metadata(k_RInfo, k->constant_encoding()); 1695 #endif // _LP64 1696 } 1697 __ verify_oop(obj); 1698 1699 if (op->fast_check()) { 1700 // get object class 1701 // not a safepoint as obj null check happens earlier 1702 #ifdef _LP64 1703 if (UseCompressedClassPointers) { 1807 ciMethod* method = op->profiled_method(); 1808 assert(method != NULL, "Should have method"); 1809 int bci = op->profiled_bci(); 1810 md = method->method_data_or_null(); 1811 assert(md != NULL, "Sanity"); 1812 data = md->bci_to_data(bci); 1813 assert(data != NULL, "need data for type check"); 1814 assert(data->is_ReceiverTypeData(), "need ReceiverTypeData for type check"); 1815 } 1816 Label profile_cast_success, profile_cast_failure, done; 1817 Label *success_target = op->should_profile() ? &profile_cast_success : &done; 1818 Label *failure_target = op->should_profile() ? &profile_cast_failure : stub->entry(); 1819 1820 __ cmpptr(value, (int32_t)NULL_WORD); 1821 if (op->should_profile()) { 1822 Label not_null; 1823 __ jccb(Assembler::notEqual, not_null); 1824 // Object is null; update MDO and exit 1825 Register mdo = klass_RInfo; 1826 __ mov_metadata(mdo, md->constant_encoding()); 1827 Address data_addr(mdo, md->byte_offset_of_slot(data, DataLayout::flags_offset())); 1828 int header_bits = BitData::null_seen_byte_constant(); 1829 __ orb(data_addr, header_bits); 1830 __ jmp(done); 1831 __ bind(not_null); 1832 } else { 1833 __ jcc(Assembler::equal, done); 1834 } 1835 1836 add_debug_info_for_null_check_here(op->info_for_exception()); 1837 __ load_klass(k_RInfo, array); 1838 __ load_klass(klass_RInfo, value); 1839 1840 // get instance klass (it's already uncompressed) 1841 __ movptr(k_RInfo, Address(k_RInfo, ObjArrayKlass::element_klass_offset())); 1842 // perform the fast part of the checking logic 1843 __ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, NULL); 1844 // call out-of-line instance of __ check_klass_subtype_slow_path(...): 1845 __ push(klass_RInfo); 1846 __ push(k_RInfo); 1847 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); 1848 __ pop(klass_RInfo); 1849 __ pop(k_RInfo); |