Mercurial > hg > truffle
comparison src/share/vm/code/nmethod.cpp @ 10253:4674e409a9e6
8014024: NPG: keep compiled ic methods from being deallocated in redefine classes
Summary: Walk the compiledIC relocation records to keep Method* from being deallocated.
Reviewed-by: dlong, kvn
author | coleenp |
---|---|
date | Tue, 07 May 2013 18:51:31 -0400 |
parents | a7fb14888912 |
children | 28e5aed7f3a6 |
comparison
equal
deleted
inserted
replaced
10252:712a1e9c91f3 | 10253:4674e409a9e6 |
---|---|
1792 "metadata must be found in exactly one place"); | 1792 "metadata must be found in exactly one place"); |
1793 if (r->metadata_is_immediate() && r->metadata_value() != NULL) { | 1793 if (r->metadata_is_immediate() && r->metadata_value() != NULL) { |
1794 Metadata* md = r->metadata_value(); | 1794 Metadata* md = r->metadata_value(); |
1795 f(md); | 1795 f(md); |
1796 } | 1796 } |
1797 } else if (iter.type() == relocInfo::virtual_call_type) { | |
1798 // Check compiledIC holders associated with this nmethod | |
1799 CompiledIC *ic = CompiledIC_at(iter.reloc()); | |
1800 if (ic->is_icholder_call()) { | |
1801 CompiledICHolder* cichk = ic->cached_icholder(); | |
1802 f(cichk->holder_method()); | |
1803 f(cichk->holder_klass()); | |
1804 } else { | |
1805 Metadata* ic_oop = ic->cached_metadata(); | |
1806 if (ic_oop != NULL) { | |
1807 f(ic_oop); | |
1808 } | |
1809 } | |
1797 } | 1810 } |
1798 } | 1811 } |
1799 } | 1812 } |
1800 | 1813 |
1801 // Visit the metadata section | 1814 // Visit the metadata section |
1802 for (Metadata** p = metadata_begin(); p < metadata_end(); p++) { | 1815 for (Metadata** p = metadata_begin(); p < metadata_end(); p++) { |
1803 if (*p == Universe::non_oop_word() || *p == NULL) continue; // skip non-oops | 1816 if (*p == Universe::non_oop_word() || *p == NULL) continue; // skip non-oops |
1804 Metadata* md = *p; | 1817 Metadata* md = *p; |
1805 f(md); | 1818 f(md); |
1806 } | 1819 } |
1820 | |
1807 // Call function Method*, not embedded in these other places. | 1821 // Call function Method*, not embedded in these other places. |
1808 if (_method != NULL) f(_method); | 1822 if (_method != NULL) f(_method); |
1809 } | 1823 } |
1810 | 1824 |
1811 | 1825 |