Top


定義場所(file name)

hotspot/src/share/vm/oops/constantPoolOop.hpp

名前(function name)

  void klass_at_put(int which, klassOop k) {

本体部(body)

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

        // Overwrite the old index with a GC friendly value so
        // that if G1 looks during the transition during oop_store it won't
        // assert the symbol is not an oop.
        *obj_at_addr_raw(which) = NULL;

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

        assert(k != NULL, "resolved class shouldn't be null");

  {- -------------------------------------------
  (1) which 引数で指定された箇所に
      k 引数で指定された klassOop をセット.
      ---------------------------------------- -}

        obj_at_put_without_check(which, k);

  {- -------------------------------------------
  (1) 該当箇所の tag を resolve 済み(JVM_CONSTANT_Class)に変更.

      (なおコメントによると, 
      インタープリタ中のコードでは, 
      tag が JVM_CONSTANT_Class になっている状態では constant pool から klassOop が取得できる, 
      と想定しているので, 
      リオーダを防ぐために release_tag_at_put() を用いてメモリバリアを張っている模様)
      ---------------------------------------- -}

        // The interpreter assumes when the tag is stored, the klass is resolved
        // and the klassOop is a klass rather than a Symbol*, so we need
        // hardware store ordering here.
        release_tag_at_put(which, JVM_CONSTANT_Class);

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

        if (UseConcMarkSweepGC) {
          // In case the earlier card-mark was consumed by a concurrent
          // marking thread before the tag was updated, redirty the card.
          obj_at_put_without_check(which, k);
        }
      }

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