Top


定義場所(file name)

hotspot/src/share/vm/classfile/systemDictionary.cpp

説明(description)

// Look for a loaded instance or array klass by name.  Do not do any loading.
// return NULL in case of error.

名前(function name)

klassOop SystemDictionary::find_instance_or_array_klass(Symbol* class_name,
                                                        Handle class_loader,
                                                        Handle protection_domain,
                                                        TRAPS) {

本体部(body)

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

      klassOop k = NULL;

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

      assert(class_name != NULL, "class name must be non NULL");

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

      // Try to get one of the well-known klasses.
      if (LinkWellKnownClasses) {
        k = find_well_known_klass(class_name);
        if (k != NULL) {
          return k;
        }
      }

  {- -------------------------------------------
  (1) 結果を取得する.
      取得は, 型に応じて以下のように行う.
      * プリミティブ型の配列クラスの場合: (一次元配列のクラスだけでなく, 多次元配列のクラスも含む)
        Universe::typeArrayKlassObj() 及び Klass::array_klass_or_null() で取得.
      * オブジェクト型の配列クラスの場合: (一次元配列のクラスだけでなく, 多次元配列のクラスも含む)
        SystemDictionary::find() 及び Klass::array_klass_or_null() で取得.
      * 配列クラスではない場合:
        SystemDictionary::find() で取得.
      ---------------------------------------- -}

      if (FieldType::is_array(class_name)) {
        // The name refers to an array.  Parse the name.
        // dimension and object_key in FieldArrayInfo are assigned as a
        // side-effect of this call
        FieldArrayInfo fd;
        BasicType t = FieldType::get_array_info(class_name, fd, CHECK_(NULL));
        if (t != T_OBJECT) {
          k = Universe::typeArrayKlassObj(t);
        } else {
          k = SystemDictionary::find(fd.object_key(), class_loader, protection_domain, THREAD);
        }
        if (k != NULL) {
          k = Klass::cast(k)->array_klass_or_null(fd.dimension());
        }
      } else {
        k = find(class_name, class_loader, protection_domain, THREAD);
      }

  {- -------------------------------------------
  (1) 結果をリターン
      ---------------------------------------- -}

      return k;
    }

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