src/share/vm/memory/blockOffsetTable.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hs25_8011661 Sdiff src/share/vm/memory

src/share/vm/memory/blockOffsetTable.cpp

Print this page




  63     gclog_or_tty->print_cr("  "
  64                   "  _vs.low_boundary(): " INTPTR_FORMAT
  65                   "  _vs.high_boundary(): " INTPTR_FORMAT,
  66                   _vs.low_boundary(),
  67                   _vs.high_boundary());
  68   }
  69 }
  70 
  71 void BlockOffsetSharedArray::resize(size_t new_word_size) {
  72   assert(new_word_size <= _reserved.word_size(), "Resize larger than reserved");
  73   size_t new_size = compute_size(new_word_size);
  74   size_t old_size = _vs.committed_size();
  75   size_t delta;
  76   char* high = _vs.high();
  77   _end = _reserved.start() + new_word_size;
  78   if (new_size > old_size) {
  79     delta = ReservedSpace::page_align_size_up(new_size - old_size);
  80     assert(delta > 0, "just checking");
  81     if (!_vs.expand_by(delta)) {
  82       // Do better than this for Merlin
  83       vm_exit_out_of_memory(delta, "offset table expansion");
  84     }
  85     assert(_vs.high() == high + delta, "invalid expansion");
  86   } else {
  87     delta = ReservedSpace::page_align_size_down(old_size - new_size);
  88     if (delta == 0) return;
  89     _vs.shrink_by(delta);
  90     assert(_vs.high() == high - delta, "invalid expansion");
  91   }
  92 }
  93 
  94 bool BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const {
  95   assert(p >= _reserved.start(), "just checking");
  96   size_t delta = pointer_delta(p, _reserved.start());
  97   return (delta & right_n_bits(LogN_words)) == (size_t)NoBits;
  98 }
  99 
 100 
 101 //////////////////////////////////////////////////////////////////////
 102 // BlockOffsetArray
 103 //////////////////////////////////////////////////////////////////////




  63     gclog_or_tty->print_cr("  "
  64                   "  _vs.low_boundary(): " INTPTR_FORMAT
  65                   "  _vs.high_boundary(): " INTPTR_FORMAT,
  66                   _vs.low_boundary(),
  67                   _vs.high_boundary());
  68   }
  69 }
  70 
  71 void BlockOffsetSharedArray::resize(size_t new_word_size) {
  72   assert(new_word_size <= _reserved.word_size(), "Resize larger than reserved");
  73   size_t new_size = compute_size(new_word_size);
  74   size_t old_size = _vs.committed_size();
  75   size_t delta;
  76   char* high = _vs.high();
  77   _end = _reserved.start() + new_word_size;
  78   if (new_size > old_size) {
  79     delta = ReservedSpace::page_align_size_up(new_size - old_size);
  80     assert(delta > 0, "just checking");
  81     if (!_vs.expand_by(delta)) {
  82       // Do better than this for Merlin
  83       vm_exit_out_of_memory(delta, OOM_MMAP_ERROR, "offset table expansion");
  84     }
  85     assert(_vs.high() == high + delta, "invalid expansion");
  86   } else {
  87     delta = ReservedSpace::page_align_size_down(old_size - new_size);
  88     if (delta == 0) return;
  89     _vs.shrink_by(delta);
  90     assert(_vs.high() == high - delta, "invalid expansion");
  91   }
  92 }
  93 
  94 bool BlockOffsetSharedArray::is_card_boundary(HeapWord* p) const {
  95   assert(p >= _reserved.start(), "just checking");
  96   size_t delta = pointer_delta(p, _reserved.start());
  97   return (delta & right_n_bits(LogN_words)) == (size_t)NoBits;
  98 }
  99 
 100 
 101 //////////////////////////////////////////////////////////////////////
 102 // BlockOffsetArray
 103 //////////////////////////////////////////////////////////////////////


src/share/vm/memory/blockOffsetTable.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File