< prev index next >

src/share/vm/gc/shared/space.inline.hpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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_VM_MEMORY_SPACE_INLINE_HPP
  26 #define SHARE_VM_MEMORY_SPACE_INLINE_HPP
  27 
  28 #include "gc_implementation/shared/liveRange.hpp"
  29 #include "gc_implementation/shared/markSweep.inline.hpp"
  30 #include "gc_implementation/shared/spaceDecorator.hpp"
  31 #include "gc_interface/collectedHeap.hpp"
  32 #include "memory/generation.hpp"
  33 #include "memory/space.hpp"
  34 #include "memory/universe.hpp"
  35 #include "runtime/prefetch.inline.hpp"
  36 #include "runtime/safepoint.hpp"
  37 
  38 inline HeapWord* Space::block_start(const void* p) {
  39   return block_start_const(p);
  40 }
  41 
  42 inline HeapWord* OffsetTableContigSpace::allocate(size_t size) {
  43   HeapWord* res = ContiguousSpace::allocate(size);
  44   if (res != NULL) {
  45     _offsets.alloc_block(res, size);
  46   }
  47   return res;
  48 }
  49 
  50 // Because of the requirement of keeping "_offsets" up to date with the
  51 // allocations, we sequentialize these with a lock.  Therefore, best if
  52 // this is used for larger LAB allocations only.
  53 inline HeapWord* OffsetTableContigSpace::par_allocate(size_t size) {


 314       debug_only(prev_q = q);
 315       q += size;
 316     }
 317   }
 318 
 319   // Let's remember if we were empty before we did the compaction.
 320   bool was_empty = space->used_region().is_empty();
 321   // Reset space after compaction is complete
 322   space->reset_after_compaction();
 323   // We do this clear, below, since it has overloaded meanings for some
 324   // space subtypes.  For example, OffsetTableContigSpace's that were
 325   // compacted into will have had their offset table thresholds updated
 326   // continuously, but those that weren't need to have their thresholds
 327   // re-initialized.  Also mangles unused area for debugging.
 328   if (space->used_region().is_empty()) {
 329     if (!was_empty) space->clear(SpaceDecorator::Mangle);
 330   } else {
 331     if (ZapUnusedHeapArea) space->mangle_unused_area();
 332   }
 333 }
 334 #endif // SHARE_VM_MEMORY_SPACE_INLINE_HPP


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  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_VM_GC_SHARED_SPACE_INLINE_HPP
  26 #define SHARE_VM_GC_SHARED_SPACE_INLINE_HPP
  27 
  28 #include "gc/serial/markSweep.inline.hpp"
  29 #include "gc/shared/collectedHeap.hpp"
  30 #include "gc/shared/generation.hpp"
  31 #include "gc/shared/liveRange.hpp"
  32 #include "gc/shared/space.hpp"
  33 #include "gc/shared/spaceDecorator.hpp"
  34 #include "memory/universe.hpp"
  35 #include "runtime/prefetch.inline.hpp"
  36 #include "runtime/safepoint.hpp"
  37 
  38 inline HeapWord* Space::block_start(const void* p) {
  39   return block_start_const(p);
  40 }
  41 
  42 inline HeapWord* OffsetTableContigSpace::allocate(size_t size) {
  43   HeapWord* res = ContiguousSpace::allocate(size);
  44   if (res != NULL) {
  45     _offsets.alloc_block(res, size);
  46   }
  47   return res;
  48 }
  49 
  50 // Because of the requirement of keeping "_offsets" up to date with the
  51 // allocations, we sequentialize these with a lock.  Therefore, best if
  52 // this is used for larger LAB allocations only.
  53 inline HeapWord* OffsetTableContigSpace::par_allocate(size_t size) {


 314       debug_only(prev_q = q);
 315       q += size;
 316     }
 317   }
 318 
 319   // Let's remember if we were empty before we did the compaction.
 320   bool was_empty = space->used_region().is_empty();
 321   // Reset space after compaction is complete
 322   space->reset_after_compaction();
 323   // We do this clear, below, since it has overloaded meanings for some
 324   // space subtypes.  For example, OffsetTableContigSpace's that were
 325   // compacted into will have had their offset table thresholds updated
 326   // continuously, but those that weren't need to have their thresholds
 327   // re-initialized.  Also mangles unused area for debugging.
 328   if (space->used_region().is_empty()) {
 329     if (!was_empty) space->clear(SpaceDecorator::Mangle);
 330   } else {
 331     if (ZapUnusedHeapArea) space->mangle_unused_area();
 332   }
 333 }
 334 #endif // SHARE_VM_GC_SHARED_SPACE_INLINE_HPP
< prev index next >