/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "gc_implementation/parallelScavenge/parMarkBitMap.hpp"
#include "gc_implementation/shared/collectorCounters.hpp"
#include "gc_implementation/shared/markSweep.hpp"
#include "gc_implementation/shared/mutableSpace.hpp"
#include "memory/sharedHeap.hpp"
class ParallelScavengeHeap;
class PSAdaptiveSizePolicy;
class PSYoungGen;
class PSOldGen;
class PSPermGen;
class ParCompactionManager;
class ParallelTaskTerminator;
class PSParallelCompact;
class GCTaskManager;
class GCTaskQueue;
class PreGCValues;
class MoveAndUpdateClosure;
class RefProcTaskExecutor;
class ParallelOldTracer;
class STWGCTimer;
// The SplitInfo class holds the information needed to 'split' a source region
// so that the live data can be copied to two destination *spaces*. Normally,
// all the live data in a region is copied to a single destination space (e.g.,
// everything live in a region in eden is copied entirely into the old gen).
// However, when the heap is nearly full, all the live data in eden may not fit
// into the old gen. Copying only some of the regions from eden to old gen
// requires finding a region that does not contain a partial object (i.e., no
// live object crosses the region boundary) somewhere near the last object that
// does fit into the old gen. Since it's not always possible to find such a
// region, splitting is necessary for predictable behavior.
//
// A region is always split at the end of the partial object. This avoids
// additional tests when calculating the new location of a pointer, which is a
// very hot code path. The partial object and everything to its left will be
// copied to another space (call it dest_space_1). The live data to the right
// of the partial object will be copied either within the space itself, or to a
// different destination space (distinct from dest_space_1).
//
// Split points are identified during the summary phase, when region
// destinations are computed: data about the split, including the
// partial_object_size, is recorded in a SplitInfo record and the
// partial_object_size field in the summary data is set to zero. The zeroing is
// possible (and necessary) since the partial object will move to a different
// destination space than anything to its right, thus the partial object should
// not affect the locations of any objects to its right.
//
// The recorded data is used during the compaction phase, but only rarely: when
// the partial object on the split region will be copied across a destination
// region boundary. This test is made once each time a region is filled, and is
// a simple address comparison, so the overhead is negligible (see
// PSParallelCompact::first_src_addr()).
//
// Notes:
//
// Only regions with partial objects are split; a region without a partial
// object does not need any extra bookkeeping.
//
// At most one region is split per space, so the amount of data required is
// constant.
//
// A region is split only when the destination space would overflow. Once that
// happens, the destination space is abandoned and no other data (even from
// other source spaces) is targeted to that destination space. Abandoning the
// destination space may leave a somewhat large unused area at the end, if a
// large object caused the overflow.
//
// Future work:
//
// More bookkeeping would be required to continue to use the destination space.
// The most general solution would allow data from regions in two different
// source spaces to be "joined" in a single destination region. At the very
// least, additional code would be required in next_src_region() to detect the
// join and skip to an out-of-order source region. If the join region was also
// the last destination region to which a split region was copied (the most
// likely case), then additional work would be needed to get fill_region() to
// stop iteration and switch to a new source region at the right point. Basic
// idea would be to use a fake value for the top of the source space. It is
// doable, if a bit tricky.
//
// A simpler (but less general) solution would fill the remainder of the
// destination region with a dummy object and continue filling the next
// destination region.
class SplitInfo
{
public:
// Return true if this split info is valid (i.e., if a split has been
// recorded). The very first region cannot have a partial object and thus is
// never split, so 0 is the 'invalid' value.
// Return true if this split holds data for the specified source region.
// The index of the split region, the size of the partial object on that
// region and the destination of the partial object.
// The destination count of the partial object referenced by this split
// (either 1 or 2). This must be added to the destination count of the
// remainder of the source region.
// If a word within the partial object will be written to the first word of a
// destination region, this is the address of the destination region;
// otherwise this is NULL.
// If a word within the partial object will be written to the first word of a
// destination region, this is the address of that word within the partial
// object; otherwise this is NULL.
// Record the data necessary to split the region src_region_idx.
void clear();
DEBUG_ONLY(void verify_clear();)
private:
unsigned int _destination_count;
};
{
}
class SpaceInfo
{
public:
// Where the free space will start after the collection. Valid only after the
// summary phase completes.
// Allows new_top to be set.
// Where the smallest allowable dense prefix ends (used only for perm gen).
// Where the dense prefix ends, or the compacted region begins.
// The start array for the (generation containing the) space, or NULL if there
// is no start array.
private:
};
class ParallelCompactData
{
public:
// Sizes are in HeapWords, unless indicated otherwise.
// Mask for the bits in a size_t to get an offset within a region.
// Mask for the bits in a pointer to get an offset within a region.
// Mask for the bits in a pointer to get the address of the start of a region.
class RegionData
{
public:
// Destination address of the region.
// The first region containing data destined for this region.
// The object (if any) starting in this region and ending in a different
// region that could not be updated during the main (parallel) compaction
// phase. This is different from _partial_obj_addr, which is an object that
// extends onto a source region. However, the two uses do not overlap in
// time, so the same field is used to save space.
// The starting address of the partial object extending onto the region.
// Size of the partial object extending onto the region (words).
// Size of live data that lies within this region due to objects that start
// in this region (words). This does not include the partial object
// extending onto the region (if any), or the part of an object that extends
// onto the next region (if any).
// Total live data that lies within the region (words).
// The destination_count is the number of other regions to which data from
// this region will be copied. At the end of the summary phase, the valid
// values of destination_count are
//
// 0 - data from the region will be compacted completely into itself, or the
// region is empty. The region can be claimed and then filled.
// 1 - data from the region will be compacted into 1 other region; some
// data from the region may also be compacted into the region itself.
// 2 - data from the region will be copied to 2 other regions.
//
// During compaction as regions are emptied, the destination_count is
// decremented (atomically) and when it reaches 0, it can be claimed and
// then filled.
//
// A region is claimed for processing by atomically changing the
// destination_count to the claimed value (dc_claimed). After a region has
// been filled, the destination_count should be set to the completed value
// (dc_completed).
inline uint destination_count() const;
inline uint destination_count_raw() const;
// Whether the block table for this region has been filled.
inline bool blocks_filled() const;
// Number of times the block table was filled.
// The location of the java heap data that corresponds to this region.
inline HeapWord* data_location() const;
// The highest address referenced by objects in this region.
inline HeapWord* highest_ref() const;
// Whether this region is available to be claimed, has been claimed, or has
// been completed.
//
// Minor subtlety: claimed() returns true if the region is marked
// completed(), which is desirable since a region must be claimed before it
// can be completed.
// These are not atomic.
}
inline void set_blocks_filled();
inline void set_completed();
inline bool claim_unsafe();
// These are atomic.
inline void decrement_destination_count();
inline bool claim();
private:
// The type used to represent object sizes within a region.
// Constants for manipulating the _dc_and_los field, which holds both the
// destination count and live obj size. The live obj size lives at the
// least significant end so no masking is necessary when adding.
bool _blocks_filled;
#ifdef ASSERT
// These enable optimizations that are only partially implemented. Use
// debug builds to prevent the code fragments from breaking.
#endif // #ifdef ASSERT
#ifdef ASSERT
public:
private:
#endif
};
// "Blocks" allow shorter sections of the bitmap to be searched. Each Block
// holds an offset, which is the amount of live data in the Region to the left
// of the first live object that starts in the Block.
class BlockData
{
public:
typedef unsigned short int blk_ofs_t;
private:
};
public:
// Fill in the regions covering [beg, end) so that no data moves; i.e., the
// destination of region n is simply the start of region n. The argument beg
// must be region-aligned; end need not be.
HeapWord** target_next);
HeapWord** target_next);
void clear();
}
// Return the number of words between addr and the start of the region
// containing addr.
// Analogous to region_offset() for blocks.
}
// Return the address one past the end of the partial object.
// Return the location of the object after compaction.
return calc_new_pointer((HeapWord*) p);
}
// Return the updated address for the given klass
#ifdef ASSERT
void verify_clear();
#endif // #ifdef ASSERT
private:
bool initialize_block_data();
private:
#ifdef ASSERT
#endif // #ifdef ASSERT
};
inline uint
{
return _dc_and_los & dc_mask;
}
inline uint
{
return destination_count_raw() >> dc_shift;
}
inline bool
{
return _blocks_filled;
}
#ifdef ASSERT
inline size_t
{
return _blocks_filled_count;
}
#endif // #ifdef ASSERT
inline void
{
_blocks_filled = true;
// Debug builds count the number of times the table was filled.
}
inline void
{
}
{
}
{
}
{
DEBUG_ONLY(return _data_location;)
}
{
DEBUG_ONLY(return _highest_ref;)
}
{
}
{
}
// MT-unsafe claiming of a region. Should only be used during single threaded
// execution.
{
if (available()) {
return true;
}
return false;
}
{
}
{
#ifdef ASSERT
}
#endif // #ifdef ASSERT
}
{
(volatile int*) &_dc_and_los, los);
}
inline ParallelCompactData::RegionData*
{
return _region_data + region_idx;
}
inline size_t
{
}
inline ParallelCompactData::BlockData*
return _block_data + n;
}
inline size_t
{
}
inline size_t
{
}
inline ParallelCompactData::RegionData*
{
}
inline HeapWord*
{
}
inline HeapWord*
{
sizeof(RegionData)));
}
inline HeapWord*
{
}
inline HeapWord*
{
}
inline HeapWord*
{
}
inline bool
{
return region_offset(addr) == 0;
}
inline size_t
{
}
inline size_t
{
}
inline ParallelCompactData::BlockData*
{
}
inline HeapWord*
{
}
inline size_t
{
return region << Log2BlocksPerRegion;
}
inline HeapWord*
{
}
inline HeapWord*
{
}
inline bool
{
return block_offset(addr) == 0;
}
// Abstract closure for use with ParMarkBitMap::iterate(), which will invoke the
// do_addr() method.
//
// The closure is initialized with the number of heap words to process
// (words_remaining()), and becomes 'full' when it reaches 0. The do_addr()
// methods in subclasses should update the total as words are processed. Since
// only one subclass actually uses this mechanism to terminate iteration, the
// default initial value is > 0. The implementation is here and not in the
// single subclass that uses it to avoid making is_full() virtual, and thus
// adding a virtual call per live object.
class ParMarkBitMapClosure: public StackObj {
public:
public:
inline ParCompactionManager* compaction_manager() const;
inline ParMarkBitMap* bitmap() const;
inline size_t words_remaining() const;
inline bool is_full() const;
protected:
private:
ParMarkBitMap* const _bitmap;
protected:
};
inline
#ifdef ASSERT
#endif
{
}
return _compaction_manager;
}
return _bitmap;
}
return _words_remaining;
}
inline bool ParMarkBitMapClosure::is_full() const {
return words_remaining() == 0;
}
return _source;
}
}
}
// The UseParallelOldGC collector is a stop-the-world garbage collector that
// does parts of the collection using parallel threads. The collection includes
// the tenured generation and the young generation. The permanent generation is
// collected at the same time as the other two generations but the permanent
// generation is collect by a single GC thread. The permanent generation is
// collected serially because of the requirement that during the processing of a
// klass AAA, any objects reference by AAA must already have been processed.
// This requirement is enforced by a left (lower address) to right (higher
// address) sliding compaction.
//
// There are four phases of the collection.
//
// - marking phase
// - summary phase
// - compacting phase
// - clean up phase
//
// Roughly speaking these phases correspond, respectively, to
// - mark all the live objects
// - calculate the destination of each object at the end of the collection
// - move the objects to their destination
// - update some references and reinitialize some variables
//
// These three phases are invoked in PSParallelCompact::invoke_no_policy(). The
// marking phase is implemented in PSParallelCompact::marking_phase() and does a
// complete marking of the heap. The summary phase is implemented in
// PSParallelCompact::summary_phase(). The move and update phase is implemented
// in PSParallelCompact::compact().
//
// A space that is being collected is divided into regions and with each region
// is associated an object of type ParallelCompactData. Each region is of a
// fixed size and typically will contain more than 1 object and may have parts
// of objects at the front and back of the region.
//
// region -----+---------------------+----------
// objects covered [ AAA )[ BBB )[ CCC )[ DDD )
//
// The marking phase does a complete marking of all live objects in the heap.
// The marking also compiles the size of the data for all live objects covered
// by the region. This size includes the part of any live object spanning onto
// the region (part of AAA if it is live) from the front, all live objects
// any live objects covered by the region that extends off the region (part of
// DDD if it is live). The marking phase uses multiple GC threads and marking
// is done in a bit array of type ParMarkBitMap. The marking of the bit map is
// done atomically as is the accumulation of the size of the live objects
// covered by a region.
//
// The summary phase calculates the total live data to the left of each region
// XXX. Based on that total and the bottom of the space, it can calculate the
// starting location of the live data in XXX. The summary phase calculates for
// each region XXX quantites such as
//
// - the amount of live data at the beginning of a region from an object
// entering the region.
// - the location of the first live data on the region
// - a count of the number of regions receiving live data from XXX.
//
// See ParallelCompactData for precise details. The summary phase also
// calculates the dense prefix for the compaction. The dense prefix is a
// portion at the beginning of the space that is not moved. The objects in the
// dense prefix do need to have their object references updated. See method
// summarize_dense_prefix().
//
// The summary phase is done using 1 GC thread.
//
// The compaction phase moves objects to their new location and updates all
// references in the object.
//
// A current exception is that objects that cross a region boundary are moved
// but do not have their references updated. References are not updated because
// it cannot easily be determined if the klass pointer KKK for the object AAA
// has been updated. KKK likely resides in a region to the left of the region
// containing AAA. These AAA's have there references updated at the end in a
// clean up phase. See the method PSParallelCompact::update_deferred_objects().
// An alternate strategy is being investigated for this deferral of updating.
//
// Compaction is done on a region basis. A region that is ready to be filled is
// put on a ready list and GC threads take region off the list and fill them. A
// region is ready to be filled if it empty of live objects. Such a region may
// have been initially empty (only contained dead objects) or may have had all
// its live objects copied out already. A region that compacts into itself is
// also ready for filling. The ready list is initially filled with empty
// regions and regions compacting into themselves. There is always at least 1
// region that can be put on the ready list. The regions are atomically added
// and removed from the ready list.
class PSParallelCompact : AllStatic {
public:
// Convenient access to type names.
typedef enum {
} SpaceId;
public:
// Inline closure decls
//
class IsAliveClosure: public BoolObjectClosure {
public:
virtual bool do_object_b(oop p);
};
class KeepAliveClosure: public OopClosure {
private:
protected:
template <class T> inline void do_oop_work(T* p);
public:
};
// Current unused
class FollowRootClosure: public OopsInGenClosure {
private:
public:
};
class FollowStackClosure: public VoidClosure {
private:
public:
virtual void do_void();
};
class AdjustPointerClosure: public OopsInGenClosure {
private:
bool _is_root;
public:
// do not walk from thread stacks to the code cache on this phase
};
friend class KeepAliveClosure;
friend class FollowStackClosure;
friend class AdjustPointerClosure;
friend class FollowRootClosure;
friend class instanceKlassKlass;
friend class RefProcTaskProxy;
private:
static STWGCTimer _gc_timer;
static ParallelOldTracer _gc_tracer;
static elapsedTimer _accumulated_time;
static unsigned int _total_invocations;
static unsigned int _maximum_compaction_gc_num;
static CollectorCounters* _counters;
static ParMarkBitMap _mark_bitmap;
static ParallelCompactData _summary_data;
static IsAliveClosure _is_alive_closure;
static bool _print_phases;
// Reference processing (used in ...follow_contents)
static ReferenceProcessor* _ref_processor;
// Updated location of intArrayKlassObj.
static klassOop _updated_int_array_klass_obj;
// Values computed at initialization and used by dead_wood_limiter().
static double _dwl_mean;
static double _dwl_std_dev;
static double _dwl_first_term;
static double _dwl_adjustment;
#ifdef ASSERT
static bool _dwl_initialized;
#endif // #ifdef ASSERT
private:
// Closure accessors
static OopClosure* adjust_root_pointer_closure() { return (OopClosure*)&_adjust_root_pointer_closure; }
static void initialize_space_info();
// Return true if details about individual phases should be printed.
static inline bool print_phases();
// Clear the marking bitmap and summary data that cover the specified space.
static void post_compact();
// Mark live objects
static void follow_weak_klass_links();
static void follow_mdo_weak_refs();
template <class T> static inline void adjust_pointer(T* p, bool is_root);
template <class T>
// Compute the dense prefix for the designated space. This is an experimental
// implementation currently not used in production.
bool maximum_compaction);
// Methods used to compute the dense prefix.
// Compute the value of the normal distribution at x = density. The mean and
// standard deviation are values saved by initialize_dead_wood_limiter().
static inline double normal_distribution(double density);
// Initialize the static vars used by dead_wood_limiter().
static void initialize_dead_wood_limiter();
// Return the percentage of space that can be treated as "dead wood" (i.e.,
// not reclaimed).
// Find the first (left-most) region in the range [beg, end) that has at least
// dead_words of dead space to the left. The argument beg must be the first
// region in the space that is not completely live.
const RegionData* end,
// Return a pointer to the first region in the range [beg, end) that is not
// completely full.
const RegionData* end);
// Return a value indicating the benefit or 'yield' if the compacted region
// were to start (or equivalently if the dense prefix were to end) at the
// candidate region. Higher values are better.
//
// The value is based on the amount of space reclaimed vs. the costs of (a)
// updating references in the dense prefix plus (b) copying objects and
// updating references in the compacted region.
// Compute the dense prefix for the designated space.
bool maximum_compaction);
// Return true if dead space crosses onto the specified Region; bit must be
// the bit index corresponding to the first word of the Region.
// Summary phase utility routine to fill dead space (if any) at the dense
// prefix boundary. Should only be called if the the dense prefix is
// non-empty.
// Clear the summary data source_region field for the specified addresses.
#ifndef PRODUCT
// Routines to provoke splitting a young gen space (ParallelOldGCSplitALot).
// Fill the region [start, start + words) with live object(s). Only usable
// for the old and permanent generations.
// Include the new objects in the summary data.
// Add live objects to a survivor space since it's rare that both survivors
// are non-empty.
static void provoke_split(bool & maximum_compaction);
#endif
static void summarize_spaces_quick();
// Adjust addresses in roots. Does not adjust addresses in heap.
static void adjust_roots();
// Serial code executed in preparation for the compaction phase.
static void compact_prologue();
// Move objects to new locations.
static void compact();
// Add available regions to the stack and draining tasks to the task queue.
static void enqueue_region_draining_tasks(GCTaskQueue* q,
// Add dense prefix update tasks to the task queue.
static void enqueue_dense_prefix_tasks(GCTaskQueue* q,
// Add region stealing tasks to the task queue.
static void enqueue_region_stealing_tasks(
GCTaskQueue* q,
// If objects are left in eden after a collection, try to move the boundary
// and absorb them into the old gen. Returns true if eden was emptied.
// Reset time since last full gc
static void reset_millis_since_last_gc();
protected:
#ifdef VALIDATE_MARK_SWEEP
static GrowableArray<void*>* _root_refs_stack;
static size_t _live_oops_index;
static size_t _live_oops_index_at_perm;
static GrowableArray<void*>* _other_refs_stack;
static GrowableArray<void*>* _adjusted_pointers;
static bool _pointer_tracking;
static bool _root_tracking;
// The following arrays are saved since the time of the last GC and
// assist in tracking down problems where someone has done an errant
// store into the heap, usually to an oop that wasn't properly
// handleized across a GC. If we crash or otherwise fail before the
// next GC, we can query these arrays to find out the object we had
// intended to do the store to (assuming it is still alive) and the
// offset within that object. Covered under RecordMarkSweepCompaction.
#endif
public:
class MarkAndPushClosure: public OopClosure {
private:
public:
};
// Convenient accessor for Universe::heap().
static ParallelScavengeHeap* gc_heap() {
}
static void invoke(bool maximum_heap_compaction);
static bool invoke_no_policy(bool maximum_heap_compaction);
static void post_initialize();
// Perform initialization for PSParallelCompact that requires
// allocations. This should be called during the VM initialization
// at a pointer where it would be appropriate to return a JNI_ENOMEM
// in the event of a failure.
static bool initialize();
// Public accessors
static unsigned int total_invocations() { return _total_invocations; }
// Used to add tasks
static GCTaskManager* const gc_task_manager();
static klassOop updated_int_array_klass_obj() {
return _updated_int_array_klass_obj;
}
// Marking support
// Check mark and maybe push on marking stack
T* p);
// Compaction support.
// Return true if p is in the range [beg_addr, end_addr).
// Convenience wrappers for per-space data kept in _space_info.
// Return true if the klass should be updated.
static inline bool should_update_klass(klassOop k);
// Move and update the live objects in the specified space.
// Process the end of the given region range in the dense prefix.
// This includes saving any object not updated.
// Update a region in the dense prefix. For each live object
// in the region, update it's interior references. For each
// dead object, fill it with deadwood. Dead space at the end
// of a region range will be filled to the start of the next
// live object regardless of the region_index_end. None of the
// objects in the dense prefix move and dead space is dead
// (holds only dead objects that don't need any processing), so
// dead space can be filled in any order.
// Return the address of the count + 1st live word in the range [beg, end).
// Return the address of the word to be copied to dest_addr, which must be
// aligned to a region boundary.
// Determine the next source region, set closure.source() to the start of the
// new region return the region index. Parameter end_addr is the address one
// beyond the end of source range just processed. If necessary, switch to a
// new source space and set src_space_id (in-out parameter) and src_space_top
// (out parameter) accordingly.
// Decrement the destination count for each non-empty source region in the
// range [beg_region, region(region_align_up(end_addr))). If the destination
// count for a region goes to 0 and it needs to be filled, enqueue it.
// Fill a region, copying objects from one or more source regions.
}
// Fill in the block table for the specified region.
// Update the deferred objects in the space.
// Reference Processing
// Return the SpaceId for the given address.
// Time since last full gc (in milliseconds).
static jlong millis_since_last_gc();
#ifdef VALIDATE_MARK_SWEEP
static void track_adjusted_pointer(void* p, bool isroot);
static void check_adjust_pointer(void* p);
static void check_interior_pointers();
static void reset_live_oop_tracking(bool at_perm);
static void compaction_complete();
// Querying operation of RecordMarkSweepCompaction results.
// Finds and prints the current base oop and offset for a word
// within an oop that was live during the last GC. Helpful for
// tracking down heap stomps.
static void print_new_location_of_heap_address(HeapWord* q);
#endif // #ifdef VALIDATE_MARK_SWEEP
// Call backs for class unloading
// Update subklass/sibling/implementor links at end of marking.
// Clear unmarked oops in MDOs at the end of marking.
#ifndef PRODUCT
// Debugging support.
static const char* space_names[last_space_id];
static void print_region_ranges();
static void print_dense_prefix_stats(const char* const algorithm,
const bool maximum_compaction,
#endif // #ifndef PRODUCT
#ifdef ASSERT
// Sanity check the new location of a word in the heap.
// Verify that all the regions have been emptied.
#endif // #ifdef ASSERT
};
return true;
} else {
return false;
}
}
template <class T>
"roots shouldn't be things within the heap");
#ifdef VALIDATE_MARK_SWEEP
if (ValidateMarkSweep) {
_root_refs_stack->push(p);
}
#endif
}
}
}
}
template <class T>
}
}
}
template <class T>
"should be forwarded");
// Just always do the update unconditionally?
"should be in object space");
}
}
}
template <class T>
#ifdef VALIDATE_MARK_SWEEP
if (ValidateMarkSweep) {
_root_refs_stack->push(p);
} else {
_other_refs_stack->push(p);
}
}
#endif
}
inline bool PSParallelCompact::print_phases() {
return _print_phases;
}
}
inline bool
{
"sanity check");
// Dead space crosses the boundary if (1) a partial object does not extend
// onto the region, (2) an object does not start at the beginning of the
// region, and (3) an object does not end at the end of the prior region.
return region->partial_obj_size() == 0 &&
}
inline bool
}
inline bool
}
}
}
}
}
}
#ifdef ASSERT
inline void
{
"must move left or to a different space");
"checking alignment");
}
#endif // ASSERT
class MoveAndUpdateClosure: public ParMarkBitMapClosure {
public:
// Accessors.
// If the object will fit (size <= words_remaining()), copy it to the current
// destination, update the interior oops and the start array and return either
// full (if the closure is full) or incomplete. If the object will not fit,
// return would_overflow.
// Copy enough words to fill this closure, starting at source(). Interior
// oops and the start array are not updated. Return full.
// Copy enough words to fill this closure or to the end of an object,
// whichever is smaller, starting at source(). Interior oops and the start
// array are not updated.
void copy_partial_obj();
protected:
// Update variables to indicate that word_count words were processed.
protected:
ObjectStartArray* const _start_array;
};
inline
{
}
{
_destination += words;
}
class UpdateOnlyClosure: public ParMarkBitMapClosure {
private:
ObjectStartArray* const _start_array;
public:
// Update the object.
};
{
}
class FillClosure: public ParMarkBitMapClosure
{
public:
{
"cannot use FillClosure in the young gen");
}
do {
return ParMarkBitMap::incomplete;
}
private:
ObjectStartArray* const _start_array;
};
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPARALLELCOMPACT_HPP