Top


定義場所(file name)

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

説明(description)

// Rewrite the byte codes of all of the methods of a class.
// The rewriter must be called exactly once. Rewriting must happen after
// verification but before the first method of the class is executed.

名前(function name)

void instanceKlass::rewrite_class(TRAPS) {

本体部(body)

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

      assert(is_loaded(), "must be loaded");

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

      instanceKlassHandle this_oop(THREAD, this->as_klassOop());

  {- -------------------------------------------
  (1) 既に rewrite 済みであれば, ここでリターン.
      ---------------------------------------- -}

      if (this_oop->is_rewritten()) {
        assert(this_oop()->is_shared(), "rewriting an unshared class?");
        return;
      }

  {- -------------------------------------------
  (1) Rewriter::rewrite() を呼んで, バイトコードの rewrite を行う.
      ---------------------------------------- -}

      Rewriter::rewrite(this_oop, CHECK);

  {- -------------------------------------------
  (1) rewrite したことをクラス内に記録しておく
      ---------------------------------------- -}

      this_oop->set_rewritten();
    }

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