/*
* 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 "memory/compactPermGen.hpp"
#include "memory/defNewGeneration.hpp"
#include "memory/filemap.hpp"
#include "memory/genRemSet.hpp"
#include "memory/generationSpec.hpp"
#include "memory/tenuredGeneration.hpp"
#ifndef SERIALGC
#include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp"
#include "gc_implementation/parNew/asParNewGeneration.hpp"
#include "gc_implementation/parNew/parNewGeneration.hpp"
#endif
switch (name()) {
case Generation::DefNew:
case Generation::MarkSweepCompact:
#ifndef SERIALGC
case Generation::ParNew:
case Generation::ASParNew:
return new ASParNewGeneration(rs,
init_size(),
init_size() /* min size */,
level);
case Generation::ConcurrentMarkSweep: {
vm_exit_during_initialization("Rem set incompatibility.");
}
// Otherwise
// The constructor creates the CMSCollector if needed,
// else registers with an existing CMSCollector
g = new ConcurrentMarkSweepGeneration(rs,
return g;
}
case Generation::ASConcurrentMarkSweep: {
vm_exit_during_initialization("Rem set incompatibility.");
}
// Otherwise
// The constructor creates the CMSCollector if needed,
// else registers with an existing CMSCollector
g = new ASConcurrentMarkSweepGeneration(rs,
return g;
}
#endif // SERIALGC
default:
guarantee(false, "unrecognized GenerationName");
return NULL;
}
}
if (UseSharedSpaces || DumpSharedSpaces) {
_enable_shared_spaces = true;
if (UseSharedSpaces) {
// Override shared space sizes from those in the file.
} else {
}
} else {
_enable_shared_spaces = false;
_read_only_size = 0;
_read_write_size = 0;
_misc_data_size = 0;
_misc_code_size = 0;
}
}
// Break the reserved spaces into pieces for the permanent space
// and the shared spaces.
if (enable_shared_spaces()) {
if (!perm_rs.is_reserved() ||
"reserve address space.");
}
}
switch (name()) {
case PermGen::MarkSweepCompact:
#ifndef SERIALGC
guarantee(false, "NYI");
return NULL;
case PermGen::ConcurrentMarkSweep: {
vm_exit_during_initialization("RemSet/generation incompatibility.");
}
// XXXPERM
}
#endif // SERIALGC
default:
guarantee(false, "unrecognized GenerationName");
return NULL;
}
}
// Alignment
"Shared space when disabled?");
}