Top


定義場所(file name)

hotspot/src/share/vm/interpreter/interpreterRuntime.cpp

名前(function name)

nmethod* InterpreterRuntime::frequency_counter_overflow(JavaThread* thread, address branch_bcp) {

本体部(body)

  {- -------------------------------------------
  (1) InterpreterRuntime::frequency_counter_overflow_inner() を呼んで, JIT コンパイル処理を開始する.
      ---------------------------------------- -}

      nmethod* nm = frequency_counter_overflow_inner(thread, branch_bcp);

  {- -------------------------------------------
  (1) (assert)
      ---------------------------------------- -}

      assert(branch_bcp != NULL || nm == NULL, "always returns null for non OSR requests");

  {- -------------------------------------------
  (1) 結果をリターン

      なお, 今回のコンパイルが OSR の場合でかつ JIT コンパイルが成功した場合, 
      結果として, 再度ルックアップし直したものを返す. #TODO
      ---------------------------------------- -}

      if (branch_bcp != NULL && nm != NULL) {
        // This was a successful request for an OSR nmethod.  Because
        // frequency_counter_overflow_inner ends with a safepoint check,
        // nm could have been unloaded so look it up again.  It's unsafe
        // to examine nm directly since it might have been freed and used
        // for something else.
        frame fr = thread->last_frame();
        methodOop method =  fr.interpreter_frame_method();
        int bci = method->bci_from(fr.interpreter_frame_bcp());
        nm = method->lookup_osr_nmethod_for(bci, CompLevel_none, false);
      }
      return nm;
    }

This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.