29 #include "classfile/symbolTable.hpp"
30 #include "compiler/compilerOracle.hpp"
31 #include "gc/shared/cardTableRS.hpp"
32 #include "gc/shared/genCollectedHeap.hpp"
33 #include "gc/shared/referenceProcessor.hpp"
34 #include "gc/shared/taskqueue.hpp"
35 #include "memory/allocation.inline.hpp"
36 #include "memory/universe.inline.hpp"
37 #include "oops/oop.inline.hpp"
38 #include "prims/jvmtiExport.hpp"
39 #include "runtime/arguments.hpp"
40 #include "runtime/arguments_ext.hpp"
41 #include "runtime/globals_extension.hpp"
42 #include "runtime/java.hpp"
43 #include "runtime/os.hpp"
44 #include "runtime/vm_version.hpp"
45 #include "services/management.hpp"
46 #include "services/memTracker.hpp"
47 #include "utilities/defaultStream.hpp"
48 #include "utilities/macros.hpp"
49 #include "utilities/stringUtils.hpp"
50 #if INCLUDE_ALL_GCS
51 #include "gc/cms/compactibleFreeListSpace.hpp"
52 #include "gc/g1/g1CollectedHeap.inline.hpp"
53 #include "gc/parallel/parallelScavengeHeap.hpp"
54 #endif // INCLUDE_ALL_GCS
55
56 // Note: This is a special bug reporting site for the JVM
57 #define DEFAULT_VENDOR_URL_BUG "http://bugreport.java.com/bugreport/crash.jsp"
58 #define DEFAULT_JAVA_LAUNCHER "generic"
59
60 #define UNSUPPORTED_GC_OPTION(gc) \
61 do { \
62 if (gc) { \
63 if (FLAG_IS_CMDLINE(gc)) { \
64 warning(#gc " is not supported in this VM. Using Serial GC."); \
65 } \
66 FLAG_SET_DEFAULT(gc, false); \
67 } \
68 } while(0)
3846
3847 // Set object alignment values.
3848 set_object_alignment();
3849
3850 #if !INCLUDE_ALL_GCS
3851 force_serial_gc();
3852 #endif // INCLUDE_ALL_GCS
3853 #if !INCLUDE_CDS
3854 if (DumpSharedSpaces || RequireSharedSpaces) {
3855 jio_fprintf(defaultStream::error_stream(),
3856 "Shared spaces are not supported in this VM\n");
3857 return JNI_ERR;
3858 }
3859 if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) || PrintSharedSpaces) {
3860 warning("Shared spaces are not supported in this VM");
3861 FLAG_SET_DEFAULT(UseSharedSpaces, false);
3862 FLAG_SET_DEFAULT(PrintSharedSpaces, false);
3863 }
3864 no_shared_spaces("CDS Disabled");
3865 #endif // INCLUDE_CDS
3866
3867 return JNI_OK;
3868 }
3869
3870 jint Arguments::apply_ergo() {
3871
3872 // Set flags based on ergonomics.
3873 set_ergonomics_flags();
3874
3875 set_shared_spaces_flags();
3876
3877 // Check the GC selections again.
3878 if (!check_gc_consistency()) {
3879 return JNI_EINVAL;
3880 }
3881
3882 if (TieredCompilation) {
3883 set_tiered_flags();
3884 } else {
3885 // Check if the policy is valid. Policies 0 and 1 are valid for non-tiered setup.
|
29 #include "classfile/symbolTable.hpp"
30 #include "compiler/compilerOracle.hpp"
31 #include "gc/shared/cardTableRS.hpp"
32 #include "gc/shared/genCollectedHeap.hpp"
33 #include "gc/shared/referenceProcessor.hpp"
34 #include "gc/shared/taskqueue.hpp"
35 #include "memory/allocation.inline.hpp"
36 #include "memory/universe.inline.hpp"
37 #include "oops/oop.inline.hpp"
38 #include "prims/jvmtiExport.hpp"
39 #include "runtime/arguments.hpp"
40 #include "runtime/arguments_ext.hpp"
41 #include "runtime/globals_extension.hpp"
42 #include "runtime/java.hpp"
43 #include "runtime/os.hpp"
44 #include "runtime/vm_version.hpp"
45 #include "services/management.hpp"
46 #include "services/memTracker.hpp"
47 #include "utilities/defaultStream.hpp"
48 #include "utilities/macros.hpp"
49 #include "utilities/semaphore.hpp"
50 #include "utilities/stringUtils.hpp"
51 #if INCLUDE_ALL_GCS
52 #include "gc/cms/compactibleFreeListSpace.hpp"
53 #include "gc/g1/g1CollectedHeap.inline.hpp"
54 #include "gc/parallel/parallelScavengeHeap.hpp"
55 #endif // INCLUDE_ALL_GCS
56
57 // Note: This is a special bug reporting site for the JVM
58 #define DEFAULT_VENDOR_URL_BUG "http://bugreport.java.com/bugreport/crash.jsp"
59 #define DEFAULT_JAVA_LAUNCHER "generic"
60
61 #define UNSUPPORTED_GC_OPTION(gc) \
62 do { \
63 if (gc) { \
64 if (FLAG_IS_CMDLINE(gc)) { \
65 warning(#gc " is not supported in this VM. Using Serial GC."); \
66 } \
67 FLAG_SET_DEFAULT(gc, false); \
68 } \
69 } while(0)
3847
3848 // Set object alignment values.
3849 set_object_alignment();
3850
3851 #if !INCLUDE_ALL_GCS
3852 force_serial_gc();
3853 #endif // INCLUDE_ALL_GCS
3854 #if !INCLUDE_CDS
3855 if (DumpSharedSpaces || RequireSharedSpaces) {
3856 jio_fprintf(defaultStream::error_stream(),
3857 "Shared spaces are not supported in this VM\n");
3858 return JNI_ERR;
3859 }
3860 if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) || PrintSharedSpaces) {
3861 warning("Shared spaces are not supported in this VM");
3862 FLAG_SET_DEFAULT(UseSharedSpaces, false);
3863 FLAG_SET_DEFAULT(PrintSharedSpaces, false);
3864 }
3865 no_shared_spaces("CDS Disabled");
3866 #endif // INCLUDE_CDS
3867
3868 // The Semaphore class isn't implemented on all platforms.
3869 #if !IMPLEMENTS_SEMAPHORE_CLASS
3870 if (UseSemaphoreGCThreadsSynchronization && FLAG_IS_CMDLINE(UseSemaphoreGCThreadsSynchronization)) {
3871 warning("Semaphore GC Thread Synchronization is not implemented for this platform");
3872 FLAG_SET_DEFAULT(UseSemaphoreGCThreadsSynchronization, false);
3873 }
3874 #endif
3875
3876 return JNI_OK;
3877 }
3878
3879 jint Arguments::apply_ergo() {
3880
3881 // Set flags based on ergonomics.
3882 set_ergonomics_flags();
3883
3884 set_shared_spaces_flags();
3885
3886 // Check the GC selections again.
3887 if (!check_gc_consistency()) {
3888 return JNI_EINVAL;
3889 }
3890
3891 if (TieredCompilation) {
3892 set_tiered_flags();
3893 } else {
3894 // Check if the policy is valid. Policies 0 and 1 are valid for non-tiered setup.
|