• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ klassOop类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中klassOop的典型用法代码示例。如果您正苦于以下问题:C++ klassOop类的具体用法?C++ klassOop怎么用?C++ klassOop使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了klassOop类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: SETUP

END_DECLARE

SETUP(IndirectAlienPrimsTests) {
  rm = new HeapResourceMark();
  klassOop byteArrayClass = Universe::byteArrayKlassObj();
  PersistentHandle ah(byteArrayClass->klass_part()->allocateObjectSize(8));
  PersistentHandle iah(byteArrayClass->klass_part()->allocateObjectSize(8));
  PersistentHandle lu(byteArrayClass->klass_part()->allocateObjectSize(8));
  PersistentHandle ls(byteArrayClass->klass_part()->allocateObjectSize(8));

  doubleValue = doubleOop(Universe::doubleKlassObj()->klass_part()->allocateObject());
  doubleValue->set_value(1.625);

  largeUnsignedInteger = byteArrayOop(lu.as_oop());
  largeSignedInteger = byteArrayOop(ls.as_oop());

  IntegerOps::unsigned_int_to_Integer((unsigned int)0xFFFFFFFF, byteArrayOop(largeUnsignedInteger)->number());
  IntegerOps::int_to_Integer(-1 << 31, byteArrayOop(largeSignedInteger)->number());

  alien = byteArrayOop(ah.as_oop());
  byteArrayPrimitives::alienSetSize(as_smiOop(-16), alien);
  byteArrayPrimitives::alienSetAddress(as_smiOop((int)alien_byte_region), alien);
  memset(alien_byte_region, 0, 16);

  invalidAlien = byteArrayOop(iah.as_oop());
  byteArrayPrimitives::alienSetSize(as_smiOop(-16), invalidAlien);
  byteArrayPrimitives::alienSetAddress(as_smiOop(0), invalidAlien);
}
开发者ID:tonyg,项目名称:Strongtalk,代码行数:28,代码来源:indirectAlienPrimsTests.cpp


示例2: new_objArray

