当前位置: 首页>>代码示例>>C++>>正文


C++ CollectedHeap::is_permanent_or_null方法代码示例

本文整理汇总了C++中CollectedHeap::is_permanent_or_null方法的典型用法代码示例。如果您正苦于以下问题:C++ CollectedHeap::is_permanent_or_null方法的具体用法?C++ CollectedHeap::is_permanent_or_null怎么用?C++ CollectedHeap::is_permanent_or_null使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CollectedHeap的用法示例。


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

示例1: oop_iterate_m

void ReceiverTypeData::oop_iterate_m(OopClosure* blk, MemRegion mr) {
  // Currently, this interface is called only during card-scanning for
  // a young gen gc, in which case this object cannot contribute anything,
  // since it does not contain any references that cross out of
  // the perm gen. However, for future more general use we allow
  // the possibility of calling for instance from more general
  // iterators (for example, a future regionalized perm gen for G1,
  // or the possibility of moving some references out of perm in
  // the case of other collectors). In that case, you will need
  // to relax or remove some of the assertions below.
#ifdef ASSERT
  // Verify that none of the embedded oop references cross out of
  // this generation.
  for (uint row = 0; row < row_limit(); row++) {
    if (receiver(row) != NULL) {
      oop* adr = adr_receiver(row);
      CollectedHeap* h = Universe::heap();
      assert(h->is_permanent(adr) && h->is_permanent_or_null(*adr), "Not intra-perm");
    }
  }
#endif // ASSERT
  assert(!blk->should_remember_mdo(), "Not expected to remember MDO");
  return;   // Nothing to do, see comment above
#if 0
  if (blk->should_remember_mdo()) {
    // This is a set of weak references that need
    // to be followed at the end of the strong marking
    // phase. Memoize this object so it can be visited
    // in the weak roots processing phase.
    blk->remember_mdo(data());
  } else { // normal scan
    for (uint row = 0; row < row_limit(); row++) {
      if (receiver(row) != NULL) {
        oop* adr = adr_receiver(row);
        if (mr.contains(adr)) {
          blk->do_oop(adr);
        } else if ((HeapWord*)adr >= mr.end()) {
          // Test that the current cursor and the two ends of the range
          // that we may have skipped iterating over are monotonically ordered;
          // this is just a paranoid assertion, just in case represetations
          // should change in the future rendering the short-circuit return
          // here invalid.
          assert((row+1 >= row_limit() || adr_receiver(row+1) > adr) &&
                 (row+2 >= row_limit() || adr_receiver(row_limit()-1) > adr_receiver(row+1)), "Reducing?");
          break; // remaining should be outside this mr too
        }
      }
    }
  }
#endif
}
开发者ID:AllenWeb,项目名称:openjdk-1,代码行数:51,代码来源:methodDataOop.cpp


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