Top


定義場所(file name)

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

名前(function name)

klassOop typeArrayKlass::create_klass(BasicType type, int scale,
                                      const char* name_str, TRAPS) {

本体部(body)

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

      typeArrayKlass o;

      Symbol* sym = NULL;
      if (name_str != NULL) {
        sym = SymbolTable::new_symbol(name_str, CHECK_NULL);
      }
      KlassHandle klassklass (THREAD, Universe::typeArrayKlassKlassObj());

  {- -------------------------------------------
  (1) arrayKlass::base_create_array_klass() を呼んで, 新しい arrayKlass を生成する.
      ---------------------------------------- -}

      arrayKlassHandle k = base_create_array_klass(o.vtbl_value(), header_size(), klassklass, CHECK_NULL);

  {- -------------------------------------------
  (1) 生成した arrayKlass のフィールドを初期化する
      ---------------------------------------- -}

      typeArrayKlass* ak = typeArrayKlass::cast(k());
      ak->set_name(sym);
      ak->set_layout_helper(array_layout_helper(type));
      assert(scale == (1 << ak->log2_element_size()), "scale must check out");
      assert(ak->oop_is_javaArray(), "sanity");
      assert(ak->oop_is_typeArray(), "sanity");
      ak->set_max_length(arrayOopDesc::max_array_length(type));
      assert(k()->size() > header_size(), "bad size");

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

      // Call complete_create_array_klass after all instance variables have been initialized.
      KlassHandle super (THREAD, k->super());
      complete_create_array_klass(k, super, CHECK_NULL);

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

      return k();
    }

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