objArrayOop oopFactory::new_objArray(klassOop klass, int length, TRAPS) {
  assert(klass->is_klass(), "must be instance class");
  if (klass->klass_part()->oop_is_array()) {
    return ((arrayKlass*)klass->klass_part())->allocate_arrayArray(1, length, THREAD);
  } else {
    assert (klass->klass_part()->oop_is_instance(), "new object array with klass not an instanceKlass");
    return ((instanceKlass*)klass->klass_part())->allocate_objArray(1, length, THREAD);
  }
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:9,代码来源:oopFactory.cpp


示例3: must_be_preserved_with_bias_for_cms_scavenge

// Should this header (including its age bits) be preserved in the
// case of a scavenge in which CMS is the old generation?
inline bool markOopDesc::must_be_preserved_with_bias_for_cms_scavenge(klassOop klass_of_obj_containing_mark) const {
  assert(UseBiasedLocking, "unexpected");
  // CMS scavenges preserve mark words in similar fashion to promotion failures; see above
  if (has_bias_pattern() ||
      klass_of_obj_containing_mark->klass_part()->prototype_header()->has_bias_pattern()) {
    return true;
  }
  return (this != prototype());
}
开发者ID:ismo1652,项目名称:jvmnotebook,代码行数:11,代码来源:markOop.inline.hpp


示例4: trace_inline_cache_miss

void InterpretedIC::trace_inline_cache_miss(InterpretedIC* ic, klassOop klass, LookupResult result) {
  std->print("InterpretedIC lookup (");
  klass->print_value();
  std->print(", ");
  ic->selector()->print_value();
  std->print(") --> ");
  result.print_short_on(std);
  std->cr();
}
开发者ID:jirkadanek,项目名称:Strongtalk,代码行数:9,代码来源:interpretedIC.cpp


示例5: assert

inline void oopDesc::set_klass(klassOop k) {
  // since klasses are promoted no store check is needed
  assert(Universe::is_bootstrapping() || k != NULL, "must be a real klassOop");
  assert(Universe::is_bootstrapping() || k->is_klass(), "not a klassOop");
  if (UseCompressedOops) {
    oop_store_without_check(compressed_klass_addr(), (oop)k);
  } else {
    oop_store_without_check(klass_addr(), (oop) k);
  }
}
开发者ID:PrincetonUniversity,项目名称:NVJVM,代码行数:10,代码来源:oop.inline.hpp


示例6: compute_is_subtype_of

bool typeArrayKlass::compute_is_subtype_of(klassOop k) {
  if (!k->klass_part()->oop_is_typeArray()) {
    return arrayKlass::compute_is_subtype_of(k);
  }

  typeArrayKlass* tak = typeArrayKlass::cast(k);
  if (dimension() != tak->dimension()) return false;

  return element_type() == tak->element_type();
}
开发者ID:GudzonskiyYastreb,项目名称:openjdk-fontfix,代码行数:10,代码来源:typeArrayKlass.cpp


示例7: check_klass_accessibility

// ------------------------------------------------------------------
// ciEnv::check_klass_accessiblity
//
// Note: the logic of this method should mirror the logic of
// constantPoolOopDesc::verify_constant_pool_resolve.
bool ciEnv::check_klass_accessibility(ciKlass* accessing_klass,
				      klassOop resolved_klass) {
  if (accessing_klass == NULL || !accessing_klass->is_loaded()) {
    return true;
  }
  if (accessing_klass->is_obj_array()) {
    accessing_klass = accessing_klass->as_obj_array_klass()->base_element_klass();
  }
  if (!accessing_klass->is_instance_klass()) {
    return true;
  }

  if (resolved_klass->klass_part()->oop_is_objArray()) {
    // Find the element klass, if this is an array.
    resolved_klass = objArrayKlass::cast(resolved_klass)->bottom_klass();
  }
  if (resolved_klass->klass_part()->oop_is_instance()) {
    return Reflection::verify_class_access(accessing_klass->get_klassOop(),
					   resolved_klass,
					   true);
  }
  return true;
}
开发者ID:subxiang,项目名称:jdk-source-code,代码行数:28,代码来源:ciEnv.cpp


示例8: adjust_cpool_cache_and_vtable

  // Unevolving classes may point to methods of the evolving class directly
  // from their constantpool caches and vtables/itables. Fix this. 
  static void adjust_cpool_cache_and_vtable(klassOop k_oop, oop loader) {
    Klass *k = k_oop->klass_part();
    if (k->oop_is_instance()) {
      instanceKlass *ik = (instanceKlass *) k;
      bool previous_version; 

      if (java_core_class_name(ik->name()->as_utf8())) return;

      // By this time we have already replaced the constantpool pointer in the evolving
      // class itself. However, we need to fix the entries in the old constantpool, which
      // is still referenced by active old methods of this class.
      constantPoolCacheOop cp_cache = (k_oop == _evolving_koop) ? 
                _old_constants->cache() : ik->constants()->cache();
      
      do {

        if (cp_cache != NULL) {
          cp_cache->adjust_method_entries(_old_methods, _new_methods);
        }

        // Fix vtable (this is needed for the evolving class itself and its subclasses).
        if (ik->vtable_length() > 0 && ik->is_subclass_of(_evolving_koop)) {
          ik->vtable()->adjust_entries(_old_methods, _new_methods);         
        }
        // Fix itable, if it exists.
        if (ik->itable_length() > 0) {
          ik->itable()->adjust_method_entries(_old_methods, _new_methods);
        }

        // Previous version methods could be still on stack so adjust entries
        // in all previous versions.
        if (ik->has_previous_version()) {
          ik = (instanceKlass *)(ik->previous_version())->klass_part();
          cp_cache = ik->constants()->cache();
          previous_version = true;
        } else {
          previous_version = false;
        }
      } while (previous_version);
    }
  }
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:43,代码来源:jvmdi_hotswap.cpp


示例9: assert

// ------------------------------------------------------------------
// ciFieldLayout::fill_in_instance_fields
//
// Set up the instance fields in this ciFieldLayout.
void ciFieldLayout::fill_in_instance_fields(GrowableArray<BasicType>* fieldtypes,
					    GrowableArray<int>* fieldoffsets, 
					    GrowableArray<int>* aflags,
					    int& pos,
					    klassOop current) {
  Klass* k = current->klass_part();
  assert(k->oop_is_instance(), "must be instanceKlass");
  instanceKlass* ik = (instanceKlass*)k;
  klassOop super = k->super();
  if (super) {
    fill_in_instance_fields(fieldtypes, fieldoffsets, aflags, pos, super);
  }

  // Fill in this klass's instance fields.
  typeArrayOop field_list = ik->fields();
  constantPoolOop cpool = ik->constants();
  uint num_fields = field_list->length();

  for (uint i = 0; i < num_fields; i += instanceKlass::next_offset) {
    AccessFlags flags;
    flags.set_flags(field_list->short_at(i + instanceKlass::access_flags_offset));
   
    if (!flags.is_static()) {
      // This is an instance field.  Add it to our list.
      int field_offset = ik->offset_from_fields( i );
      // Add the type to our list.
      symbolOop type_sym = cpool->symbol_at(field_list->short_at(i+
                           instanceKlass::signature_index_offset));
      BasicType field_type; 
      field_type = type2field[FieldType::basic_type(type_sym)];
      fieldtypes->at_put_grow(pos, field_type, T_VOID);
      aflags->at_put_grow(pos, flags.as_int(), 0);
      // The field offset we set here includes the header_size
      fieldoffsets->at_put_grow(pos, field_offset, 0);
      pos++;
    }
  }
}
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:42,代码来源:ciFieldLayout.cpp


示例10: add_classes_to_array

void AllocationProfiler::add_classes_to_array(klassOop k) {
  // Iterate over klass and all array klasses for klass
  k->klass_part()->with_array_klasses_do(&AllocationProfiler::add_class_to_array);
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:4,代码来源:aprofiler.cpp


示例11: post_new_init_klass

void Klass_vtbl::post_new_init_klass(KlassHandle& klass,
                                     klassOop new_klass) const {
  assert(!new_klass->klass_part()->null_vtbl(), "Not a complete klass");
  CollectedHeap::post_allocation_install_obj_klass(klass, new_klass);
}
开发者ID:sxhao,项目名称:codenameone-avian,代码行数:5,代码来源:klass.cpp


示例12: assert

inline void oopDesc::set_klass(klassOop k) {
  // since klasses are promoted no store check is needed
  assert(Universe::is_bootstrapping() || k != NULL, "must be a real klassOop");
  assert(Universe::is_bootstrapping() || k->is_klass(), "not a klassOop");
  oop_store_without_check((oop*) &_klass, (oop) k);
}
开发者ID:subxiang,项目名称:jdk-source-code,代码行数:6,代码来源:oop.inline.hpp


示例13: compute_is_subtype_of

bool Klass::compute_is_subtype_of(klassOop k) {
  assert(k->is_klass(), "argument must be a class");
  return is_subclass_of(k);
}
开发者ID:sxhao,项目名称:codenameone-avian,代码行数:4,代码来源:klass.cpp


示例14: set_super

void Klass::initialize_supers(klassOop k, TRAPS) {
  if (FastSuperclassLimit == 0) {
    // None of the other machinery matters.
    set_super(k);
    return;
  }
  if (k == NULL) {
    set_super(NULL);
    oop_store_without_check((oop*) &_primary_supers[0], (oop) this->as_klassOop());
    assert(super_depth() == 0, "Object must already be initialized properly");
  } else if (k != super() || k == SystemDictionary::Object_klass()) {
    assert(super() == NULL || super() == SystemDictionary::Object_klass(),
           "initialize this only once to a non-trivial value");
    set_super(k);
    Klass* sup = k->klass_part();
    int sup_depth = sup->super_depth();
    juint my_depth  = MIN2(sup_depth + 1, (int)primary_super_limit());
    if (!can_be_primary_super_slow())
      my_depth = primary_super_limit();
    for (juint i = 0; i < my_depth; i++) {
      oop_store_without_check((oop*) &_primary_supers[i], (oop) sup->_primary_supers[i]);
    }
    klassOop *super_check_cell;
    if (my_depth < primary_super_limit()) {
      oop_store_without_check((oop*) &_primary_supers[my_depth], (oop) this->as_klassOop());
      super_check_cell = &_primary_supers[my_depth];
    } else {
      // Overflow of the primary_supers array forces me to be secondary.
      super_check_cell = &_secondary_super_cache;
    }
    set_super_check_offset((address)super_check_cell - (address) this->as_klassOop());

#ifdef ASSERT
    {
      juint j = super_depth();
      assert(j == my_depth, "computed accessor gets right answer");
      klassOop t = as_klassOop();
      while (!Klass::cast(t)->can_be_primary_super()) {
        t = Klass::cast(t)->super();
        j = Klass::cast(t)->super_depth();
      }
      for (juint j1 = j+1; j1 < primary_super_limit(); j1++) {
        assert(primary_super_of_depth(j1) == NULL, "super list padding");
      }
      while (t != NULL) {
        assert(primary_super_of_depth(j) == t, "super list initialization");
        t = Klass::cast(t)->super();
        --j;
      }
      assert(j == (juint)-1, "correct depth count");
    }
#endif
  }

  if (secondary_supers() == NULL) {
    KlassHandle this_kh (THREAD, this);

    // Now compute the list of secondary supertypes.
    // Secondaries can occasionally be on the super chain,
    // if the inline "_primary_supers" array overflows.
    int extras = 0;
    klassOop p;
    for (p = super(); !(p == NULL || p->klass_part()->can_be_primary_super()); p = p->klass_part()->super()) {
      ++extras;
    }

    // Compute the "real" non-extra secondaries.
    objArrayOop secondary_oops = compute_secondary_supers(extras, CHECK);
    objArrayHandle secondaries (THREAD, secondary_oops);

    // Store the extra secondaries in the first array positions:
    int fillp = extras;
    for (p = this_kh->super(); !(p == NULL || p->klass_part()->can_be_primary_super()); p = p->klass_part()->super()) {
      int i;                    // Scan for overflow primaries being duplicates of 2nd'arys

      // This happens frequently for very deeply nested arrays: the
      // primary superclass chain overflows into the secondary.  The
      // secondary list contains the element_klass's secondaries with
      // an extra array dimension added.  If the element_klass's
      // secondary list already contains some primary overflows, they
      // (with the extra level of array-ness) will collide with the
      // normal primary superclass overflows.
      for( i = extras; i < secondaries->length(); i++ )
        if( secondaries->obj_at(i) == p )
          break;
      if( i < secondaries->length() )
        continue;               // It's a dup, don't put it in
      secondaries->obj_at_put(--fillp, p);
    }
    // See if we had some dup's, so the array has holes in it.
    if( fillp > 0 ) {
      // Pack the array.  Drop the old secondaries array on the floor
      // and let GC reclaim it.
      objArrayOop s2 = oopFactory::new_system_objArray(secondaries->length() - fillp, CHECK);
      for( int i = 0; i < s2->length(); i++ )
        s2->obj_at_put( i, secondaries->obj_at(i+fillp) );
      secondaries = objArrayHandle(THREAD, s2);
    }

  #ifdef ASSERT
//.........这里部分代码省略.........
开发者ID:sxhao,项目名称:codenameone-avian,代码行数:101,代码来源:klass.cpp


示例15: is_visible_klass

 // Do not expose internal implementation specific classes
 bool is_visible_klass(klassOop k) {
   return k->klass_part()->oop_is_instance() ||
          (k->klass_part()->oop_is_array() && k != Universe::systemObjArrayKlassObj());
 }
开发者ID:digideskio,项目名称:openjdk-fontfix,代码行数:5,代码来源:gcTrace.cpp


示例16:

TESTF(ByteArrayKlassTests, allocateShouldNotFailWhenNotAllowedAndNoSpace) {
  eden_top = eden_end;
  ASSERT_TRUE(Universe::new_gen.eden()->free() < 4 * oopSize);
  ASSERT_TRUE(Universe::new_gen.contains(theClass->klass_part()->allocateObjectSize(100, true)));
}
开发者ID:bossiernesto,项目名称:Strongtalk,代码行数:5,代码来源:byteArrayKlassTests.cpp


示例17:

TESTF(ContextKlassTests, allocateShouldAllocateTenuredWhenRequired) {
  ASSERT_TRUE(Universe::old_gen.contains(theClass->klass_part()->allocateObject(false, true)));
}
开发者ID:jirkadanek,项目名称:Strongtalk,代码行数:3,代码来源:contextKlassTests.cpp



注:本文中的klassOop类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ lString16类代码示例发布时间:2022-05-31
下一篇:
C++ key_type类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap