hotspot/src/share/vm/gc_implementation/parallelScavenge/psOldGen.cpp
// Allocation. We report all successful allocations to the size policy
// Note that the perm gen does not use this method, and should not!
HeapWord* PSOldGen::allocate(size_t word_size, bool is_tlab) {
  {- -------------------------------------------
  (1) (assert)
      ---------------------------------------- -}
      assert_locked_or_safepoint(Heap_lock);
  {- -------------------------------------------
  (1) まずは PSOldGen::allocate_noexpand() で確保を試みる.
      ---------------------------------------- -}
      HeapWord* res = allocate_noexpand(word_size, is_tlab);
  {- -------------------------------------------
  (1) 成功しなければ PSOldGen::expand_and_allocate() で確保を試みる.
      ---------------------------------------- -}
      if (res == NULL) {
        res = expand_and_allocate(word_size, is_tlab);
      }
  {- -------------------------------------------
  (1) 確保が成功した場合は, PSAdaptiveSizePolicy::tenured_allocation() を呼び出して成功したことを報告しておく.
      ---------------------------------------- -}
      // Allocations in the old generation need to be reported
      if (res != NULL) {
        ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
        heap->size_policy()->tenured_allocation(word_size);
      }
  {- -------------------------------------------
  (1) 結果をリターン
      ---------------------------------------- -}
      return res;
    }
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.