comparison src/share/vm/runtime/arguments.cpp @ 1891:9de67bf4244d

6996136: VM crash in src/share/vm/runtime/virtualspace.cpp:424 Summary: Turn CDS off if compressed oops is on Reviewed-by: ysr, kvn, jcoomes, phh
author iveresov
date Tue, 02 Nov 2010 16:02:46 -0700
parents f5c8d6e5bfee
children 2db84614f61d
comparison
equal deleted inserted replaced
1890:f5c8d6e5bfee 1891:9de67bf4244d
955 } else { 955 } else {
956 FLAG_SET_DEFAULT(UseSharedSpaces, false); 956 FLAG_SET_DEFAULT(UseSharedSpaces, false);
957 } 957 }
958 } 958 }
959 959
960 void Arguments::check_compressed_oops_compat() {
961 #ifdef _LP64
962 assert(UseCompressedOops, "Precondition");
963 # if defined(COMPILER1) && !defined(TIERED)
964 // Until c1 supports compressed oops turn them off.
965 FLAG_SET_DEFAULT(UseCompressedOops, false);
966 # else
967 // Is it on by default or set on ergonomically
968 bool is_on_by_default = FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops);
969
970 // Tiered currently doesn't work with compressed oops
971 if (TieredCompilation) {
972 if (is_on_by_default) {
973 FLAG_SET_DEFAULT(UseCompressedOops, false);
974 return;
975 } else {
976 vm_exit_during_initialization(
977 "Tiered compilation is not supported with compressed oops yet", NULL);
978 }
979 }
980
981 // XXX JSR 292 currently does not support compressed oops
982 if (EnableMethodHandles) {
983 if (is_on_by_default) {
984 FLAG_SET_DEFAULT(UseCompressedOops, false);
985 return;
986 } else {
987 vm_exit_during_initialization(
988 "JSR292 is not supported with compressed oops yet", NULL);
989 }
990 }
991
992 // If dumping an archive or forcing its use, disable compressed oops if possible
993 if (DumpSharedSpaces || RequireSharedSpaces) {
994 if (is_on_by_default) {
995 FLAG_SET_DEFAULT(UseCompressedOops, false);
996 return;
997 } else {
998 vm_exit_during_initialization(
999 "Class Data Sharing is not supported with compressed oops yet", NULL);
1000 }
1001 } else if (UseSharedSpaces) {
1002 // UseSharedSpaces is on by default. With compressed oops, we turn it off.
1003 FLAG_SET_DEFAULT(UseSharedSpaces, false);
1004 }
1005
1006 # endif // defined(COMPILER1) && !defined(TIERED)
1007 #endif // _LP64
1008 }
1009
960 void Arguments::set_tiered_flags() { 1010 void Arguments::set_tiered_flags() {
961 if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) { 1011 if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) {
962 FLAG_SET_DEFAULT(CompilationPolicyChoice, 2); 1012 FLAG_SET_DEFAULT(CompilationPolicyChoice, 2);
963 } 1013 }
964
965 if (CompilationPolicyChoice < 2) { 1014 if (CompilationPolicyChoice < 2) {
966 vm_exit_during_initialization( 1015 vm_exit_during_initialization(
967 "Incompatible compilation policy selected", NULL); 1016 "Incompatible compilation policy selected", NULL);
968 } 1017 }
969 1018 // Increase the code cache size - tiered compiles a lot more.
970 #ifdef _LP64
971 if (FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops)) {
972 UseCompressedOops = false;
973 }
974 if (UseCompressedOops) {
975 vm_exit_during_initialization(
976 "Tiered compilation is not supported with compressed oops yet", NULL);
977 }
978 #endif
979 // Increase the code cache size - tiered compiles a lot more.
980 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { 1019 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
981 FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2); 1020 FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2);
982 } 1021 }
983 } 1022 }
984 1023
2833 return(parse_each_vm_init_arg(&vm_args, scp_p, scp_assembly_required_p, ENVIRON_VAR)); 2872 return(parse_each_vm_init_arg(&vm_args, scp_p, scp_assembly_required_p, ENVIRON_VAR));
2834 } 2873 }
2835 return JNI_OK; 2874 return JNI_OK;
2836 } 2875 }
2837 2876
2877
2838 // Parse entry point called from JNI_CreateJavaVM 2878 // Parse entry point called from JNI_CreateJavaVM
2839 2879
2840 jint Arguments::parse(const JavaVMInitArgs* args) { 2880 jint Arguments::parse(const JavaVMInitArgs* args) {
2841 2881
2842 // Sharing support 2882 // Sharing support
2975 if (PrintGCDetails) { 3015 if (PrintGCDetails) {
2976 // Turn on -verbose:gc options as well 3016 // Turn on -verbose:gc options as well
2977 PrintGC = true; 3017 PrintGC = true;
2978 } 3018 }
2979 3019
2980 #if defined(_LP64) && defined(COMPILER1) && !defined(TIERED)
2981 UseCompressedOops = false;
2982 #endif
2983
2984 #if defined(_LP64)
2985 if ((DumpSharedSpaces || RequireSharedSpaces) && UseCompressedOops) {
2986 // Disable compressed oops with shared spaces
2987 UseCompressedOops = false;
2988 }
2989 #endif
2990
2991 // Set object alignment values. 3020 // Set object alignment values.
2992 set_object_alignment(); 3021 set_object_alignment();
2993 3022
2994 #ifdef SERIALGC 3023 #ifdef SERIALGC
2995 force_serial_gc(); 3024 force_serial_gc();
3000 3029
3001 // Set flags based on ergonomics. 3030 // Set flags based on ergonomics.
3002 set_ergonomics_flags(); 3031 set_ergonomics_flags();
3003 3032
3004 #ifdef _LP64 3033 #ifdef _LP64
3005 // XXX JSR 292 currently does not support compressed oops. 3034 if (UseCompressedOops) {
3006 if (EnableMethodHandles && UseCompressedOops) { 3035 check_compressed_oops_compat();
3007 if (FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops)) { 3036 }
3008 UseCompressedOops = false; 3037 #endif
3009 }
3010 }
3011 #endif // _LP64
3012 3038
3013 // Check the GC selections again. 3039 // Check the GC selections again.
3014 if (!check_gc_consistency()) { 3040 if (!check_gc_consistency()) {
3015 return JNI_EINVAL; 3041 return JNI_EINVAL;
3016 } 3042 }