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

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

  arrayKlassHandle k = base_create_array_klass(o.vtbl_value(), header_size(), klassklass, CHECK_NULL);
  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");

  // 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);

  return k();
}
Пример #2
0
klassOop constantPoolCacheKlass::create_klass(TRAPS) {
  constantPoolCacheKlass o;
  KlassHandle klassklass(THREAD, Universe::arrayKlassKlassObj());  
  arrayKlassHandle k = base_create_array_klass(o.vtbl_value(), header_size(), klassklass, CHECK_0);
  KlassHandle super (THREAD, k->super());
  complete_create_array_klass(k, super, CHECK_0);
  return k();
}
klassOop constantPoolCacheKlass::create_klass(TRAPS) {
  constantPoolCacheKlass o;
  KlassHandle klassklass(THREAD, Universe::arrayKlassKlassObj());  
arrayKlassHandle k=base_create_array_klass(o.vtbl_value(),header_size(),klassklass,constantPoolCacheKlass_kid,CHECK_NULL);
  KlassHandle super (THREAD, k->super());
  complete_create_array_klass(k, super, CHECK_NULL);
  KlassTable::bindReservedKlassId(k(), constantPoolCacheKlass_kid);
  return k();
}
Пример #4
0
TypeArrayKlass* TypeArrayKlass::create_klass(BasicType type,
        const char* name_str, TRAPS) {
    Symbol* sym = NULL;
    if (name_str != NULL) {
        sym = SymbolTable::new_permanent_symbol(name_str, CHECK_NULL);
    }

    ClassLoaderData* null_loader_data = ClassLoaderData::the_null_class_loader_data();

    TypeArrayKlass* ak = TypeArrayKlass::allocate(null_loader_data, type, sym, CHECK_NULL);

    // Add all classes to our internal class loader list here,
    // including classes in the bootstrap (NULL) class loader.
    // GC walks these as strong roots.
    null_loader_data->add_class(ak);

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

    return ak;
}