< prev index next >

src/hotspot/share/memory/archiveUtils.inline.hpp

Print this page


  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_MEMORY_ARCHIVEUTILS_INLINE_HPP
  26 #define SHARE_MEMORY_ARCHIVEUTILS_INLINE_HPP
  27 
  28 #include "memory/archiveUtils.hpp"
  29 #include "utilities/bitMap.inline.hpp"
  30 
  31 template <bool COMPACTING>
  32 inline bool SharedDataRelocator<COMPACTING>::do_bit(size_t offset) {
  33   address* p = _patch_base + offset;
  34   assert(_patch_base <= p && p < _patch_end, "must be");
  35 
  36   address old_ptr = *p;



  37   assert(_valid_old_base <= old_ptr && old_ptr < _valid_old_end, "must be");

  38 
  39   if (COMPACTING) {
  40     // Start-up performance: use a template parameter to elide this block for run-time archive
  41     // relocation.
  42     assert(Arguments::is_dumping_archive(), "Don't do this during run-time archive loading!");
  43     if (old_ptr == NULL) {
  44       _ptrmap->clear_bit(offset);
  45       DEBUG_ONLY(log_trace(cds, reloc)("Clearing pointer [" PTR_FORMAT  "] -> NULL @ " SIZE_FORMAT_W(9), p2i(p), offset));
  46       return true;
  47     } else {
  48       _max_non_null_offset = offset;
  49     }
  50   } else {
  51     assert(old_ptr != NULL, "bits for NULL pointers should have been cleaned at dump time");
  52   }
  53 
  54   address new_ptr = old_ptr + _delta;
  55   assert(new_ptr != NULL, "don't point to the bottom of the archive"); // See ArchivePtrMarker::mark_pointer().
  56   assert(_valid_new_base <= new_ptr && new_ptr < _valid_new_end, "must be");
  57 


  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_MEMORY_ARCHIVEUTILS_INLINE_HPP
  26 #define SHARE_MEMORY_ARCHIVEUTILS_INLINE_HPP
  27 
  28 #include "memory/archiveUtils.hpp"
  29 #include "utilities/bitMap.inline.hpp"
  30 
  31 template <bool COMPACTING>
  32 inline bool SharedDataRelocator<COMPACTING>::do_bit(size_t offset) {
  33   address* p = _patch_base + offset;
  34   assert(_patch_base <= p && p < _patch_end, "must be");
  35 
  36   address old_ptr = *p;
  37   if (old_ptr == NULL) {
  38     assert(COMPACTING, "NULL pointers should not be marked when relocating at run-time");
  39   } else {
  40     assert(_valid_old_base <= old_ptr && old_ptr < _valid_old_end, "must be");
  41   }
  42 
  43   if (COMPACTING) {
  44     // Start-up performance: use a template parameter to elide this block for run-time archive
  45     // relocation.
  46     assert(Arguments::is_dumping_archive(), "Don't do this during run-time archive loading!");
  47     if (old_ptr == NULL) {
  48       _ptrmap->clear_bit(offset);
  49       DEBUG_ONLY(log_trace(cds, reloc)("Clearing pointer [" PTR_FORMAT  "] -> NULL @ " SIZE_FORMAT_W(9), p2i(p), offset));
  50       return true;
  51     } else {
  52       _max_non_null_offset = offset;
  53     }
  54   } else {
  55     assert(old_ptr != NULL, "bits for NULL pointers should have been cleaned at dump time");
  56   }
  57 
  58   address new_ptr = old_ptr + _delta;
  59   assert(new_ptr != NULL, "don't point to the bottom of the archive"); // See ArchivePtrMarker::mark_pointer().
  60   assert(_valid_new_base <= new_ptr && new_ptr < _valid_new_end, "must be");
  61 
< prev index next >