comparison src/share/vm/interpreter/interpreterRuntime.cpp @ 941:8b46c4d82093

4957990: Perm heap bloat in JVM Summary: Treat ProfileData in MDO's as a source of weak, not strong, roots. Fixes the bug for stop-world collection -- the case of concurrent collection will be fixed separately. Reviewed-by: jcoomes, jmasa, kvn, never
author ysr
date Wed, 02 Sep 2009 00:04:29 -0700
parents be93aad57795
children 389049f3f393
comparison
equal deleted inserted replaced
940:8624da129f0b 941:8b46c4d82093
847 tty->print_cr(" at bci %d", bci); 847 tty->print_cr(" at bci %d", bci);
848 } 848 }
849 } 849 }
850 #endif // !PRODUCT 850 #endif // !PRODUCT
851 851
852 nmethod* InterpreterRuntime::frequency_counter_overflow(JavaThread* thread, address branch_bcp) {
853 nmethod* nm = frequency_counter_overflow_inner(thread, branch_bcp);
854 assert(branch_bcp != NULL || nm == NULL, "always returns null for non OSR requests");
855 if (branch_bcp != NULL && nm != NULL) {
856 // This was a successful request for an OSR nmethod. Because
857 // frequency_counter_overflow_inner ends with a safepoint check,
858 // nm could have been unloaded so look it up again. It's unsafe
859 // to examine nm directly since it might have been freed and used
860 // for something else.
861 frame fr = thread->last_frame();
862 methodOop method = fr.interpreter_frame_method();
863 int bci = method->bci_from(fr.interpreter_frame_bcp());
864 nm = method->lookup_osr_nmethod_for(bci);
865 }
866 return nm;
867 }
868
852 IRT_ENTRY(nmethod*, 869 IRT_ENTRY(nmethod*,
853 InterpreterRuntime::frequency_counter_overflow(JavaThread* thread, address branch_bcp)) 870 InterpreterRuntime::frequency_counter_overflow_inner(JavaThread* thread, address branch_bcp))
854 // use UnlockFlagSaver to clear and restore the _do_not_unlock_if_synchronized 871 // use UnlockFlagSaver to clear and restore the _do_not_unlock_if_synchronized
855 // flag, in case this method triggers classloading which will call into Java. 872 // flag, in case this method triggers classloading which will call into Java.
856 UnlockFlagSaver fs(thread); 873 UnlockFlagSaver fs(thread);
857 874
858 frame fr = thread->last_frame(); 875 frame fr = thread->last_frame();
921 objects_to_revoke->append(Handle(THREAD, kptr->obj())); 938 objects_to_revoke->append(Handle(THREAD, kptr->obj()));
922 } 939 }
923 } 940 }
924 BiasedLocking::revoke(objects_to_revoke); 941 BiasedLocking::revoke(objects_to_revoke);
925 } 942 }
926
927 return osr_nm; 943 return osr_nm;
928 } 944 }
929 } 945 }
930 IRT_END 946 IRT_END
931 947