< prev index next >

src/hotspot/share/gc/shared/oopStorage.cpp

Print this page
rev 50951 : imported patch rename_AllocateList
rev 50952 : imported patch rename_AllocateEntry
rev 50953 : imported patch rename_allocate_entry
rev 50954 : imported patch rename_allocate_list
rev 50955 : imported patch rename_allocate_mutex


  28 #include "logging/log.hpp"
  29 #include "logging/logStream.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "runtime/atomic.hpp"
  32 #include "runtime/globals.hpp"
  33 #include "runtime/handles.inline.hpp"
  34 #include "runtime/mutex.hpp"
  35 #include "runtime/mutexLocker.hpp"
  36 #include "runtime/orderAccess.hpp"
  37 #include "runtime/safepoint.hpp"
  38 #include "runtime/stubRoutines.hpp"
  39 #include "runtime/thread.hpp"
  40 #include "utilities/align.hpp"
  41 #include "utilities/count_trailing_zeros.hpp"
  42 #include "utilities/debug.hpp"
  43 #include "utilities/globalDefinitions.hpp"
  44 #include "utilities/macros.hpp"
  45 #include "utilities/ostream.hpp"
  46 #include "utilities/spinYield.hpp"
  47 
  48 OopStorage::AllocateEntry::AllocateEntry() : _prev(NULL), _next(NULL) {}
  49 
  50 OopStorage::AllocateEntry::~AllocateEntry() {
  51   assert(_prev == NULL, "deleting attached block");
  52   assert(_next == NULL, "deleting attached block");
  53 }
  54 
  55 OopStorage::AllocateList::AllocateList() : _head(NULL), _tail(NULL) {}
  56 
  57 OopStorage::AllocateList::~AllocateList() {
  58   // ~OopStorage() empties its lists before destroying them.
  59   assert(_head == NULL, "deleting non-empty block list");
  60   assert(_tail == NULL, "deleting non-empty block list");
  61 }
  62 
  63 void OopStorage::AllocateList::push_front(const Block& block) {
  64   const Block* old = _head;
  65   if (old == NULL) {
  66     assert(_tail == NULL, "invariant");
  67     _head = _tail = &block;
  68   } else {
  69     block.allocate_entry()._next = old;
  70     old->allocate_entry()._prev = &block;
  71     _head = &block;
  72   }
  73 }
  74 
  75 void OopStorage::AllocateList::push_back(const Block& block) {
  76   const Block* old = _tail;
  77   if (old == NULL) {
  78     assert(_head == NULL, "invariant");
  79     _head = _tail = &block;
  80   } else {
  81     old->allocate_entry()._next = &block;
  82     block.allocate_entry()._prev = old;
  83     _tail = &block;
  84   }
  85 }
  86 
  87 void OopStorage::AllocateList::unlink(const Block& block) {
  88   const AllocateEntry& block_entry = block.allocate_entry();
  89   const Block* prev_blk = block_entry._prev;
  90   const Block* next_blk = block_entry._next;
  91   block_entry._prev = NULL;
  92   block_entry._next = NULL;
  93   if ((prev_blk == NULL) && (next_blk == NULL)) {
  94     assert(_head == &block, "invariant");
  95     assert(_tail == &block, "invariant");
  96     _head = _tail = NULL;
  97   } else if (prev_blk == NULL) {
  98     assert(_head == &block, "invariant");
  99     next_blk->allocate_entry()._prev = NULL;
 100     _head = next_blk;
 101   } else if (next_blk == NULL) {
 102     assert(_tail == &block, "invariant");
 103     prev_blk->allocate_entry()._next = NULL;
 104     _tail = prev_blk;
 105   } else {
 106     next_blk->allocate_entry()._prev = prev_blk;
 107     prev_blk->allocate_entry()._next = next_blk;
 108   }
 109 }
 110 
 111 OopStorage::ActiveArray::ActiveArray(size_t size) :
 112   _size(size),
 113   _block_count(0),
 114   _refcount(0)
 115 {}
 116 
 117 OopStorage::ActiveArray::~ActiveArray() {
 118   assert(_refcount == 0, "precondition");
 119 }
 120 
 121 OopStorage::ActiveArray* OopStorage::ActiveArray::create(size_t size, AllocFailType alloc_fail) {
 122   size_t size_in_bytes = blocks_offset() + sizeof(Block*) * size;
 123   void* mem = NEW_C_HEAP_ARRAY3(char, size_in_bytes, mtGC, CURRENT_PC, alloc_fail);
 124   if (mem == NULL) return NULL;
 125   return new (mem) ActiveArray(size);
 126 }
 127 


 193 }
 194 
 195 // Blocks start with an array of BitsPerWord oop entries.  That array
 196 // is divided into conceptual BytesPerWord sections of BitsPerByte
 197 // entries.  Blocks are allocated aligned on section boundaries, for
 198 // the convenience of mapping from an entry to the containing block;
 199 // see block_for_ptr().  Aligning on section boundary rather than on
 200 // the full _data wastes a lot less space, but makes for a bit more
 201 // work in block_for_ptr().
 202 
 203 const unsigned section_size = BitsPerByte;
 204 const unsigned section_count = BytesPerWord;
 205 const unsigned block_alignment = sizeof(oop) * section_size;
 206 
 207 OopStorage::Block::Block(const OopStorage* owner, void* memory) :
 208   _data(),
 209   _allocated_bitmask(0),
 210   _owner(owner),
 211   _memory(memory),
 212   _active_index(0),
 213   _allocate_entry(),
 214   _deferred_updates_next(NULL),
 215   _release_refcount(0)
 216 {
 217   STATIC_ASSERT(_data_pos == 0);
 218   STATIC_ASSERT(section_size * section_count == ARRAY_SIZE(_data));
 219   assert(offset_of(Block, _data) == _data_pos, "invariant");
 220   assert(owner != NULL, "NULL owner");
 221   assert(is_aligned(this, block_alignment), "misaligned block");
 222 }
 223 
 224 OopStorage::Block::~Block() {
 225   assert(_release_refcount == 0, "deleting block while releasing");
 226   assert(_deferred_updates_next == NULL, "deleting block with deferred update");
 227   // Clear fields used by block_for_ptr and entry validation, which
 228   // might help catch bugs.  Volatile to prevent dead-store elimination.
 229   const_cast<uintx volatile&>(_allocated_bitmask) = 0;
 230   const_cast<OopStorage* volatile&>(_owner) = NULL;
 231 }
 232 
 233 size_t OopStorage::Block::allocation_size() {


 350   oop* section = section_start - (section_size * (section_count - 1));
 351   // Walk up through the potential block start positions, looking for
 352   // the owner in the expected location.  If we're below the actual block
 353   // start position, the value at the owner position will be some oop
 354   // (possibly NULL), which can never match the owner.
 355   intptr_t owner_addr = reinterpret_cast<intptr_t>(owner);
 356   for (unsigned i = 0; i < section_count; ++i, section += section_size) {
 357     Block* candidate = reinterpret_cast<Block*>(section);
 358     intptr_t* candidate_owner_addr
 359       = reinterpret_cast<intptr_t*>(&candidate->_owner);
 360     if (SafeFetchN(candidate_owner_addr, 0) == owner_addr) {
 361       return candidate;
 362     }
 363   }
 364   return NULL;
 365 }
 366 
 367 //////////////////////////////////////////////////////////////////////////////
 368 // Allocation
 369 //
 370 // Allocation involves the _allocate_list, which contains a subset of the
 371 // blocks owned by a storage object.  This is a doubly-linked list, linked
 372 // through dedicated fields in the blocks.  Full blocks are removed from this
 373 // list, though they are still present in the _active_array.  Empty blocks are
 374 // kept at the end of the _allocate_list, to make it easy for empty block
 375 // deletion to find them.
 376 //
 377 // allocate(), and delete_empty_blocks_concurrent() lock the
 378 // _allocate_mutex while performing any list and array modifications.
 379 //
 380 // allocate() and release() update a block's _allocated_bitmask using CAS
 381 // loops.  This prevents loss of updates even though release() performs
 382 // its updates without any locking.
 383 //
 384 // allocate() obtains the entry from the first block in the _allocate_list,
 385 // and updates that block's _allocated_bitmask to indicate the entry is in
 386 // use.  If this makes the block full (all entries in use), the block is
 387 // removed from the _allocate_list so it won't be considered by future
 388 // allocations until some entries in it are released.
 389 //
 390 // release() is performed lock-free. release() first looks up the block for
 391 // the entry, using address alignment to find the enclosing block (thereby
 392 // avoiding iteration over the _active_array).  Once the block has been
 393 // determined, its _allocated_bitmask needs to be updated, and its position in
 394 // the _allocate_list may need to be updated.  There are two cases:
 395 //
 396 // (a) If the block is neither full nor would become empty with the release of
 397 // the entry, only its _allocated_bitmask needs to be updated.  But if the CAS
 398 // update fails, the applicable case may change for the retry.
 399 //
 400 // (b) Otherwise, the _allocate_list also needs to be modified.  This requires
 401 // locking the _allocate_mutex.  To keep the release() operation lock-free,
 402 // rather than updating the _allocate_list itself, it instead performs a
 403 // lock-free push of the block onto the _deferred_updates list.  Entries on
 404 // that list are processed by allocate() and delete_empty_blocks_XXX(), while
 405 // they already hold the necessary lock.  That processing makes the block's
 406 // list state consistent with its current _allocated_bitmask.  The block is
 407 // added to the _allocate_list if not already present and the bitmask is not
 408 // full.  The block is moved to the end of the _allocated_list if the bitmask
 409 // is empty, for ease of empty block deletion processing.
 410 
 411 oop* OopStorage::allocate() {
 412   MutexLockerEx ml(_allocate_mutex, Mutex::_no_safepoint_check_flag);
 413   // Do some deferred update processing every time we allocate.
 414   // Continue processing deferred updates if _allocate_list is empty,
 415   // in the hope that we'll get a block from that, rather than
 416   // allocating a new block.
 417   while (reduce_deferred_updates() && (_allocate_list.head() == NULL)) {}
 418 
 419   // Use the first block in _allocate_list for the allocation.
 420   Block* block = _allocate_list.head();
 421   if (block == NULL) {
 422     // No available blocks; make a new one, and add to storage.
 423     {
 424       MutexUnlockerEx mul(_allocate_mutex, Mutex::_no_safepoint_check_flag);
 425       block = Block::new_block(this);
 426     }
 427     if (block == NULL) {
 428       while (_allocate_list.head() == NULL) {
 429         if (!reduce_deferred_updates()) {
 430           // Failed to make new block, no other thread made a block
 431           // available while the mutex was released, and didn't get
 432           // one from a deferred update either, so return failure.
 433           log_info(oopstorage, ref)("%s: failed block allocation", name());
 434           return NULL;
 435         }
 436       }
 437     } else {
 438       // Add new block to storage.
 439       log_info(oopstorage, blocks)("%s: new block " PTR_FORMAT, name(), p2i(block));
 440 
 441       // Add new block to the _active_array, growing if needed.
 442       if (!_active_array->push(block)) {
 443         if (expand_active_array()) {
 444           guarantee(_active_array->push(block), "push failed after expansion");
 445         } else {
 446           log_info(oopstorage, blocks)("%s: failed active array expand", name());
 447           Block::delete_block(*block);
 448           return NULL;
 449         }
 450       }
 451       // Add to end of _allocate_list.  The mutex release allowed
 452       // other threads to add blocks to the _allocate_list.  We prefer
 453       // to allocate from non-empty blocks, to allow empty blocks to
 454       // be deleted.
 455       _allocate_list.push_back(*block);
 456     }
 457     block = _allocate_list.head();
 458   }
 459   // Allocate from first block.
 460   assert(block != NULL, "invariant");
 461   assert(!block->is_full(), "invariant");
 462   if (block->is_empty()) {
 463     // Transitioning from empty to not empty.
 464     log_debug(oopstorage, blocks)("%s: block not empty " PTR_FORMAT, name(), p2i(block));
 465   }
 466   oop* result = block->allocate();
 467   assert(result != NULL, "allocation failed");
 468   assert(!block->is_empty(), "postcondition");
 469   Atomic::inc(&_allocation_count); // release updates outside lock.
 470   if (block->is_full()) {
 471     // Transitioning from not full to full.
 472     // Remove full blocks from consideration by future allocates.
 473     log_debug(oopstorage, blocks)("%s: block full " PTR_FORMAT, name(), p2i(block));
 474     _allocate_list.unlink(*block);
 475   }
 476   log_info(oopstorage, ref)("%s: allocated " PTR_FORMAT, name(), p2i(result));
 477   return result;
 478 }
 479 
 480 // Create a new, larger, active array with the same content as the
 481 // current array, and then replace, relinquishing the old array.
 482 // Return true if the array was successfully expanded, false to
 483 // indicate allocation failure.
 484 bool OopStorage::expand_active_array() {
 485   assert_lock_strong(_allocate_mutex);
 486   ActiveArray* old_array = _active_array;
 487   size_t new_size = 2 * old_array->size();
 488   log_info(oopstorage, blocks)("%s: expand active array " SIZE_FORMAT,
 489                                name(), new_size);
 490   ActiveArray* new_array = ActiveArray::create(new_size, AllocFailStrategy::RETURN_NULL);
 491   if (new_array == NULL) return false;
 492   new_array->copy_from(old_array);
 493   replace_active_array(new_array);
 494   relinquish_block_array(old_array);
 495   return true;
 496 }
 497 
 498 OopStorage::ProtectActive::ProtectActive() : _enter(0), _exit() {}
 499 
 500 // Begin read-side critical section.
 501 uint OopStorage::ProtectActive::read_enter() {
 502   return Atomic::add(2u, &_enter);
 503 }
 504 
 505 // End read-side critical section.


 615 
 616 void OopStorage::Block::release_entries(uintx releasing, Block* volatile* deferred_list) {
 617   assert(releasing != 0, "preconditon");
 618   // Prevent empty block deletion when transitioning to empty.
 619   Atomic::inc(&_release_refcount);
 620 
 621   // Atomically update allocated bitmask.
 622   uintx old_allocated = _allocated_bitmask;
 623   while (true) {
 624     assert((releasing & ~old_allocated) == 0, "releasing unallocated entries");
 625     uintx new_value = old_allocated ^ releasing;
 626     uintx fetched = Atomic::cmpxchg(new_value, &_allocated_bitmask, old_allocated);
 627     if (fetched == old_allocated) break; // Successful update.
 628     old_allocated = fetched;             // Retry with updated bitmask.
 629   }
 630 
 631   // Now that the bitmask has been updated, if we have a state transition
 632   // (updated bitmask is empty or old bitmask was full), atomically push
 633   // this block onto the deferred updates list.  Some future call to
 634   // reduce_deferred_updates will make any needed changes related to this
 635   // block and _allocate_list.  This deferral avoids list updates and the
 636   // associated locking here.
 637   if ((releasing == old_allocated) || is_full_bitmask(old_allocated)) {
 638     // Log transitions.  Both transitions are possible in a single update.
 639     if (log_is_enabled(Debug, oopstorage, blocks)) {
 640       log_release_transitions(releasing, old_allocated, _owner, this);
 641     }
 642     // Attempt to claim responsibility for adding this block to the deferred
 643     // list, by setting the link to non-NULL by self-looping.  If this fails,
 644     // then someone else has made such a claim and the deferred update has not
 645     // yet been processed and will include our change, so we don't need to do
 646     // anything further.
 647     if (Atomic::replace_if_null(this, &_deferred_updates_next)) {
 648       // Successfully claimed.  Push, with self-loop for end-of-list.
 649       Block* head = *deferred_list;
 650       while (true) {
 651         _deferred_updates_next = (head == NULL) ? this : head;
 652         Block* fetched = Atomic::cmpxchg(this, deferred_list, head);
 653         if (fetched == head) break; // Successful update.
 654         head = fetched;             // Retry with updated head.
 655       }
 656       log_debug(oopstorage, blocks)("%s: deferred update " PTR_FORMAT,
 657                                     _owner->name(), p2i(this));
 658     }
 659   }
 660   // Release hold on empty block deletion.
 661   Atomic::dec(&_release_refcount);
 662 }
 663 
 664 // Process one available deferred update.  Returns true if one was processed.
 665 bool OopStorage::reduce_deferred_updates() {
 666   assert_locked_or_safepoint(_allocate_mutex);
 667   // Atomically pop a block off the list, if any available.
 668   // No ABA issue because this is only called by one thread at a time.
 669   // The atomicity is wrto pushes by release().
 670   Block* block = OrderAccess::load_acquire(&_deferred_updates);
 671   while (true) {
 672     if (block == NULL) return false;
 673     // Try atomic pop of block from list.
 674     Block* tail = block->deferred_updates_next();
 675     if (block == tail) tail = NULL; // Handle self-loop end marker.
 676     Block* fetched = Atomic::cmpxchg(tail, &_deferred_updates, block);
 677     if (fetched == block) break; // Update successful.
 678     block = fetched;             // Retry with updated block.
 679   }
 680   block->set_deferred_updates_next(NULL); // Clear tail after updating head.
 681   // Ensure bitmask read after pop is complete, including clearing tail, for
 682   // ordering with release().  Without this, we may be processing a stale
 683   // bitmask state here while blocking a release() operation from recording
 684   // the deferred update needed for its bitmask change.
 685   OrderAccess::storeload();
 686   // Process popped block.
 687   uintx allocated = block->allocated_bitmask();
 688 
 689   // Make membership in list consistent with bitmask state.
 690   if ((_allocate_list.ctail() != NULL) &&
 691       ((_allocate_list.ctail() == block) ||
 692        (_allocate_list.next(*block) != NULL))) {
 693     // Block is in the allocate list.
 694     assert(!is_full_bitmask(allocated), "invariant");
 695   } else if (!is_full_bitmask(allocated)) {
 696     // Block is not in the allocate list, but now should be.
 697     _allocate_list.push_front(*block);
 698   } // Else block is full and not in list, which is correct.
 699 
 700   // Move empty block to end of list, for possible deletion.
 701   if (is_empty_bitmask(allocated)) {
 702     _allocate_list.unlink(*block);
 703     _allocate_list.push_back(*block);
 704   }
 705 
 706   log_debug(oopstorage, blocks)("%s: processed deferred update " PTR_FORMAT,
 707                                 name(), p2i(block));
 708   return true;              // Processed one pending update.
 709 }
 710 
 711 inline void check_release_entry(const oop* entry) {
 712   assert(entry != NULL, "Releasing NULL");
 713   assert(*entry == NULL, "Releasing uncleared entry: " PTR_FORMAT, p2i(entry));
 714 }
 715 
 716 void OopStorage::release(const oop* ptr) {
 717   check_release_entry(ptr);
 718   Block* block = find_block_or_null(ptr);
 719   assert(block != NULL, "%s: invalid release " PTR_FORMAT, name(), p2i(ptr));
 720   log_info(oopstorage, ref)("%s: released " PTR_FORMAT, name(), p2i(ptr));
 721   block->release_entries(block->bitmask_for_entry(ptr), &_deferred_updates);
 722   Atomic::dec(&_allocation_count);
 723 }


 742       assert((releasing & entry_bitmask) == 0,
 743              "Duplicate entry: " PTR_FORMAT, p2i(entry));
 744       releasing |= entry_bitmask;
 745       ++count;
 746     }
 747     // Release the contiguous entries that are in block.
 748     block->release_entries(releasing, &_deferred_updates);
 749     Atomic::sub(count, &_allocation_count);
 750   }
 751 }
 752 
 753 const char* dup_name(const char* name) {
 754   char* dup = NEW_C_HEAP_ARRAY(char, strlen(name) + 1, mtGC);
 755   strcpy(dup, name);
 756   return dup;
 757 }
 758 
 759 const size_t initial_active_array_size = 8;
 760 
 761 OopStorage::OopStorage(const char* name,
 762                        Mutex* allocate_mutex,
 763                        Mutex* active_mutex) :
 764   _name(dup_name(name)),
 765   _active_array(ActiveArray::create(initial_active_array_size)),
 766   _allocate_list(),
 767   _deferred_updates(NULL),
 768   _allocate_mutex(allocate_mutex),
 769   _active_mutex(active_mutex),
 770   _allocation_count(0),
 771   _concurrent_iteration_active(false)
 772 {
 773   _active_array->increment_refcount();
 774   assert(_active_mutex->rank() < _allocate_mutex->rank(),
 775          "%s: active_mutex must have lower rank than allocate_mutex", _name);
 776   assert(_active_mutex->_safepoint_check_required != Mutex::_safepoint_check_always,
 777          "%s: active mutex requires safepoint check", _name);
 778   assert(_allocate_mutex->_safepoint_check_required != Mutex::_safepoint_check_always,
 779          "%s: allocate mutex requires safepoint check", _name);
 780 }
 781 
 782 void OopStorage::delete_empty_block(const Block& block) {
 783   assert(block.is_empty(), "discarding non-empty block");
 784   log_info(oopstorage, blocks)("%s: delete empty block " PTR_FORMAT, name(), p2i(&block));
 785   Block::delete_block(block);
 786 }
 787 
 788 OopStorage::~OopStorage() {
 789   Block* block;
 790   while ((block = _deferred_updates) != NULL) {
 791     _deferred_updates = block->deferred_updates_next();
 792     block->set_deferred_updates_next(NULL);
 793   }
 794   while ((block = _allocate_list.head()) != NULL) {
 795     _allocate_list.unlink(*block);
 796   }
 797   bool unreferenced = _active_array->decrement_refcount();
 798   assert(unreferenced, "deleting storage while _active_array is referenced");
 799   for (size_t i = _active_array->block_count(); 0 < i; ) {
 800     block = _active_array->at(--i);
 801     Block::delete_block(*block);
 802   }
 803   ActiveArray::destroy(_active_array);
 804   FREE_C_HEAP_ARRAY(char, _name);
 805 }
 806 
 807 void OopStorage::delete_empty_blocks_safepoint() {
 808   assert_at_safepoint();
 809   // Process any pending release updates, which may make more empty
 810   // blocks available for deletion.
 811   while (reduce_deferred_updates()) {}
 812   // Don't interfere with a concurrent iteration.
 813   if (_concurrent_iteration_active) return;
 814   // Delete empty (and otherwise deletable) blocks from end of _allocate_list.
 815   for (Block* block = _allocate_list.tail();
 816        (block != NULL) && block->is_deletable();
 817        block = _allocate_list.tail()) {
 818     _active_array->remove(block);
 819     _allocate_list.unlink(*block);
 820     delete_empty_block(*block);
 821   }
 822 }
 823 
 824 void OopStorage::delete_empty_blocks_concurrent() {
 825   MutexLockerEx ml(_allocate_mutex, Mutex::_no_safepoint_check_flag);
 826   // Other threads could be adding to the empty block count while we
 827   // release the mutex across the block deletions.  Set an upper bound
 828   // on how many blocks we'll try to release, so other threads can't
 829   // cause an unbounded stay in this function.
 830   size_t limit = block_count();
 831 
 832   for (size_t i = 0; i < limit; ++i) {
 833     // Additional updates might become available while we dropped the
 834     // lock.  But limit number processed to limit lock duration.
 835     reduce_deferred_updates();
 836 
 837     Block* block = _allocate_list.tail();
 838     if ((block == NULL) || !block->is_deletable()) {
 839       // No block to delete, so done.  There could be more pending
 840       // deferred updates that could give us more work to do; deal with
 841       // that in some later call, to limit lock duration here.
 842       return;
 843     }
 844 
 845     {
 846       MutexLockerEx aml(_active_mutex, Mutex::_no_safepoint_check_flag);
 847       // Don't interfere with a concurrent iteration.
 848       if (_concurrent_iteration_active) return;
 849       _active_array->remove(block);
 850     }
 851     // Remove block from _allocate_list and delete it.
 852     _allocate_list.unlink(*block);
 853     // Release mutex while deleting block.
 854     MutexUnlockerEx ul(_allocate_mutex, Mutex::_no_safepoint_check_flag);
 855     delete_empty_block(*block);
 856   }
 857 }
 858 
 859 OopStorage::EntryStatus OopStorage::allocation_status(const oop* ptr) const {
 860   const Block* block = find_block_or_null(ptr);
 861   if (block != NULL) {
 862     // Prevent block deletion and _active_array modification.
 863     MutexLockerEx ml(_allocate_mutex, Mutex::_no_safepoint_check_flag);
 864     // Block could be a false positive, so get index carefully.
 865     size_t index = Block::active_index_safe(block);
 866     if ((index < _active_array->block_count()) &&
 867         (block == _active_array->at(index)) &&
 868         block->contains(ptr)) {
 869       if ((block->allocated_bitmask() & block->bitmask_for_entry(ptr)) != 0) {
 870         return ALLOCATED_ENTRY;
 871       } else {
 872         return UNALLOCATED_ENTRY;
 873       }
 874     }
 875   }
 876   return INVALID_ENTRY;
 877 }
 878 
 879 size_t OopStorage::allocation_count() const {
 880   return _allocation_count;
 881 }
 882 
 883 size_t OopStorage::block_count() const {




  28 #include "logging/log.hpp"
  29 #include "logging/logStream.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "runtime/atomic.hpp"
  32 #include "runtime/globals.hpp"
  33 #include "runtime/handles.inline.hpp"
  34 #include "runtime/mutex.hpp"
  35 #include "runtime/mutexLocker.hpp"
  36 #include "runtime/orderAccess.hpp"
  37 #include "runtime/safepoint.hpp"
  38 #include "runtime/stubRoutines.hpp"
  39 #include "runtime/thread.hpp"
  40 #include "utilities/align.hpp"
  41 #include "utilities/count_trailing_zeros.hpp"
  42 #include "utilities/debug.hpp"
  43 #include "utilities/globalDefinitions.hpp"
  44 #include "utilities/macros.hpp"
  45 #include "utilities/ostream.hpp"
  46 #include "utilities/spinYield.hpp"
  47 
  48 OopStorage::AllocationListEntry::AllocationListEntry() : _prev(NULL), _next(NULL) {}
  49 
  50 OopStorage::AllocationListEntry::~AllocationListEntry() {
  51   assert(_prev == NULL, "deleting attached block");
  52   assert(_next == NULL, "deleting attached block");
  53 }
  54 
  55 OopStorage::AllocationList::AllocationList() : _head(NULL), _tail(NULL) {}
  56 
  57 OopStorage::AllocationList::~AllocationList() {
  58   // ~OopStorage() empties its lists before destroying them.
  59   assert(_head == NULL, "deleting non-empty block list");
  60   assert(_tail == NULL, "deleting non-empty block list");
  61 }
  62 
  63 void OopStorage::AllocationList::push_front(const Block& block) {
  64   const Block* old = _head;
  65   if (old == NULL) {
  66     assert(_tail == NULL, "invariant");
  67     _head = _tail = &block;
  68   } else {
  69     block.allocation_list_entry()._next = old;
  70     old->allocation_list_entry()._prev = &block;
  71     _head = &block;
  72   }
  73 }
  74 
  75 void OopStorage::AllocationList::push_back(const Block& block) {
  76   const Block* old = _tail;
  77   if (old == NULL) {
  78     assert(_head == NULL, "invariant");
  79     _head = _tail = &block;
  80   } else {
  81     old->allocation_list_entry()._next = &block;
  82     block.allocation_list_entry()._prev = old;
  83     _tail = &block;
  84   }
  85 }
  86 
  87 void OopStorage::AllocationList::unlink(const Block& block) {
  88   const AllocationListEntry& block_entry = block.allocation_list_entry();
  89   const Block* prev_blk = block_entry._prev;
  90   const Block* next_blk = block_entry._next;
  91   block_entry._prev = NULL;
  92   block_entry._next = NULL;
  93   if ((prev_blk == NULL) && (next_blk == NULL)) {
  94     assert(_head == &block, "invariant");
  95     assert(_tail == &block, "invariant");
  96     _head = _tail = NULL;
  97   } else if (prev_blk == NULL) {
  98     assert(_head == &block, "invariant");
  99     next_blk->allocation_list_entry()._prev = NULL;
 100     _head = next_blk;
 101   } else if (next_blk == NULL) {
 102     assert(_tail == &block, "invariant");
 103     prev_blk->allocation_list_entry()._next = NULL;
 104     _tail = prev_blk;
 105   } else {
 106     next_blk->allocation_list_entry()._prev = prev_blk;
 107     prev_blk->allocation_list_entry()._next = next_blk;
 108   }
 109 }
 110 
 111 OopStorage::ActiveArray::ActiveArray(size_t size) :
 112   _size(size),
 113   _block_count(0),
 114   _refcount(0)
 115 {}
 116 
 117 OopStorage::ActiveArray::~ActiveArray() {
 118   assert(_refcount == 0, "precondition");
 119 }
 120 
 121 OopStorage::ActiveArray* OopStorage::ActiveArray::create(size_t size, AllocFailType alloc_fail) {
 122   size_t size_in_bytes = blocks_offset() + sizeof(Block*) * size;
 123   void* mem = NEW_C_HEAP_ARRAY3(char, size_in_bytes, mtGC, CURRENT_PC, alloc_fail);
 124   if (mem == NULL) return NULL;
 125   return new (mem) ActiveArray(size);
 126 }
 127 


 193 }
 194 
 195 // Blocks start with an array of BitsPerWord oop entries.  That array
 196 // is divided into conceptual BytesPerWord sections of BitsPerByte
 197 // entries.  Blocks are allocated aligned on section boundaries, for
 198 // the convenience of mapping from an entry to the containing block;
 199 // see block_for_ptr().  Aligning on section boundary rather than on
 200 // the full _data wastes a lot less space, but makes for a bit more
 201 // work in block_for_ptr().
 202 
 203 const unsigned section_size = BitsPerByte;
 204 const unsigned section_count = BytesPerWord;
 205 const unsigned block_alignment = sizeof(oop) * section_size;
 206 
 207 OopStorage::Block::Block(const OopStorage* owner, void* memory) :
 208   _data(),
 209   _allocated_bitmask(0),
 210   _owner(owner),
 211   _memory(memory),
 212   _active_index(0),
 213   _allocation_list_entry(),
 214   _deferred_updates_next(NULL),
 215   _release_refcount(0)
 216 {
 217   STATIC_ASSERT(_data_pos == 0);
 218   STATIC_ASSERT(section_size * section_count == ARRAY_SIZE(_data));
 219   assert(offset_of(Block, _data) == _data_pos, "invariant");
 220   assert(owner != NULL, "NULL owner");
 221   assert(is_aligned(this, block_alignment), "misaligned block");
 222 }
 223 
 224 OopStorage::Block::~Block() {
 225   assert(_release_refcount == 0, "deleting block while releasing");
 226   assert(_deferred_updates_next == NULL, "deleting block with deferred update");
 227   // Clear fields used by block_for_ptr and entry validation, which
 228   // might help catch bugs.  Volatile to prevent dead-store elimination.
 229   const_cast<uintx volatile&>(_allocated_bitmask) = 0;
 230   const_cast<OopStorage* volatile&>(_owner) = NULL;
 231 }
 232 
 233 size_t OopStorage::Block::allocation_size() {


 350   oop* section = section_start - (section_size * (section_count - 1));
 351   // Walk up through the potential block start positions, looking for
 352   // the owner in the expected location.  If we're below the actual block
 353   // start position, the value at the owner position will be some oop
 354   // (possibly NULL), which can never match the owner.
 355   intptr_t owner_addr = reinterpret_cast<intptr_t>(owner);
 356   for (unsigned i = 0; i < section_count; ++i, section += section_size) {
 357     Block* candidate = reinterpret_cast<Block*>(section);
 358     intptr_t* candidate_owner_addr
 359       = reinterpret_cast<intptr_t*>(&candidate->_owner);
 360     if (SafeFetchN(candidate_owner_addr, 0) == owner_addr) {
 361       return candidate;
 362     }
 363   }
 364   return NULL;
 365 }
 366 
 367 //////////////////////////////////////////////////////////////////////////////
 368 // Allocation
 369 //
 370 // Allocation involves the _allocation_list, which contains a subset of the
 371 // blocks owned by a storage object.  This is a doubly-linked list, linked
 372 // through dedicated fields in the blocks.  Full blocks are removed from this
 373 // list, though they are still present in the _active_array.  Empty blocks are
 374 // kept at the end of the _allocation_list, to make it easy for empty block
 375 // deletion to find them.
 376 //
 377 // allocate(), and delete_empty_blocks_concurrent() lock the
 378 // _allocation_mutex while performing any list and array modifications.
 379 //
 380 // allocate() and release() update a block's _allocated_bitmask using CAS
 381 // loops.  This prevents loss of updates even though release() performs
 382 // its updates without any locking.
 383 //
 384 // allocate() obtains the entry from the first block in the _allocation_list,
 385 // and updates that block's _allocated_bitmask to indicate the entry is in
 386 // use.  If this makes the block full (all entries in use), the block is
 387 // removed from the _allocation_list so it won't be considered by future
 388 // allocations until some entries in it are released.
 389 //
 390 // release() is performed lock-free. release() first looks up the block for
 391 // the entry, using address alignment to find the enclosing block (thereby
 392 // avoiding iteration over the _active_array).  Once the block has been
 393 // determined, its _allocated_bitmask needs to be updated, and its position in
 394 // the _allocation_list may need to be updated.  There are two cases:
 395 //
 396 // (a) If the block is neither full nor would become empty with the release of
 397 // the entry, only its _allocated_bitmask needs to be updated.  But if the CAS
 398 // update fails, the applicable case may change for the retry.
 399 //
 400 // (b) Otherwise, the _allocation_list also needs to be modified.  This requires
 401 // locking the _allocation_mutex.  To keep the release() operation lock-free,
 402 // rather than updating the _allocation_list itself, it instead performs a
 403 // lock-free push of the block onto the _deferred_updates list.  Entries on
 404 // that list are processed by allocate() and delete_empty_blocks_XXX(), while
 405 // they already hold the necessary lock.  That processing makes the block's
 406 // list state consistent with its current _allocated_bitmask.  The block is
 407 // added to the _allocation_list if not already present and the bitmask is not
 408 // full.  The block is moved to the end of the _allocation_list if the bitmask
 409 // is empty, for ease of empty block deletion processing.
 410 
 411 oop* OopStorage::allocate() {
 412   MutexLockerEx ml(_allocation_mutex, Mutex::_no_safepoint_check_flag);
 413   // Do some deferred update processing every time we allocate.
 414   // Continue processing deferred updates if _allocation_list is empty,
 415   // in the hope that we'll get a block from that, rather than
 416   // allocating a new block.
 417   while (reduce_deferred_updates() && (_allocation_list.head() == NULL)) {}
 418 
 419   // Use the first block in _allocation_list for the allocation.
 420   Block* block = _allocation_list.head();
 421   if (block == NULL) {
 422     // No available blocks; make a new one, and add to storage.
 423     {
 424       MutexUnlockerEx mul(_allocation_mutex, Mutex::_no_safepoint_check_flag);
 425       block = Block::new_block(this);
 426     }
 427     if (block == NULL) {
 428       while (_allocation_list.head() == NULL) {
 429         if (!reduce_deferred_updates()) {
 430           // Failed to make new block, no other thread made a block
 431           // available while the mutex was released, and didn't get
 432           // one from a deferred update either, so return failure.
 433           log_info(oopstorage, ref)("%s: failed block allocation", name());
 434           return NULL;
 435         }
 436       }
 437     } else {
 438       // Add new block to storage.
 439       log_info(oopstorage, blocks)("%s: new block " PTR_FORMAT, name(), p2i(block));
 440 
 441       // Add new block to the _active_array, growing if needed.
 442       if (!_active_array->push(block)) {
 443         if (expand_active_array()) {
 444           guarantee(_active_array->push(block), "push failed after expansion");
 445         } else {
 446           log_info(oopstorage, blocks)("%s: failed active array expand", name());
 447           Block::delete_block(*block);
 448           return NULL;
 449         }
 450       }
 451       // Add to end of _allocation_list.  The mutex release allowed
 452       // other threads to add blocks to the _allocation_list.  We prefer
 453       // to allocate from non-empty blocks, to allow empty blocks to
 454       // be deleted.
 455       _allocation_list.push_back(*block);
 456     }
 457     block = _allocation_list.head();
 458   }
 459   // Allocate from first block.
 460   assert(block != NULL, "invariant");
 461   assert(!block->is_full(), "invariant");
 462   if (block->is_empty()) {
 463     // Transitioning from empty to not empty.
 464     log_debug(oopstorage, blocks)("%s: block not empty " PTR_FORMAT, name(), p2i(block));
 465   }
 466   oop* result = block->allocate();
 467   assert(result != NULL, "allocation failed");
 468   assert(!block->is_empty(), "postcondition");
 469   Atomic::inc(&_allocation_count); // release updates outside lock.
 470   if (block->is_full()) {
 471     // Transitioning from not full to full.
 472     // Remove full blocks from consideration by future allocates.
 473     log_debug(oopstorage, blocks)("%s: block full " PTR_FORMAT, name(), p2i(block));
 474     _allocation_list.unlink(*block);
 475   }
 476   log_info(oopstorage, ref)("%s: allocated " PTR_FORMAT, name(), p2i(result));
 477   return result;
 478 }
 479 
 480 // Create a new, larger, active array with the same content as the
 481 // current array, and then replace, relinquishing the old array.
 482 // Return true if the array was successfully expanded, false to
 483 // indicate allocation failure.
 484 bool OopStorage::expand_active_array() {
 485   assert_lock_strong(_allocation_mutex);
 486   ActiveArray* old_array = _active_array;
 487   size_t new_size = 2 * old_array->size();
 488   log_info(oopstorage, blocks)("%s: expand active array " SIZE_FORMAT,
 489                                name(), new_size);
 490   ActiveArray* new_array = ActiveArray::create(new_size, AllocFailStrategy::RETURN_NULL);
 491   if (new_array == NULL) return false;
 492   new_array->copy_from(old_array);
 493   replace_active_array(new_array);
 494   relinquish_block_array(old_array);
 495   return true;
 496 }
 497 
 498 OopStorage::ProtectActive::ProtectActive() : _enter(0), _exit() {}
 499 
 500 // Begin read-side critical section.
 501 uint OopStorage::ProtectActive::read_enter() {
 502   return Atomic::add(2u, &_enter);
 503 }
 504 
 505 // End read-side critical section.


 615 
 616 void OopStorage::Block::release_entries(uintx releasing, Block* volatile* deferred_list) {
 617   assert(releasing != 0, "preconditon");
 618   // Prevent empty block deletion when transitioning to empty.
 619   Atomic::inc(&_release_refcount);
 620 
 621   // Atomically update allocated bitmask.
 622   uintx old_allocated = _allocated_bitmask;
 623   while (true) {
 624     assert((releasing & ~old_allocated) == 0, "releasing unallocated entries");
 625     uintx new_value = old_allocated ^ releasing;
 626     uintx fetched = Atomic::cmpxchg(new_value, &_allocated_bitmask, old_allocated);
 627     if (fetched == old_allocated) break; // Successful update.
 628     old_allocated = fetched;             // Retry with updated bitmask.
 629   }
 630 
 631   // Now that the bitmask has been updated, if we have a state transition
 632   // (updated bitmask is empty or old bitmask was full), atomically push
 633   // this block onto the deferred updates list.  Some future call to
 634   // reduce_deferred_updates will make any needed changes related to this
 635   // block and _allocation_list.  This deferral avoids list updates and the
 636   // associated locking here.
 637   if ((releasing == old_allocated) || is_full_bitmask(old_allocated)) {
 638     // Log transitions.  Both transitions are possible in a single update.
 639     if (log_is_enabled(Debug, oopstorage, blocks)) {
 640       log_release_transitions(releasing, old_allocated, _owner, this);
 641     }
 642     // Attempt to claim responsibility for adding this block to the deferred
 643     // list, by setting the link to non-NULL by self-looping.  If this fails,
 644     // then someone else has made such a claim and the deferred update has not
 645     // yet been processed and will include our change, so we don't need to do
 646     // anything further.
 647     if (Atomic::replace_if_null(this, &_deferred_updates_next)) {
 648       // Successfully claimed.  Push, with self-loop for end-of-list.
 649       Block* head = *deferred_list;
 650       while (true) {
 651         _deferred_updates_next = (head == NULL) ? this : head;
 652         Block* fetched = Atomic::cmpxchg(this, deferred_list, head);
 653         if (fetched == head) break; // Successful update.
 654         head = fetched;             // Retry with updated head.
 655       }
 656       log_debug(oopstorage, blocks)("%s: deferred update " PTR_FORMAT,
 657                                     _owner->name(), p2i(this));
 658     }
 659   }
 660   // Release hold on empty block deletion.
 661   Atomic::dec(&_release_refcount);
 662 }
 663 
 664 // Process one available deferred update.  Returns true if one was processed.
 665 bool OopStorage::reduce_deferred_updates() {
 666   assert_locked_or_safepoint(_allocation_mutex);
 667   // Atomically pop a block off the list, if any available.
 668   // No ABA issue because this is only called by one thread at a time.
 669   // The atomicity is wrto pushes by release().
 670   Block* block = OrderAccess::load_acquire(&_deferred_updates);
 671   while (true) {
 672     if (block == NULL) return false;
 673     // Try atomic pop of block from list.
 674     Block* tail = block->deferred_updates_next();
 675     if (block == tail) tail = NULL; // Handle self-loop end marker.
 676     Block* fetched = Atomic::cmpxchg(tail, &_deferred_updates, block);
 677     if (fetched == block) break; // Update successful.
 678     block = fetched;             // Retry with updated block.
 679   }
 680   block->set_deferred_updates_next(NULL); // Clear tail after updating head.
 681   // Ensure bitmask read after pop is complete, including clearing tail, for
 682   // ordering with release().  Without this, we may be processing a stale
 683   // bitmask state here while blocking a release() operation from recording
 684   // the deferred update needed for its bitmask change.
 685   OrderAccess::storeload();
 686   // Process popped block.
 687   uintx allocated = block->allocated_bitmask();
 688 
 689   // Make membership in list consistent with bitmask state.
 690   if ((_allocation_list.ctail() != NULL) &&
 691       ((_allocation_list.ctail() == block) ||
 692        (_allocation_list.next(*block) != NULL))) {
 693     // Block is in the _allocation_list.
 694     assert(!is_full_bitmask(allocated), "invariant");
 695   } else if (!is_full_bitmask(allocated)) {
 696     // Block is not in the _allocation_list, but now should be.
 697     _allocation_list.push_front(*block);
 698   } // Else block is full and not in list, which is correct.
 699 
 700   // Move empty block to end of list, for possible deletion.
 701   if (is_empty_bitmask(allocated)) {
 702     _allocation_list.unlink(*block);
 703     _allocation_list.push_back(*block);
 704   }
 705 
 706   log_debug(oopstorage, blocks)("%s: processed deferred update " PTR_FORMAT,
 707                                 name(), p2i(block));
 708   return true;              // Processed one pending update.
 709 }
 710 
 711 inline void check_release_entry(const oop* entry) {
 712   assert(entry != NULL, "Releasing NULL");
 713   assert(*entry == NULL, "Releasing uncleared entry: " PTR_FORMAT, p2i(entry));
 714 }
 715 
 716 void OopStorage::release(const oop* ptr) {
 717   check_release_entry(ptr);
 718   Block* block = find_block_or_null(ptr);
 719   assert(block != NULL, "%s: invalid release " PTR_FORMAT, name(), p2i(ptr));
 720   log_info(oopstorage, ref)("%s: released " PTR_FORMAT, name(), p2i(ptr));
 721   block->release_entries(block->bitmask_for_entry(ptr), &_deferred_updates);
 722   Atomic::dec(&_allocation_count);
 723 }


 742       assert((releasing & entry_bitmask) == 0,
 743              "Duplicate entry: " PTR_FORMAT, p2i(entry));
 744       releasing |= entry_bitmask;
 745       ++count;
 746     }
 747     // Release the contiguous entries that are in block.
 748     block->release_entries(releasing, &_deferred_updates);
 749     Atomic::sub(count, &_allocation_count);
 750   }
 751 }
 752 
 753 const char* dup_name(const char* name) {
 754   char* dup = NEW_C_HEAP_ARRAY(char, strlen(name) + 1, mtGC);
 755   strcpy(dup, name);
 756   return dup;
 757 }
 758 
 759 const size_t initial_active_array_size = 8;
 760 
 761 OopStorage::OopStorage(const char* name,
 762                        Mutex* allocation_mutex,
 763                        Mutex* active_mutex) :
 764   _name(dup_name(name)),
 765   _active_array(ActiveArray::create(initial_active_array_size)),
 766   _allocation_list(),
 767   _deferred_updates(NULL),
 768   _allocation_mutex(allocation_mutex),
 769   _active_mutex(active_mutex),
 770   _allocation_count(0),
 771   _concurrent_iteration_active(false)
 772 {
 773   _active_array->increment_refcount();
 774   assert(_active_mutex->rank() < _allocation_mutex->rank(),
 775          "%s: active_mutex must have lower rank than allocation_mutex", _name);
 776   assert(_active_mutex->_safepoint_check_required != Mutex::_safepoint_check_always,
 777          "%s: active mutex requires safepoint check", _name);
 778   assert(_allocation_mutex->_safepoint_check_required != Mutex::_safepoint_check_always,
 779          "%s: allocation mutex requires safepoint check", _name);
 780 }
 781 
 782 void OopStorage::delete_empty_block(const Block& block) {
 783   assert(block.is_empty(), "discarding non-empty block");
 784   log_info(oopstorage, blocks)("%s: delete empty block " PTR_FORMAT, name(), p2i(&block));
 785   Block::delete_block(block);
 786 }
 787 
 788 OopStorage::~OopStorage() {
 789   Block* block;
 790   while ((block = _deferred_updates) != NULL) {
 791     _deferred_updates = block->deferred_updates_next();
 792     block->set_deferred_updates_next(NULL);
 793   }
 794   while ((block = _allocation_list.head()) != NULL) {
 795     _allocation_list.unlink(*block);
 796   }
 797   bool unreferenced = _active_array->decrement_refcount();
 798   assert(unreferenced, "deleting storage while _active_array is referenced");
 799   for (size_t i = _active_array->block_count(); 0 < i; ) {
 800     block = _active_array->at(--i);
 801     Block::delete_block(*block);
 802   }
 803   ActiveArray::destroy(_active_array);
 804   FREE_C_HEAP_ARRAY(char, _name);
 805 }
 806 
 807 void OopStorage::delete_empty_blocks_safepoint() {
 808   assert_at_safepoint();
 809   // Process any pending release updates, which may make more empty
 810   // blocks available for deletion.
 811   while (reduce_deferred_updates()) {}
 812   // Don't interfere with a concurrent iteration.
 813   if (_concurrent_iteration_active) return;
 814   // Delete empty (and otherwise deletable) blocks from end of _allocation_list.
 815   for (Block* block = _allocation_list.tail();
 816        (block != NULL) && block->is_deletable();
 817        block = _allocation_list.tail()) {
 818     _active_array->remove(block);
 819     _allocation_list.unlink(*block);
 820     delete_empty_block(*block);
 821   }
 822 }
 823 
 824 void OopStorage::delete_empty_blocks_concurrent() {
 825   MutexLockerEx ml(_allocation_mutex, Mutex::_no_safepoint_check_flag);
 826   // Other threads could be adding to the empty block count while we
 827   // release the mutex across the block deletions.  Set an upper bound
 828   // on how many blocks we'll try to release, so other threads can't
 829   // cause an unbounded stay in this function.
 830   size_t limit = block_count();
 831 
 832   for (size_t i = 0; i < limit; ++i) {
 833     // Additional updates might become available while we dropped the
 834     // lock.  But limit number processed to limit lock duration.
 835     reduce_deferred_updates();
 836 
 837     Block* block = _allocation_list.tail();
 838     if ((block == NULL) || !block->is_deletable()) {
 839       // No block to delete, so done.  There could be more pending
 840       // deferred updates that could give us more work to do; deal with
 841       // that in some later call, to limit lock duration here.
 842       return;
 843     }
 844 
 845     {
 846       MutexLockerEx aml(_active_mutex, Mutex::_no_safepoint_check_flag);
 847       // Don't interfere with a concurrent iteration.
 848       if (_concurrent_iteration_active) return;
 849       _active_array->remove(block);
 850     }
 851     // Remove block from _allocation_list and delete it.
 852     _allocation_list.unlink(*block);
 853     // Release mutex while deleting block.
 854     MutexUnlockerEx ul(_allocation_mutex, Mutex::_no_safepoint_check_flag);
 855     delete_empty_block(*block);
 856   }
 857 }
 858 
 859 OopStorage::EntryStatus OopStorage::allocation_status(const oop* ptr) const {
 860   const Block* block = find_block_or_null(ptr);
 861   if (block != NULL) {
 862     // Prevent block deletion and _active_array modification.
 863     MutexLockerEx ml(_allocation_mutex, Mutex::_no_safepoint_check_flag);
 864     // Block could be a false positive, so get index carefully.
 865     size_t index = Block::active_index_safe(block);
 866     if ((index < _active_array->block_count()) &&
 867         (block == _active_array->at(index)) &&
 868         block->contains(ptr)) {
 869       if ((block->allocated_bitmask() & block->bitmask_for_entry(ptr)) != 0) {
 870         return ALLOCATED_ENTRY;
 871       } else {
 872         return UNALLOCATED_ENTRY;
 873       }
 874     }
 875   }
 876   return INVALID_ENTRY;
 877 }
 878 
 879 size_t OopStorage::allocation_count() const {
 880   return _allocation_count;
 881 }
 882 
 883 size_t OopStorage::block_count() const {


< prev index next >