Top


定義場所(file name)

hotspot/src/share/vm/oops/methodOop.cpp

名前(function name)

static void clear_matches(methodOop m, int bci) {

本体部(body)

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

      instanceKlass* ik = instanceKlass::cast(m->method_holder());
      BreakpointInfo* prev_bp = NULL;
      BreakpointInfo* next_bp;

  {- -------------------------------------------
  (1) bci 引数に該当する BreakpointInfo オブジェクトを探しだし, BreakpointInfo::clear() を呼ぶ.
      ---------------------------------------- -}

      for (BreakpointInfo* bp = ik->breakpoints(); bp != NULL; bp = next_bp) {
        next_bp = bp->next();
        // bci value of -1 is used to delete all breakpoints in method m (ex: clear_all_breakpoint).
        if (bci >= 0 ? bp->match(m, bci) : bp->match(m)) {

    {- -------------------------------------------
  (1.1) (BreakpointInfo::clear() を呼び, リストから削除し, BreakpointInfo オブジェクト自体も解放する)
        ---------------------------------------- -}

          // do this first:
          bp->clear(m);
          // unhook it
          if (prev_bp != NULL)
            prev_bp->set_next(next_bp);
          else
            ik->set_breakpoints(next_bp);
          delete bp;
          // When class is redefined JVMTI sets breakpoint in all versions of EMCP methods
          // at same location. So we have multiple matching (method_index and bci)
          // BreakpointInfo nodes in BreakpointInfo list. We should just delete one
          // breakpoint for clear_breakpoint request and keep all other method versions
          // BreakpointInfo for future clear_breakpoint request.
          // bcivalue of -1 is used to clear all breakpoints (see clear_all_breakpoints)
          // which is being called when class is unloaded. We delete all the Breakpoint
          // information for all versions of method. We may not correctly restore the original
          // bytecode in all method versions, but that is ok. Because the class is being unloaded
          // so these methods won't be used anymore.
          if (bci >= 0) {
            break;
          }
        } else {
          // This one is a keeper.
          prev_bp = bp;
        }
      }
    }

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