# HG changeset patch # User coleenp # Date 1367967091 14400 # Node ID 4674e409a9e66c0ee00e7a7849cef3cfec8654db # Parent 712a1e9c91f314ca3d920a57a0e70ae29a31c3da 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 diff -r 712a1e9c91f3 -r 4674e409a9e6 src/share/vm/code/nmethod.cpp --- a/src/share/vm/code/nmethod.cpp Tue May 07 09:46:15 2013 -0400 +++ b/src/share/vm/code/nmethod.cpp Tue May 07 18:51:31 2013 -0400 @@ -1794,6 +1794,19 @@ Metadata* md = r->metadata_value(); f(md); } + } else if (iter.type() == relocInfo::virtual_call_type) { + // Check compiledIC holders associated with this nmethod + CompiledIC *ic = CompiledIC_at(iter.reloc()); + if (ic->is_icholder_call()) { + CompiledICHolder* cichk = ic->cached_icholder(); + f(cichk->holder_method()); + f(cichk->holder_klass()); + } else { + Metadata* ic_oop = ic->cached_metadata(); + if (ic_oop != NULL) { + f(ic_oop); + } + } } } } @@ -1804,6 +1817,7 @@ Metadata* md = *p; f(md); } + // Call function Method*, not embedded in these other places. if (_method != NULL) f(_method); }