Top


定義場所(file name)

hotspot/src/share/vm/runtime/compilationPolicy.cpp

名前(function name)

void CounterDecay::decay() {

本体部(body)

  {- -------------------------------------------
  (1) 現在時刻を記録しておく.
      ---------------------------------------- -}

      _last_timestamp = os::javaTimeMillis();

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

      // This operation is going to be performed only at the end of a safepoint
      // and hence GC's will not be going on, all Java mutators are suspended
      // at this point and hence SystemDictionary_lock is also not needed.
      assert(SafepointSynchronize::is_at_safepoint(), "can only be executed at a safepoint");

  {- -------------------------------------------
  (1) (変数宣言など)
      (classes_per_tick は, 一度に処理するクラス数)
      ---------------------------------------- -}

      int nclasses = SystemDictionary::number_of_classes();
      double classes_per_tick = nclasses * (CounterDecayMinIntervalLength * 1e-3 /
                                            CounterHalfLifeTime);

  {- -------------------------------------------
  (1) (以下のループで classes_per_tick 個だけのクラスオブジェクトを処理する)
      ---------------------------------------- -}

      for (int i = 0; i < classes_per_tick; i++) {

    {- -------------------------------------------
  (1.1) 処理対象の instanceKlass 内の各 methodOop に 
        CounterDecay::do_method() を適用する.
        ---------------------------------------- -}

        klassOop k = SystemDictionary::try_get_next_class();
        if (k != NULL && k->klass_part()->oop_is_instance()) {
          instanceKlass::cast(k)->methods_do(do_method);
        }
      }
    }

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