/*
* 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/psVirtualspace.hpp"
#include "gc_implementation/shared/mutableSpace.hpp"
#include "gc_implementation/shared/spaceCounters.hpp"
#include "runtime/safepoint.hpp"
class PSMarkSweepDecorator;
friend class VMStructs;
friend class PSPromotionManager; // Uses the cas_allocate methods
friend class ParallelScavengeHeap;
friend class AdjoiningGenerations;
protected:
// Performance Counters
// Sizing information, in bytes, set in constructor
// Used when initializing the _name field.
static inline const char* select_name();
// We assume the heap lock is held here.
}
return res;
}
// Support for MT garbage collection. CAS allocation is lower overhead than grabbing
// and releasing the heap lock, which is held during gc's anyway. This method is not
// safe for use at the same time as allocate_noexpand()!
}
return res;
}
// Support for MT garbage collection. See above comment.
}
bool expand_to_reserved();
void post_resize();
public:
// Initialize the generation.
const char* perf_data_name, int level);
const char* perf_data_name, int level);
const char* perf_data_name, int level);
// Returns limit on the maximum size of the generation. This
// is the same as _max_gen_size for PSOldGen but need not be
// for a derived class.
virtual size_t gen_size_limit();
bool is_in(const void* p) const {
return _virtual_space->contains((void *)p);
}
bool is_in_reserved(const void* p) const {
}
// Has the generation been successfully allocated?
bool is_allocated();
// MarkSweep methods
virtual void precompact();
void adjust_pointers();
void compact();
// Size info
// Includes uncommitted memory
size_t contiguous_available() const;
bool is_maximal_no_gc() const {
return virtual_space()->uncommitted_size() == 0;
}
// Calculating new sizes
// Allocation. We report all successful allocations to the size policy
// Note that the perm gen does not use this method, and should not!
// Iteration.
// Debugging - do not use for time critical operations
virtual void print() const;
void verify();
void verify_object_start_array();
// These should not used
virtual void reset_after_change();
// These should not used
virtual size_t available_for_expansion();
virtual size_t available_for_contraction();
// Performace Counter support
void update_counters();
// Printing support
// Debugging support
// Save the tops of all spaces for later use during mangling.
};
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSOLDGEN_HPP