hotspot/src/share/vm/memory/heap.cpp
changeset 34158 1f8d643b02d5
parent 29580 a67a581cfe11
child 35590 39a11b5f4283
equal deleted inserted replaced
34156:5646275e8053 34158:1f8d643b02d5
    45   _next_segment                 = 0;
    45   _next_segment                 = 0;
    46   _freelist                     = NULL;
    46   _freelist                     = NULL;
    47   _freelist_segments            = 0;
    47   _freelist_segments            = 0;
    48   _freelist_length              = 0;
    48   _freelist_length              = 0;
    49   _max_allocated_capacity       = 0;
    49   _max_allocated_capacity       = 0;
    50   _was_full                     = false;
    50   _blob_count                   = 0;
       
    51   _nmethod_count                = 0;
       
    52   _adapter_count                = 0;
       
    53   _full_count                   = 0;
    51 }
    54 }
    52 
    55 
    53 
    56 
    54 void CodeHeap::mark_segmap_as_free(size_t beg, size_t end) {
    57 void CodeHeap::mark_segmap_as_free(size_t beg, size_t end) {
    55   assert(              beg <  _number_of_committed_segments, "interval begin out of bounds");
    58   assert(              beg <  _number_of_committed_segments, "interval begin out of bounds");
   183   if (block != NULL) {
   186   if (block != NULL) {
   184     assert(block->length() >= number_of_segments && block->length() < number_of_segments + CodeCacheMinBlockLength, "sanity check");
   187     assert(block->length() >= number_of_segments && block->length() < number_of_segments + CodeCacheMinBlockLength, "sanity check");
   185     assert(!block->free(), "must be marked free");
   188     assert(!block->free(), "must be marked free");
   186     DEBUG_ONLY(memset((void*)block->allocated_space(), badCodeHeapNewVal, instance_size));
   189     DEBUG_ONLY(memset((void*)block->allocated_space(), badCodeHeapNewVal, instance_size));
   187     _max_allocated_capacity = MAX2(_max_allocated_capacity, allocated_capacity());
   190     _max_allocated_capacity = MAX2(_max_allocated_capacity, allocated_capacity());
       
   191     _blob_count++;
   188     return block->allocated_space();
   192     return block->allocated_space();
   189   }
   193   }
   190 
   194 
   191   // Ensure minimum size for allocation to the heap.
   195   // Ensure minimum size for allocation to the heap.
   192   number_of_segments = MAX2((int)CodeCacheMinBlockLength, (int)number_of_segments);
   196   number_of_segments = MAX2((int)CodeCacheMinBlockLength, (int)number_of_segments);
   196     HeapBlock* b =  block_at(_next_segment);
   200     HeapBlock* b =  block_at(_next_segment);
   197     b->initialize(number_of_segments);
   201     b->initialize(number_of_segments);
   198     _next_segment += number_of_segments;
   202     _next_segment += number_of_segments;
   199     DEBUG_ONLY(memset((void *)b->allocated_space(), badCodeHeapNewVal, instance_size));
   203     DEBUG_ONLY(memset((void *)b->allocated_space(), badCodeHeapNewVal, instance_size));
   200     _max_allocated_capacity = MAX2(_max_allocated_capacity, allocated_capacity());
   204     _max_allocated_capacity = MAX2(_max_allocated_capacity, allocated_capacity());
       
   205     _blob_count++;
   201     return b->allocated_space();
   206     return b->allocated_space();
   202   } else {
   207   } else {
   203     return NULL;
   208     return NULL;
   204   }
   209   }
   205 }
   210 }