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


C++ oop::age方法代码示例

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


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

示例1:

bool G1StringDedup::is_candidate_from_evacuation(bool from_young, bool to_young, oop obj) {
  if (from_young && java_lang_String::is_instance(obj)) {
    if (to_young && obj->age() == StringDeduplicationAgeThreshold) {
      // Candidate found. String is being evacuated from young to young and just
      // reached the deduplication age threshold.
      return true;
    }
    if (!to_young && obj->age() < StringDeduplicationAgeThreshold) {
      // Candidate found. String is being evacuated from young to old but has not
      // reached the deduplication age threshold, i.e. has not previously been a
      // candidate during its life in the young generation.
      return true;
    }
  }

  // Not a candidate
  return false;
}
开发者ID:netroby,项目名称:jdk9-shenandoah-hotspot,代码行数:18,代码来源:g1StringDedup.cpp

示例2: copy_to_survivor_space

oop DefNewGeneration::copy_to_survivor_space(oop old, oop* from) {
  assert(is_in_reserved(old) && !old->is_forwarded(),
	 "shouldn't be scavenging this oop"); 
  size_t s = old->size();
  oop obj = NULL;
  
  // Try allocating obj in to-space (unless too old or won't fit or JVMPI
  // enabled)
  if (old->age() < tenuring_threshold() &&
      !Universe::jvmpi_slow_allocation()) {
    obj = (oop) to()->allocate(s);
  }

  // Otherwise try allocating obj tenured
  if (obj == NULL) {
    obj = _next_gen->promote(old, s, from);
    if (obj == NULL) {
      // A failed promotion likely means the MaxLiveObjectEvacuationRatio flag
      // is incorrectly set. In any case, its seriously wrong to be here!
      vm_exit_out_of_memory(s*wordSize, "promotion");
    }
  } else {
    // Prefetch beyond obj
    const intx interval = PrefetchCopyIntervalInBytes;
    atomic::prefetch_write(obj, interval);

    // Copy obj
    Memory::copy_words_aligned((HeapWord*)old, (HeapWord*)obj, s);

    // Increment age if obj still in new generation
    obj->incr_age(); 
    age_table()->add(obj, s);
  }

  if (Universe::jvmpi_move_event_enabled()) {
    Universe::jvmpi_object_move(old, obj);
  }

  // Done, insert forward pointer to obj in this header
  old->forward_to(obj);

  return obj;
}
开发者ID:fatman2021,项目名称:myforthprocessor,代码行数:43,代码来源:defNewGeneration.cpp

示例3: copy_to_survivor_space

oop DefNewGeneration::copy_to_survivor_space(oop old) {
  assert(is_in_reserved(old) && !old->is_forwarded(),
         "shouldn't be scavenging this oop");
  size_t s = old->size();
  oop obj = NULL;

  // Try allocating obj in to-space (unless too old)
  if (old->age() < tenuring_threshold()) {
    obj = (oop) to()->allocate(s);
  }

  // Otherwise try allocating obj tenured
  if (obj == NULL) {
    obj = _next_gen->promote(old, s);
    if (obj == NULL) {
      if (!HandlePromotionFailure) {
        // A failed promotion likely means the MaxLiveObjectEvacuationRatio flag
        // is incorrectly set. In any case, its seriously wrong to be here!
        vm_exit_out_of_memory(s*wordSize, "promotion");
      }

      handle_promotion_failure(old);
      return old;
    }
  } else {
    // Prefetch beyond obj
    const intx interval = PrefetchCopyIntervalInBytes;
    Prefetch::write(obj, interval);

    // Copy obj
    Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)obj, s);

    // Increment age if obj still in new generation
    obj->incr_age();
    age_table()->add(obj, s);
  }

  // Done, insert forward pointer to obj in this header
  old->forward_to(obj);

  return obj;
}
开发者ID:tetratec,项目名称:Runescape-Launcher,代码行数:42,代码来源:defNewGeneration.cpp

示例4: copy_to_survivor_space

oop DefNewGeneration::copy_to_survivor_space(oop old) {
  assert(is_in_reserved(old) && !old->is_forwarded(),
         "shouldn't be scavenging this oop");
  size_t s = old->size();
  oop obj = NULL;

  // Try allocating obj in to-space (unless too old)
  if (old->age() < tenuring_threshold()) {
    obj = (oop) to()->allocate(s);
  }

  // Otherwise try allocating obj tenured
  if (obj == NULL) {
    obj = _next_gen->promote(old, s);
    if (obj == NULL) {
      handle_promotion_failure(old);
      return old;
    }
  } else {
    // Prefetch beyond obj
    const intx interval = PrefetchCopyIntervalInBytes;
    Prefetch::write(obj, interval);

    // Copy obj
    Copy::aligned_disjoint_words((HeapWord*)old, (HeapWord*)obj, s);

    // Increment age if obj still in new generation
    obj->incr_age();
    age_table()->add(obj, s);
  }

  // Done, insert forward pointer to obj in this header
  old->forward_to(obj);

  return obj;
}
开发者ID:4T-Shirt,项目名称:OpenJDK-Research,代码行数:36,代码来源:defNewGeneration.cpp

示例5: add

 // add entry
 void add(oop p, size_t oop_size) {
   int age = p->age();
   assert(age > 0 && age < table_size, "invalid age of object");
   sizes[age] += oop_size; 
 }
开发者ID:subxiang,项目名称:jdk-source-code,代码行数:6,代码来源:ageTable.hpp

示例6: add

// add entry
void AgeTable::add(oop p, size_t oop_size) {
  add(p->age(), oop_size);
}
开发者ID:campolake,项目名称:openjdk9,代码行数:4,代码来源:ageTable.inline.hpp

示例7: add

 // add entry
 void add(oop p, size_t oop_size) {
     add(p->age(), oop_size);
 }
开发者ID:benbenolson,项目名称:hotspot_9_mc,代码行数:4,代码来源:ageTable.hpp


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