< prev index next >
src/hotspot/share/gc/shared/gcConfig.cpp
Print this page
rev 49911 : imported patch removeAllGCs
*** 21,86 ****
* questions.
*
*/
#include "precompiled.hpp"
- #include "gc/serial/serialArguments.hpp"
#include "gc/shared/gcConfig.hpp"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "utilities/macros.hpp"
! #if INCLUDE_ALL_GCS
! #include "gc/parallel/parallelArguments.hpp"
#include "gc/cms/cmsArguments.hpp"
#include "gc/g1/g1Arguments.hpp"
! #endif // INCLUDE_ALL_GCS
struct SupportedGC {
bool& _flag;
CollectedHeap::Name _name;
GCArguments& _arguments;
SupportedGC(bool& flag, CollectedHeap::Name name, GCArguments& arguments) :
_flag(flag), _name(name), _arguments(arguments) {}
};
! static SerialArguments serialArguments;
! #if INCLUDE_ALL_GCS
! static ParallelArguments parallelArguments;
! static CMSArguments cmsArguments;
! static G1Arguments g1Arguments;
! #endif // INCLUDE_ALL_GCS
// Table of supported GCs, for translating between command
// line flag, CollectedHeap::Name and GCArguments instance.
static const SupportedGC SupportedGCs[] = {
! SupportedGC(UseSerialGC, CollectedHeap::Serial, serialArguments),
! #if INCLUDE_ALL_GCS
! SupportedGC(UseParallelGC, CollectedHeap::Parallel, parallelArguments),
! SupportedGC(UseParallelOldGC, CollectedHeap::Parallel, parallelArguments),
! SupportedGC(UseConcMarkSweepGC, CollectedHeap::CMS, cmsArguments),
! SupportedGC(UseG1GC, CollectedHeap::G1, g1Arguments),
! #endif // INCLUDE_ALL_GCS
};
GCArguments* GCConfig::_arguments = NULL;
bool GCConfig::_gc_selected_ergonomically = false;
void GCConfig::select_gc_ergonomically() {
- #if INCLUDE_ALL_GCS
if (os::is_server_class_machine()) {
FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true);
} else {
FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
}
! #else
! UNSUPPORTED_OPTION(UseG1GC);
! UNSUPPORTED_OPTION(UseParallelGC);
! UNSUPPORTED_OPTION(UseParallelOldGC);
! UNSUPPORTED_OPTION(UseConcMarkSweepGC);
! FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
! #endif // INCLUDE_ALL_GCS
}
bool GCConfig::is_no_gc_selected() {
for (size_t i = 0; i < ARRAY_SIZE(SupportedGCs); i++) {
if (SupportedGCs[i]._flag) {
--- 21,94 ----
* questions.
*
*/
#include "precompiled.hpp"
#include "gc/shared/gcConfig.hpp"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "utilities/macros.hpp"
! #if INCLUDE_CMSGC
#include "gc/cms/cmsArguments.hpp"
+ #endif
+ #if INCLUDE_G1GC
#include "gc/g1/g1Arguments.hpp"
! #endif
! #if INCLUDE_PARALLELGC
! #include "gc/parallel/parallelArguments.hpp"
! #endif
! #if INCLUDE_SERIALGC
! #include "gc/serial/serialArguments.hpp"
! #endif
struct SupportedGC {
bool& _flag;
CollectedHeap::Name _name;
GCArguments& _arguments;
SupportedGC(bool& flag, CollectedHeap::Name name, GCArguments& arguments) :
_flag(flag), _name(name), _arguments(arguments) {}
};
! CMSGC_ONLY(static CMSArguments cmsArguments;)
! G1GC_ONLY(static G1Arguments g1Arguments;)
! PARALLELGC_ONLY(static ParallelArguments parallelArguments;)
! SERIALGC_ONLY(static SerialArguments serialArguments;)
// Table of supported GCs, for translating between command
// line flag, CollectedHeap::Name and GCArguments instance.
static const SupportedGC SupportedGCs[] = {
! CMSGC_ONLY_ARG(SupportedGC(UseConcMarkSweepGC, CollectedHeap::CMS, cmsArguments))
! G1GC_ONLY_ARG(SupportedGC(UseG1GC, CollectedHeap::G1, g1Arguments))
! PARALLELGC_ONLY_ARG(SupportedGC(UseParallelGC, CollectedHeap::Parallel, parallelArguments))
! PARALLELGC_ONLY_ARG(SupportedGC(UseParallelOldGC, CollectedHeap::Parallel, parallelArguments))
! SERIALGC_ONLY_ARG(SupportedGC(UseSerialGC, CollectedHeap::Serial, serialArguments))
};
GCArguments* GCConfig::_arguments = NULL;
bool GCConfig::_gc_selected_ergonomically = false;
void GCConfig::select_gc_ergonomically() {
if (os::is_server_class_machine()) {
+ #if INCLUDE_G1GC
FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true);
+ #elif INCLUDE_PARALLELGC
+ FLAG_SET_ERGO_IF_DEFAULT(bool, UseParallelGC, true);
+ #elif INCLUDE_SERIALGC
+ FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
+ #endif
} else {
+ #if INCLUDE_SERIALGC
FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
+ #endif
}
!
! NOT_CMSGC(UNSUPPORTED_OPTION(UseConcMarkSweepGC));
! NOT_G1GC(UNSUPPORTED_OPTION(UseG1GC);)
! NOT_PARALLELGC(UNSUPPORTED_OPTION(UseParallelGC);)
! NOT_PARALLELGC(UNSUPPORTED_OPTION(UseParallelOldGC));
! NOT_SERIALGC(UNSUPPORTED_OPTION(UseSerialGC);)
}
bool GCConfig::is_no_gc_selected() {
for (size_t i = 0; i < ARRAY_SIZE(SupportedGCs); i++) {
if (SupportedGCs[i]._flag) {
< prev index next >