comparison src/share/vm/runtime/arguments.cpp @ 20408:76af788b6c16

8057623: add an extension class for argument handling Reviewed-by: brutisso, mgerdin, tschatzl
author jcoomes
date Fri, 05 Sep 2014 12:36:37 -0700
parents 8ec8971f511a
children 8ba0078861d4 8cb56c8cb30d
comparison
equal deleted inserted replaced
20407:9be4ca335650 20408:76af788b6c16
33 #include "memory/referenceProcessor.hpp" 33 #include "memory/referenceProcessor.hpp"
34 #include "memory/universe.inline.hpp" 34 #include "memory/universe.inline.hpp"
35 #include "oops/oop.inline.hpp" 35 #include "oops/oop.inline.hpp"
36 #include "prims/jvmtiExport.hpp" 36 #include "prims/jvmtiExport.hpp"
37 #include "runtime/arguments.hpp" 37 #include "runtime/arguments.hpp"
38 #include "runtime/arguments_ext.hpp"
38 #include "runtime/globals_extension.hpp" 39 #include "runtime/globals_extension.hpp"
39 #include "runtime/java.hpp" 40 #include "runtime/java.hpp"
40 #include "services/management.hpp" 41 #include "services/management.hpp"
41 #include "services/memTracker.hpp" 42 #include "services/memTracker.hpp"
42 #include "utilities/defaultStream.hpp" 43 #include "utilities/defaultStream.hpp"
1542 } 1543 }
1543 } 1544 }
1544 1545
1545 void Arguments::select_gc() { 1546 void Arguments::select_gc() {
1546 if (!gc_selected()) { 1547 if (!gc_selected()) {
1547 select_gc_ergonomically(); 1548 ArgumentsExt::select_gc_ergonomically();
1548 } 1549 }
1549 } 1550 }
1550 1551
1551 void Arguments::set_ergonomics_flags() { 1552 void Arguments::set_ergonomics_flags() {
1552 select_gc(); 1553 select_gc();
2031 _max_heap_free_ratio = max_heap_free_ratio; 2032 _max_heap_free_ratio = max_heap_free_ratio;
2032 return true; 2033 return true;
2033 } 2034 }
2034 2035
2035 // Check consistency of GC selection 2036 // Check consistency of GC selection
2036 bool Arguments::check_gc_consistency() { 2037 bool Arguments::check_gc_consistency_user() {
2037 check_gclog_consistency(); 2038 check_gclog_consistency();
2038 bool status = true; 2039 bool status = true;
2039 // Ensure that the user has not selected conflicting sets 2040 // Ensure that the user has not selected conflicting sets
2040 // of collectors. [Note: this check is merely a user convenience; 2041 // of collectors. [Note: this check is merely a user convenience;
2041 // collectors over-ride each other so that only a non-conflicting 2042 // collectors over-ride each other so that only a non-conflicting
2197 if (GCTimeLimit == 100) { 2198 if (GCTimeLimit == 100) {
2198 // Turn off gc-overhead-limit-exceeded checks 2199 // Turn off gc-overhead-limit-exceeded checks
2199 FLAG_SET_DEFAULT(UseGCOverheadLimit, false); 2200 FLAG_SET_DEFAULT(UseGCOverheadLimit, false);
2200 } 2201 }
2201 2202
2202 status = status && check_gc_consistency(); 2203 status = status && ArgumentsExt::check_gc_consistency_user();
2203 status = status && check_stack_pages(); 2204 status = status && check_stack_pages();
2204 2205
2205 if (CMSIncrementalMode) { 2206 if (CMSIncrementalMode) {
2206 if (!UseConcMarkSweepGC) { 2207 if (!UseConcMarkSweepGC) {
2207 jio_fprintf(defaultStream::error_stream(), 2208 jio_fprintf(defaultStream::error_stream(),
2444 status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity"); 2445 status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity");
2445 2446
2446 if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) { 2447 if (!FLAG_IS_DEFAULT(CICompilerCount) && !FLAG_IS_DEFAULT(CICompilerCountPerCPU) && CICompilerCountPerCPU) {
2447 warning("The VM option CICompilerCountPerCPU overrides CICompilerCount."); 2448 warning("The VM option CICompilerCountPerCPU overrides CICompilerCount.");
2448 } 2449 }
2449
2450 status &= check_vm_args_consistency_ext();
2451 2450
2452 return status; 2451 return status;
2453 } 2452 }
2454 2453
2455 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore, 2454 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
3417 } 3416 }
3418 } 3417 }
3419 } 3418 }
3420 } 3419 }
3421 3420
3422 if (!check_vm_args_consistency()) { 3421 if (!ArgumentsExt::check_vm_args_consistency()) {
3423 return JNI_ERR; 3422 return JNI_ERR;
3424 } 3423 }
3425 3424
3426 return JNI_OK; 3425 return JNI_OK;
3427 } 3426 }
3791 set_ergonomics_flags(); 3790 set_ergonomics_flags();
3792 3791
3793 set_shared_spaces_flags(); 3792 set_shared_spaces_flags();
3794 3793
3795 // Check the GC selections again. 3794 // Check the GC selections again.
3796 if (!check_gc_consistency()) { 3795 if (!ArgumentsExt::check_gc_consistency_ergo()) {
3797 return JNI_EINVAL; 3796 return JNI_EINVAL;
3798 } 3797 }
3799 3798
3800 if (TieredCompilation) { 3799 if (TieredCompilation) {
3801 set_tiered_flags(); 3800 set_tiered_flags();