hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
changeset 3696 9e5d9b5e1049
parent 2570 ecc7862946d4
child 4429 d7eb4e2099aa
equal deleted inserted replaced
3695:421cfcc8843c 3696:9e5d9b5e1049
   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