/*
* 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 "precompiled.hpp"
#include "gc_implementation/shared/gcTimer.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/spaceDecorator.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/blockOffsetTable.inline.hpp"
#include "memory/cardTableRS.hpp"
#include "memory/gcLocker.inline.hpp"
#include "memory/genCollectedHeap.hpp"
#include "memory/genMarkSweep.hpp"
#include "memory/genOopClosures.hpp"
#include "memory/genOopClosures.inline.hpp"
#include "memory/generation.hpp"
#include "memory/generation.inline.hpp"
#include "memory/space.inline.hpp"
#include "oops/oop.inline.hpp"
#include "utilities/events.hpp"
vm_exit_during_initialization("Could not reserve enough space for "
"object heap");
}
// Mangle all of the the initial generation.
if (ZapUnusedHeapArea) {
}
}
}
}
if (PrintGCDetails && Verbose) {
"->" SIZE_FORMAT
} else {
}
}
// By default we get a single threaded default reference processor;
// generations needing multi-threaded refs processing or discovery override this method.
if (_ref_processor == NULL) {
vm_exit_during_initialization("Could not allocate ReferenceProcessor object");
}
}
}
"%d GC's, avg GC time %3.7f]",
}
// Utility iterator classes
public:
const void* _p;
}
}
};
public:
const void* _p;
}
}
};
}
"Wrong youngest generation type");
return (DefNewGeneration*) this;
}
} else {
return NULL;
}
}
// The largest number of contiguous free words in this or any higher generation.
}
}
return max;
}
}
return res;
}
// Ignores "ref" and calls allocate().
#ifndef PRODUCT
return NULL;
}
#endif // #ifndef PRODUCT
} else {
}
}
// Could do a bad general impl here that gets a lock. But no.
return NULL;
}
// Could do a bad general impl here that gets a lock. But no.
guarantee(false, "No good general implementation.");
}
// Cast away const
}
// Some of these are mediocre general implementations. Should be
// overridden to get better performance.
public:
const void* _p;
}
}
};
// Cast away const
}
public:
}
}
};
// Cast away const
}
public:
bool is_obj;
}
}
};
// Cast away const
}
public:
}
};
space_iterate(&blk);
}
space_iterate(&blk);
}
OopsInGenClosure* cl) {
}
private:
public:
s->object_iterate(_cl);
}
};
space_iterate(&blk);
}
private:
public:
s->safe_object_iterate(_cl);
}
};
space_iterate(&blk);
}
// Generic implementation, can be specialized
}
}
public:
sp->adjust_pointers();
}
};
// Note that this is done over all spaces, not just the compactible
// ones.
space_iterate(&blk, true);
}
}
}
int level,
{
vm_exit_during_initialization("Could not allocate a BlockOffsetArray");
// Verify that the start and end of this generation is the start of a card.
// If this wasn't true, a single card could span more than on generation,
// clear and dirty cards.
// Don't check at the very end of the heap as we'll assert that we're probing off
// the end if we try.
}
}
if (bytes == 0) {
return true; // That's what grow_by(0) would return
}
if (aligned_bytes == 0){
// The alignment caused the number of bytes to wrap. An expand_by(0) will
// return true with the implication that an expansion was done when it
// was not. A call to expand implies a best effort to expand by "bytes"
// but not a guarantee. Align down to give a best effort. This is likely
// the most that the generation can expand since it has some capacity to
// start with.
}
bool success = false;
if (aligned_expand_bytes > aligned_bytes) {
}
if (!success) {
}
if (!success) {
success = grow_to_reserved();
}
}
}
return success;
}
// No young generation references, clear this generation's cards.
}
// Objects in this generation may have moved, invalidate this
// generation's cards.
}
// Currently nothing to do.
bool clear_all_soft_refs,
bool is_tlab) {
// Temporarily expand the span of our ref processor, so
// refs discovery is over the entire heap, not just this generation
}
bool is_tlab,
bool parallel) {
if (parallel) {
while (true) {
if (GCExpandToAllocateDelayMillis > 0) {
}
return result;
} else {
// If there's not enough expansion space available, give up.
return NULL;
}
// else try again
}
}
} else {
}
}
}
if (size > 0) {
}
}
return _the_space->capacity();
}
return _the_space->used();
}
return _the_space->free();
}
return the_space()->used_region();
}
return _the_space->free();
}
}
if (result) {
// Expand card table
// Expand shared block offset array
// Fix for bug #4668531
if (ZapUnusedHeapArea) {
}
// Expand space -- also expands space's BOT
// (which uses (part of) shared array above)
// update the space and generation capacity counters
}
}
return result;
}
bool success = true;
if (remaining_bytes > 0) {
}
return success;
}
// Shrink committed space
// Shrink space; this also shrinks the space's BOT
// Shrink the shared block offset array
// Shrink the card table
}
}
// Currently nothing to do.
// Override for a card-table generation with one contiguous
// space. NOTE: For reasons that are lost in the fog of history,
// this code is used when you iterate over perm gen objects,
// even when one uses CDS, where the perm gen has a couple of
// other spaces; this is because CompactingPermGenGen derives
// from OneContigSpaceCardGeneration. This should be cleaned up,
// see CR 6897789..
}
bool usedOnly) {
}
// Deal with delayed initialization of _the_space,
// and lack of initialization of _last_gc.
}
}
blk->set_generation(this);
blk->reset_generation();
}
}
}
return _the_space->saved_mark_at_top();
}
\
void OneContigSpaceCardGeneration:: \
blk->set_generation(this); \
blk->reset_generation(); \
save_marks(); \
}
// update the generation and space performance counters
if (ZapUnusedHeapArea) {
}
}
}
}
}