提交 da2f5384 编写于 作者: J jcoomes

8057623: add an extension class for argument handling

Reviewed-by: brutisso, mgerdin, tschatzl
上级 2acef63c
......@@ -35,6 +35,7 @@
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/arguments.hpp"
#include "runtime/arguments_ext.hpp"
#include "runtime/globals_extension.hpp"
#include "runtime/java.hpp"
#include "services/management.hpp"
......@@ -1544,7 +1545,7 @@ void Arguments::select_gc_ergonomically() {
void Arguments::select_gc() {
if (!gc_selected()) {
select_gc_ergonomically();
ArgumentsExt::select_gc_ergonomically();
}
}
......@@ -2033,7 +2034,7 @@ bool Arguments::verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_hea
}
// Check consistency of GC selection
bool Arguments::check_gc_consistency() {
bool Arguments::check_gc_consistency_user() {
check_gclog_consistency();
bool status = true;
// Ensure that the user has not selected conflicting sets
......@@ -2199,7 +2200,7 @@ bool Arguments::check_vm_args_consistency() {
FLAG_SET_DEFAULT(UseGCOverheadLimit, false);
}
status = status && check_gc_consistency();
status = status && ArgumentsExt::check_gc_consistency_user();
status = status && check_stack_pages();
if (CMSIncrementalMode) {
......@@ -2447,8 +2448,6 @@ bool Arguments::check_vm_args_consistency() {
warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
}
status &= check_vm_args_consistency_ext();
return status;
}
......@@ -3419,7 +3418,7 @@ jint Arguments::finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_req
}
}
if (!check_vm_args_consistency()) {
if (!ArgumentsExt::check_vm_args_consistency()) {
return JNI_ERR;
}
......@@ -3793,7 +3792,7 @@ jint Arguments::apply_ergo() {
set_shared_spaces_flags();
// Check the GC selections again.
if (!check_gc_consistency()) {
if (!ArgumentsExt::check_gc_consistency_ergo()) {
return JNI_EINVAL;
}
......
......@@ -465,12 +465,12 @@ class Arguments : AllStatic {
static bool verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio);
// Check for consistency in the selection of the garbage collector.
static bool check_gc_consistency();
static bool check_gc_consistency_user(); // Check user-selected gc
static inline bool check_gc_consistency_ergo(); // Check ergonomic-selected gc
static void check_deprecated_gcs();
static void check_deprecated_gc_flags();
// Check consistecy or otherwise of VM argument settings
static bool check_vm_args_consistency();
static bool check_vm_args_consistency_ext();
// Check stack pages settings
static bool check_stack_pages();
// Used by os_solaris
......@@ -611,4 +611,9 @@ bool Arguments::gc_selected() {
return UseConcMarkSweepGC || UseG1GC || UseParallelGC || UseParallelOldGC ||
UseParNewGC || UseSerialGC;
}
bool Arguments::check_gc_consistency_ergo() {
return check_gc_consistency_user();
}
#endif // SHARE_VM_RUNTIME_ARGUMENTS_HPP
......@@ -22,9 +22,34 @@
*
*/
#include "precompiled.hpp"
#ifndef SHARE_VM_RUNTIME_ARGUMENTS_EXT_HPP
#define SHARE_VM_RUNTIME_ARGUMENTS_EXT_HPP
#include "memory/allocation.hpp"
#include "runtime/arguments.hpp"
bool Arguments::check_vm_args_consistency_ext() {
return true;
class ArgumentsExt: AllStatic {
public:
static inline void select_gc_ergonomically();
static inline bool check_gc_consistency_user();
static inline bool check_gc_consistency_ergo();
static inline bool check_vm_args_consistency();
};
void ArgumentsExt::select_gc_ergonomically() {
Arguments::select_gc_ergonomically();
}
bool ArgumentsExt::check_gc_consistency_user() {
return Arguments::check_gc_consistency_user();
}
bool ArgumentsExt::check_gc_consistency_ergo() {
return Arguments::check_gc_consistency_ergo();
}
bool ArgumentsExt::check_vm_args_consistency() {
return Arguments::check_vm_args_consistency();
}
#endif // SHARE_VM_RUNTIME_ARGUMENTS_EXT_HPP
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册