8000659: NPG: ClassCastExceptions are unexpectedly thrown when testing nashorn
Summary: Treat the oops in invoke_method_table() as strong roots when ClassUnloading is enabled.
Reviewed-by: kamg, coleenp
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp Mon Oct 08 09:12:31 2012 -0700
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp Tue Oct 09 22:12:25 2012 +0200
@@ -1749,6 +1749,9 @@
blk->do_oop(&_system_loader_lock_obj);
dictionary()->always_strong_oops_do(blk);
+
+ // Visit extra methods
+ invoke_method_table()->oops_do(blk);
}
void SystemDictionary::always_strong_classes_do(KlassClosure* closure) {