/*
* 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/shared/generationCounters.hpp"
// All heaps contains a "permanent generation," containing permanent
// (reflective) objects. This is like a regular generation in some ways,
// but unlike one in others, and so is split apart.
class PermanentGenerationSpec;
// This is the "generation" view of a CompactingPermGen.
// NOTE: the shared spaces used for CDS are here handled in
// a somewhat awkward and potentially buggy fashion, see CR 6801625.
// This infelicity should be fixed, see CR 6897789.
friend class VMStructs;
// Abstractly, this is a subtype that gets access to protected fields.
friend class CompactingPermGen;
private:
// Shared spaces
// With shared spaces there is a dichotomy in the use of the
// _virtual_space of the generation. There is a portion of the
// _virtual_space that is used for the unshared part of the
// permanent generation and a portion that is reserved for the shared part.
// The _reserved field in the generation represents both the
// unshared and shared parts of the generation. The _reserved
// variable is initialized for only the unshared part but is
// later extended to include the shared part during initialization
// if shared spaces are being used.
// The reserved size for the _virtual_space for CompactingPermGenGen
// is the size of the space for the permanent generation including the
// the shared spaces. This can be seen by the use of MaxPermSize
// in the allocation of PermanentGenerationSpec. The space for the
// shared spaces is committed separately (???).
// In general at initialization only a part of the
// space for the unshared part of the permanent generation is
// committed and more is committed as the permanent generation is
// grown. In growing the permanent generation the capacity() and
// max_capacity() of the generation are used. For the permanent
// generation (implemented with a CompactingPermGenGen) the capacity()
// is taken from the capacity of the space (_the_space variable used for the
// unshared part of the generation) and the max_capacity() is based
// on the size of the _reserved variable (which includes the size of the
// shared spaces) minus the size of the shared spaces.
// These values are redundant, but are called out separately to avoid
// Performance Counters
void initialize_performance_counters();
public:
enum {
// subclass) objects, or greater.
};
enum {
};
const char* name() const {
return "compacting perm gen";
}
const char* short_name() const {
return "Perm";
}
// Return the maximum capacity for the object space. This
// explicitly does not include the shared spaces.
size_t max_capacity() const;
void update_counters();
void compute_new_size() {
assert(false, "Should not call this -- handled at PermGen level.");
}
bool must_be_youngest() const { return false; }
bool must_be_oldest() const { return false; }
static bool inline is_shared(const void* p) {
return p >= shared_bottom && p < shared_end;
}
// RedefineClasses note: this tester is used to check residence of
// the specified oop in the shared readonly space and not whether
// the oop is readonly.
static bool inline is_shared_readonly(const void* p) {
return p >= readonly_bottom && p < readonly_end;
}
// RedefineClasses note: this tester is used to check residence of
// the specified oop in the shared readwrite space and not whether
// the oop is readwrite.
static bool inline is_shared_readwrite(const void* p) {
return p >= readwrite_bottom && p < readwrite_end;
}
// Checks if the pointer is either in unshared space or in shared space
inline bool is_in(const void* p) const {
}
void pre_adjust_pointers();
void adjust_pointers();
void compact();
void post_compact();
size_t contiguous_available() const;
void clear_remembered_set();
void invalidate_remembered_set();
else return false;
}
}
}
}
}
}
else {
}
}
static void generate_vtable_methods(void** vtbl_list,
void** vtable,
static void* find_matching_vtbl_ptr(void** vtbl_list,
void* new_vtable_start,
void* obj);
void verify();
// Serialization
static void initialize_oops();
// Initiate dumping of shared file.
// Remap the shared readonly space to shared readwrite, private if
// sharing is enabled. Simply returns true if sharing is not enabled
// or if the remapping has already been done by a prior call.
static bool remap_shared_readonly_as_readwrite();
};
#endif // SHARE_VM_MEMORY_COMPACTINGPERMGENGEN_HPP