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(); |