Top


定義場所(file name)

hotspot/src/cpu/x86/vm/interp_masm_x86_64.cpp

名前(function name)

void InterpreterMacroAssembler::check_and_handle_earlyret(Register java_thread) {

本体部(body)

  {- -------------------------------------------
  (1) (JvmtiExport::can_force_early_return() が true でない場合は, (何もする必要が無いので) 以降の処理は全て省略)
      ---------------------------------------- -}

      if (JvmtiExport::can_force_early_return()) {

  {- -------------------------------------------
  (1) (変数宣言など)
      ---------------------------------------- -}

        Label L;

  {- -------------------------------------------
  (1) コード生成:
      「もし カレントスレッドが JvmtiThreadState を持っており (= JavaThread::jvmti_thread_state() が NULL ではなく),
        かつその JvmtiThreadState::_earlyret_state フィールドの値が JvmtiThreadState::earlyret_pending であれば,
        Interpreter::remove_activation_early_entry() が返すアドレスにジャンプする.」
      ---------------------------------------- -}

        movptr(c_rarg0, Address(r15_thread, JavaThread::jvmti_thread_state_offset()));
        testptr(c_rarg0, c_rarg0);
        jcc(Assembler::zero, L); // if (thread->jvmti_thread_state() == NULL) exit;

        // Initiate earlyret handling only if it is not already being processed.
        // If the flag has the earlyret_processing bit set, it means that this code
        // is called *during* earlyret handling - we don't want to reenter.
        movl(c_rarg0, Address(c_rarg0, JvmtiThreadState::earlyret_state_offset()));
        cmpl(c_rarg0, JvmtiThreadState::earlyret_pending);
        jcc(Assembler::notEqual, L);

        // Call Interpreter::remove_activation_early_entry() to get the address of the
        // same-named entrypoint in the generated interpreter code.
        movptr(c_rarg0, Address(r15_thread, JavaThread::jvmti_thread_state_offset()));
        movl(c_rarg0, Address(c_rarg0, JvmtiThreadState::earlyret_tos_offset()));
        call_VM_leaf(CAST_FROM_FN_PTR(address, Interpreter::remove_activation_early_entry), c_rarg0);
        jmp(rax);
        bind(L);
      }
    }

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