842 frame fr = thread->last_frame();
843 methodOop method = fr.interpreter_frame_method();
844 int bci = method->bci_from(fr.interpreter_frame_bcp());
845 nm = method->lookup_osr_nmethod_for(bci, CompLevel_none, false);
846 }
847 return nm;
848 }
849
850 IRT_ENTRY(nmethod*,
851 InterpreterRuntime::frequency_counter_overflow_inner(JavaThread* thread, address branch_bcp))
852 // use UnlockFlagSaver to clear and restore the _do_not_unlock_if_synchronized
853 // flag, in case this method triggers classloading which will call into Java.
854 UnlockFlagSaver fs(thread);
855
856 frame fr = thread->last_frame();
857 assert(fr.is_interpreted_frame(), "must come from interpreter");
858 methodHandle method(thread, fr.interpreter_frame_method());
859 const int branch_bci = branch_bcp != NULL ? method->bci_from(branch_bcp) : InvocationEntryBci;
860 const int bci = branch_bcp != NULL ? method->bci_from(fr.interpreter_frame_bcp()) : InvocationEntryBci;
861
862 nmethod* osr_nm = CompilationPolicy::policy()->event(method, method, branch_bci, bci, CompLevel_none, NULL, thread);
863
864 if (osr_nm != NULL) {
865 // We may need to do on-stack replacement which requires that no
866 // monitors in the activation are biased because their
867 // BasicObjectLocks will need to migrate during OSR. Force
868 // unbiasing of all monitors in the activation now (even though
869 // the OSR nmethod might be invalidated) because we don't have a
870 // safepoint opportunity later once the migration begins.
871 if (UseBiasedLocking) {
872 ResourceMark rm;
873 GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
874 for( BasicObjectLock *kptr = fr.interpreter_frame_monitor_end();
875 kptr < fr.interpreter_frame_monitor_begin();
876 kptr = fr.next_monitor_in_interpreter_frame(kptr) ) {
877 if( kptr->obj() != NULL ) {
878 objects_to_revoke->append(Handle(THREAD, kptr->obj()));
879 }
880 }
881 BiasedLocking::revoke(objects_to_revoke);
882 }
|
842 frame fr = thread->last_frame();
843 methodOop method = fr.interpreter_frame_method();
844 int bci = method->bci_from(fr.interpreter_frame_bcp());
845 nm = method->lookup_osr_nmethod_for(bci, CompLevel_none, false);
846 }
847 return nm;
848 }
849
850 IRT_ENTRY(nmethod*,
851 InterpreterRuntime::frequency_counter_overflow_inner(JavaThread* thread, address branch_bcp))
852 // use UnlockFlagSaver to clear and restore the _do_not_unlock_if_synchronized
853 // flag, in case this method triggers classloading which will call into Java.
854 UnlockFlagSaver fs(thread);
855
856 frame fr = thread->last_frame();
857 assert(fr.is_interpreted_frame(), "must come from interpreter");
858 methodHandle method(thread, fr.interpreter_frame_method());
859 const int branch_bci = branch_bcp != NULL ? method->bci_from(branch_bcp) : InvocationEntryBci;
860 const int bci = branch_bcp != NULL ? method->bci_from(fr.interpreter_frame_bcp()) : InvocationEntryBci;
861
862 assert(!HAS_PENDING_EXCEPTION, "Should not have any exceptions pending");
863 nmethod* osr_nm = CompilationPolicy::policy()->event(method, method, branch_bci, bci, CompLevel_none, NULL, thread);
864 assert(!HAS_PENDING_EXCEPTION, "Event handler should not throw any exceptions");
865
866 if (osr_nm != NULL) {
867 // We may need to do on-stack replacement which requires that no
868 // monitors in the activation are biased because their
869 // BasicObjectLocks will need to migrate during OSR. Force
870 // unbiasing of all monitors in the activation now (even though
871 // the OSR nmethod might be invalidated) because we don't have a
872 // safepoint opportunity later once the migration begins.
873 if (UseBiasedLocking) {
874 ResourceMark rm;
875 GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
876 for( BasicObjectLock *kptr = fr.interpreter_frame_monitor_end();
877 kptr < fr.interpreter_frame_monitor_begin();
878 kptr = fr.next_monitor_in_interpreter_frame(kptr) ) {
879 if( kptr->obj() != NULL ) {
880 objects_to_revoke->append(Handle(THREAD, kptr->obj()));
881 }
882 }
883 BiasedLocking::revoke(objects_to_revoke);
884 }
|