comparison src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @ 989:148e5441d916

6863023: need non-perm oops in code cache for JSR 292 Summary: Make a special root-list for those few nmethods which might contain non-perm oops. Reviewed-by: twisti, kvn, never, jmasa, ysr
author jrose
date Tue, 15 Sep 2009 21:53:47 -0700
parents c96bf21b756f
children 323bd24c6520
comparison
equal deleted inserted replaced
987:00977607da34 989:148e5441d916
1636 assert_different_registers(obj, k_RInfo, klass_RInfo); 1636 assert_different_registers(obj, k_RInfo, klass_RInfo);
1637 if (!k->is_loaded()) { 1637 if (!k->is_loaded()) {
1638 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); 1638 jobject2reg_with_patching(k_RInfo, op->info_for_patch());
1639 } else { 1639 } else {
1640 #ifdef _LP64 1640 #ifdef _LP64
1641 __ movoop(k_RInfo, k->encoding()); 1641 __ movoop(k_RInfo, k->constant_encoding());
1642 #else 1642 #else
1643 k_RInfo = noreg; 1643 k_RInfo = noreg;
1644 #endif // _LP64 1644 #endif // _LP64
1645 } 1645 }
1646 assert(obj != k_RInfo, "must be different"); 1646 assert(obj != k_RInfo, "must be different");
1659 } 1659 }
1660 ciProfileData* data = md->bci_to_data(bci); 1660 ciProfileData* data = md->bci_to_data(bci);
1661 assert(data != NULL, "need data for checkcast"); 1661 assert(data != NULL, "need data for checkcast");
1662 assert(data->is_BitData(), "need BitData for checkcast"); 1662 assert(data->is_BitData(), "need BitData for checkcast");
1663 Register mdo = klass_RInfo; 1663 Register mdo = klass_RInfo;
1664 __ movoop(mdo, md->encoding()); 1664 __ movoop(mdo, md->constant_encoding());
1665 Address data_addr(mdo, md->byte_offset_of_slot(data, DataLayout::header_offset())); 1665 Address data_addr(mdo, md->byte_offset_of_slot(data, DataLayout::header_offset()));
1666 int header_bits = DataLayout::flag_mask_to_header_mask(BitData::null_seen_byte_constant()); 1666 int header_bits = DataLayout::flag_mask_to_header_mask(BitData::null_seen_byte_constant());
1667 __ orl(data_addr, header_bits); 1667 __ orl(data_addr, header_bits);
1668 __ jmp(done); 1668 __ jmp(done);
1669 __ bind(profile_done); 1669 __ bind(profile_done);
1677 // not a safepoint as obj null check happens earlier 1677 // not a safepoint as obj null check happens earlier
1678 if (k->is_loaded()) { 1678 if (k->is_loaded()) {
1679 #ifdef _LP64 1679 #ifdef _LP64
1680 __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes())); 1680 __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
1681 #else 1681 #else
1682 __ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->encoding()); 1682 __ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->constant_encoding());
1683 #endif // _LP64 1683 #endif // _LP64
1684 } else { 1684 } else {
1685 __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes())); 1685 __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
1686 1686
1687 } 1687 }
1694 if (k->is_loaded()) { 1694 if (k->is_loaded()) {
1695 // See if we get an immediate positive hit 1695 // See if we get an immediate positive hit
1696 #ifdef _LP64 1696 #ifdef _LP64
1697 __ cmpptr(k_RInfo, Address(klass_RInfo, k->super_check_offset())); 1697 __ cmpptr(k_RInfo, Address(klass_RInfo, k->super_check_offset()));
1698 #else 1698 #else
1699 __ cmpoop(Address(klass_RInfo, k->super_check_offset()), k->encoding()); 1699 __ cmpoop(Address(klass_RInfo, k->super_check_offset()), k->constant_encoding());
1700 #endif // _LP64 1700 #endif // _LP64
1701 if (sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes() != k->super_check_offset()) { 1701 if (sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes() != k->super_check_offset()) {
1702 __ jcc(Assembler::notEqual, *stub->entry()); 1702 __ jcc(Assembler::notEqual, *stub->entry());
1703 } else { 1703 } else {
1704 // See if we get an immediate positive hit 1704 // See if we get an immediate positive hit
1705 __ jcc(Assembler::equal, done); 1705 __ jcc(Assembler::equal, done);
1706 // check for self 1706 // check for self
1707 #ifdef _LP64 1707 #ifdef _LP64
1708 __ cmpptr(klass_RInfo, k_RInfo); 1708 __ cmpptr(klass_RInfo, k_RInfo);
1709 #else 1709 #else
1710 __ cmpoop(klass_RInfo, k->encoding()); 1710 __ cmpoop(klass_RInfo, k->constant_encoding());
1711 #endif // _LP64 1711 #endif // _LP64
1712 __ jcc(Assembler::equal, done); 1712 __ jcc(Assembler::equal, done);
1713 1713
1714 __ push(klass_RInfo); 1714 __ push(klass_RInfo);
1715 #ifdef _LP64 1715 #ifdef _LP64
1716 __ push(k_RInfo); 1716 __ push(k_RInfo);
1717 #else 1717 #else
1718 __ pushoop(k->encoding()); 1718 __ pushoop(k->constant_encoding());
1719 #endif // _LP64 1719 #endif // _LP64
1720 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); 1720 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id)));
1721 __ pop(klass_RInfo); 1721 __ pop(klass_RInfo);
1722 __ pop(klass_RInfo); 1722 __ pop(klass_RInfo);
1723 // result is a boolean 1723 // result is a boolean
1761 // patching may screw with our temporaries on sparc, 1761 // patching may screw with our temporaries on sparc,
1762 // so let's do it before loading the class 1762 // so let's do it before loading the class
1763 if (!k->is_loaded()) { 1763 if (!k->is_loaded()) {
1764 jobject2reg_with_patching(k_RInfo, op->info_for_patch()); 1764 jobject2reg_with_patching(k_RInfo, op->info_for_patch());
1765 } else { 1765 } else {
1766 LP64_ONLY(__ movoop(k_RInfo, k->encoding())); 1766 LP64_ONLY(__ movoop(k_RInfo, k->constant_encoding()));
1767 } 1767 }
1768 assert(obj != k_RInfo, "must be different"); 1768 assert(obj != k_RInfo, "must be different");
1769 1769
1770 __ verify_oop(obj); 1770 __ verify_oop(obj);
1771 if (op->fast_check()) { 1771 if (op->fast_check()) {
1772 __ cmpptr(obj, (int32_t)NULL_WORD); 1772 __ cmpptr(obj, (int32_t)NULL_WORD);
1773 __ jcc(Assembler::equal, zero); 1773 __ jcc(Assembler::equal, zero);
1774 // get object class 1774 // get object class
1775 // not a safepoint as obj null check happens earlier 1775 // not a safepoint as obj null check happens earlier
1776 if (LP64_ONLY(false &&) k->is_loaded()) { 1776 if (LP64_ONLY(false &&) k->is_loaded()) {
1777 NOT_LP64(__ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->encoding())); 1777 NOT_LP64(__ cmpoop(Address(obj, oopDesc::klass_offset_in_bytes()), k->constant_encoding()));
1778 k_RInfo = noreg; 1778 k_RInfo = noreg;
1779 } else { 1779 } else {
1780 __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes())); 1780 __ cmpptr(k_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
1781 1781
1782 } 1782 }
1789 __ movptr(klass_RInfo, Address(obj, oopDesc::klass_offset_in_bytes())); 1789 __ movptr(klass_RInfo, Address(obj, oopDesc::klass_offset_in_bytes()));
1790 1790
1791 #ifndef _LP64 1791 #ifndef _LP64
1792 if (k->is_loaded()) { 1792 if (k->is_loaded()) {
1793 // See if we get an immediate positive hit 1793 // See if we get an immediate positive hit
1794 __ cmpoop(Address(klass_RInfo, k->super_check_offset()), k->encoding()); 1794 __ cmpoop(Address(klass_RInfo, k->super_check_offset()), k->constant_encoding());
1795 __ jcc(Assembler::equal, one); 1795 __ jcc(Assembler::equal, one);
1796 if (sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes() == k->super_check_offset()) { 1796 if (sizeof(oopDesc) + Klass::secondary_super_cache_offset_in_bytes() == k->super_check_offset()) {
1797 // check for self 1797 // check for self
1798 __ cmpoop(klass_RInfo, k->encoding()); 1798 __ cmpoop(klass_RInfo, k->constant_encoding());
1799 __ jcc(Assembler::equal, one); 1799 __ jcc(Assembler::equal, one);
1800 __ push(klass_RInfo); 1800 __ push(klass_RInfo);
1801 __ pushoop(k->encoding()); 1801 __ pushoop(k->constant_encoding());
1802 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); 1802 __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::slow_subtype_check_id)));
1803 __ pop(klass_RInfo); 1803 __ pop(klass_RInfo);
1804 __ pop(dst); 1804 __ pop(dst);
1805 __ jmp(done); 1805 __ jmp(done);
1806 } 1806 }
3110 // object array case, if no type check is needed then either the 3110 // object array case, if no type check is needed then either the
3111 // dst type is exactly the expected type and the src type is a 3111 // dst type is exactly the expected type and the src type is a
3112 // subtype which we can't check or src is the same array as dst 3112 // subtype which we can't check or src is the same array as dst
3113 // but not necessarily exactly of type default_type. 3113 // but not necessarily exactly of type default_type.
3114 Label known_ok, halt; 3114 Label known_ok, halt;
3115 __ movoop(tmp, default_type->encoding()); 3115 __ movoop(tmp, default_type->constant_encoding());
3116 if (basic_type != T_OBJECT) { 3116 if (basic_type != T_OBJECT) {
3117 __ cmpptr(tmp, dst_klass_addr); 3117 __ cmpptr(tmp, dst_klass_addr);
3118 __ jcc(Assembler::notEqual, halt); 3118 __ jcc(Assembler::notEqual, halt);
3119 __ cmpptr(tmp, src_klass_addr); 3119 __ cmpptr(tmp, src_klass_addr);
3120 __ jcc(Assembler::equal, known_ok); 3120 __ jcc(Assembler::equal, known_ok);
3198 } 3198 }
3199 ciProfileData* data = md->bci_to_data(bci); 3199 ciProfileData* data = md->bci_to_data(bci);
3200 assert(data->is_CounterData(), "need CounterData for calls"); 3200 assert(data->is_CounterData(), "need CounterData for calls");
3201 assert(op->mdo()->is_single_cpu(), "mdo must be allocated"); 3201 assert(op->mdo()->is_single_cpu(), "mdo must be allocated");
3202 Register mdo = op->mdo()->as_register(); 3202 Register mdo = op->mdo()->as_register();
3203 __ movoop(mdo, md->encoding()); 3203 __ movoop(mdo, md->constant_encoding());
3204 Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset())); 3204 Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()));
3205 __ addl(counter_addr, DataLayout::counter_increment); 3205 __ addl(counter_addr, DataLayout::counter_increment);
3206 Bytecodes::Code bc = method->java_code_at_bci(bci); 3206 Bytecodes::Code bc = method->java_code_at_bci(bci);
3207 // Perform additional virtual call profiling for invokevirtual and 3207 // Perform additional virtual call profiling for invokevirtual and
3208 // invokeinterface bytecodes 3208 // invokeinterface bytecodes
3238 // VirtualCallData rather than just the first time 3238 // VirtualCallData rather than just the first time
3239 for (i = 0; i < VirtualCallData::row_limit(); i++) { 3239 for (i = 0; i < VirtualCallData::row_limit(); i++) {
3240 ciKlass* receiver = vc_data->receiver(i); 3240 ciKlass* receiver = vc_data->receiver(i);
3241 if (receiver == NULL) { 3241 if (receiver == NULL) {
3242 Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i))); 3242 Address recv_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)));
3243 __ movoop(recv_addr, known_klass->encoding()); 3243 __ movoop(recv_addr, known_klass->constant_encoding());
3244 Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i))); 3244 Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)));
3245 __ addl(data_addr, DataLayout::counter_increment); 3245 __ addl(data_addr, DataLayout::counter_increment);
3246 return; 3246 return;
3247 } 3247 }
3248 } 3248 }