comparison src/share/vm/code/nmethod.cpp @ 1135:e66fd840cb6b

6893081: method handle & invokedynamic code needs additional cleanup (post 6815692, 6858164) Summary: During the work for 6829187 we have fixed a number of basic bugs which are logically grouped with 6815692 and 6858164 but which must be reviewed and pushed separately. Reviewed-by: kvn, never
author twisti
date Mon, 04 Jan 2010 18:38:08 +0100
parents 032260830071
children dd57230ba8fe
comparison
equal deleted inserted replaced
1134:0910903272e5 1135:e66fd840cb6b
1761 } 1761 }
1762 assert(prev_offset == PcDesc::upper_offset_limit, 1762 assert(prev_offset == PcDesc::upper_offset_limit,
1763 "must end with a sentinel"); 1763 "must end with a sentinel");
1764 #endif //ASSERT 1764 #endif //ASSERT
1765 1765
1766 // Search for MethodHandle invokes and tag the nmethod.
1767 for (int i = 0; i < count; i++) {
1768 if (pcs[i].is_method_handle_invoke()) {
1769 set_has_method_handle_invokes(true);
1770 break;
1771 }
1772 }
1773
1766 int size = count * sizeof(PcDesc); 1774 int size = count * sizeof(PcDesc);
1767 assert(scopes_pcs_size() >= size, "oob"); 1775 assert(scopes_pcs_size() >= size, "oob");
1768 memcpy(scopes_pcs_begin(), pcs, size); 1776 memcpy(scopes_pcs_begin(), pcs, size);
1769 1777
1770 // Adjust the final sentinel downward. 1778 // Adjust the final sentinel downward.
2024 } 2032 }
2025 2033
2026 bool nmethod::is_deopt_pc(address pc) { 2034 bool nmethod::is_deopt_pc(address pc) {
2027 bool ret = pc == deopt_handler_begin(); 2035 bool ret = pc == deopt_handler_begin();
2028 return ret; 2036 return ret;
2037 }
2038
2039
2040 // -----------------------------------------------------------------------------
2041 // MethodHandle
2042
2043 bool nmethod::is_method_handle_return(address return_pc) {
2044 if (!has_method_handle_invokes()) return false;
2045 PcDesc* pd = pc_desc_at(return_pc);
2046 if (pd == NULL)
2047 return false;
2048 return pd->is_method_handle_invoke();
2029 } 2049 }
2030 2050
2031 2051
2032 // ----------------------------------------------------------------------------- 2052 // -----------------------------------------------------------------------------
2033 // Verification 2053 // Verification