src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File c1-coops Sdiff src/share/vm/runtime

src/share/vm/runtime/arguments.cpp

Print this page




 988     BackgroundCompilation    = false;
 989     ClipInlining             = false;
 990     break;
 991   }
 992 }
 993 
 994 // Conflict: required to use shared spaces (-Xshare:on), but
 995 // incompatible command line options were chosen.
 996 
 997 static void no_shared_spaces() {
 998   if (RequireSharedSpaces) {
 999     jio_fprintf(defaultStream::error_stream(),
1000       "Class data sharing is inconsistent with other specified options.\n");
1001     vm_exit_during_initialization("Unable to use shared archive.", NULL);
1002   } else {
1003     FLAG_SET_DEFAULT(UseSharedSpaces, false);
1004   }
1005 }
1006 
1007 void Arguments::check_compressed_oops_compat() {
1008 #ifdef _LP64
1009   assert(UseCompressedOops, "Precondition");
1010 #  if defined(COMPILER1) && !defined(TIERED)
1011   // Until c1 supports compressed oops turn them off.
1012   FLAG_SET_DEFAULT(UseCompressedOops, false);
1013 #  else
1014   // Is it on by default or set on ergonomically
1015   bool is_on_by_default = FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops);
1016 
1017   // Tiered currently doesn't work with compressed oops
1018   if (TieredCompilation) {
1019     if (is_on_by_default) {
1020       FLAG_SET_DEFAULT(UseCompressedOops, false);
1021       return;
1022     } else {
1023       vm_exit_during_initialization(
1024         "Tiered compilation is not supported with compressed oops yet", NULL);
1025     }
1026   }
1027 
1028   // If dumping an archive or forcing its use, disable compressed oops if possible
1029   if (DumpSharedSpaces || RequireSharedSpaces) {
1030     if (is_on_by_default) {
1031       FLAG_SET_DEFAULT(UseCompressedOops, false);
1032       return;
1033     } else {
1034       vm_exit_during_initialization(
1035         "Class Data Sharing is not supported with compressed oops yet", NULL);
1036     }
1037   } else if (UseSharedSpaces) {
1038     // UseSharedSpaces is on by default. With compressed oops, we turn it off.
1039     FLAG_SET_DEFAULT(UseSharedSpaces, false);
1040   }
1041 
1042 #  endif // defined(COMPILER1) && !defined(TIERED)
1043 #endif // _LP64
1044 }
1045 
1046 void Arguments::set_tiered_flags() {
1047   if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) {
1048     FLAG_SET_DEFAULT(CompilationPolicyChoice, 2);
1049   }
1050   if (CompilationPolicyChoice < 2) {
1051     vm_exit_during_initialization(
1052       "Incompatible compilation policy selected", NULL);
1053   }
1054   // Increase the code cache size - tiered compiles a lot more.
1055   if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
1056     FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2);
1057   }
1058 }
1059 
1060 #ifndef KERNEL
1061 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC
1062 // if it's not explictly set or unset. If the user has chosen
1063 // UseParNewGC and not explicitly set ParallelGCThreads we


3058 #endif
3059 
3060   if (PrintGCDetails) {
3061     // Turn on -verbose:gc options as well
3062     PrintGC = true;
3063   }
3064 
3065   // Set object alignment values.
3066   set_object_alignment();
3067 
3068 #ifdef SERIALGC
3069   force_serial_gc();
3070 #endif // SERIALGC
3071 #ifdef KERNEL
3072   no_shared_spaces();
3073 #endif // KERNEL
3074 
3075   // Set flags based on ergonomics.
3076   set_ergonomics_flags();
3077 
3078 #ifdef _LP64
3079   if (UseCompressedOops) {
3080     check_compressed_oops_compat();
3081   }
3082 #endif
3083 
3084   // Check the GC selections again.
3085   if (!check_gc_consistency()) {
3086     return JNI_EINVAL;
3087   }
3088 
3089   if (TieredCompilation) {
3090     set_tiered_flags();
3091   } else {
3092     // Check if the policy is valid. Policies 0 and 1 are valid for non-tiered setup.
3093     if (CompilationPolicyChoice >= 2) {
3094       vm_exit_during_initialization(
3095         "Incompatible compilation policy selected", NULL);
3096     }
3097   }
3098 
3099 #ifndef KERNEL
3100   if (UseConcMarkSweepGC) {
3101     // Set flags for CMS and ParNew.  Check UseConcMarkSweep first
3102     // to ensure that when both UseConcMarkSweepGC and UseParNewGC




 988     BackgroundCompilation    = false;
 989     ClipInlining             = false;
 990     break;
 991   }
 992 }
 993 
 994 // Conflict: required to use shared spaces (-Xshare:on), but
 995 // incompatible command line options were chosen.
 996 
 997 static void no_shared_spaces() {
 998   if (RequireSharedSpaces) {
 999     jio_fprintf(defaultStream::error_stream(),
1000       "Class data sharing is inconsistent with other specified options.\n");
1001     vm_exit_during_initialization("Unable to use shared archive.", NULL);
1002   } else {
1003     FLAG_SET_DEFAULT(UseSharedSpaces, false);
1004   }
1005 }
1006 
1007 void Arguments::check_compressed_oops_compat() {

1008   assert(UseCompressedOops, "Precondition");




1009   // Is it on by default or set on ergonomically
1010   bool is_on_by_default = FLAG_IS_DEFAULT(UseCompressedOops) || FLAG_IS_ERGO(UseCompressedOops);
1011 











1012   // If dumping an archive or forcing its use, disable compressed oops if possible
1013   if (DumpSharedSpaces || RequireSharedSpaces) {
1014     if (is_on_by_default) {
1015       FLAG_SET_DEFAULT(UseCompressedOops, false);
1016       return;
1017     } else {
1018       vm_exit_during_initialization(
1019         "Class Data Sharing is not supported with compressed oops yet", NULL);
1020     }
1021   } else if (UseSharedSpaces) {
1022     // UseSharedSpaces is on by default. With compressed oops, we turn it off.
1023     FLAG_SET_DEFAULT(UseSharedSpaces, false);
1024   }



1025 }
1026 
1027 void Arguments::set_tiered_flags() {
1028   if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) {
1029     FLAG_SET_DEFAULT(CompilationPolicyChoice, 2);
1030   }
1031   if (CompilationPolicyChoice < 2) {
1032     vm_exit_during_initialization(
1033       "Incompatible compilation policy selected", NULL);
1034   }
1035   // Increase the code cache size - tiered compiles a lot more.
1036   if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
1037     FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2);
1038   }
1039 }
1040 
1041 #ifndef KERNEL
1042 // If the user has chosen ParallelGCThreads > 0, we set UseParNewGC
1043 // if it's not explictly set or unset. If the user has chosen
1044 // UseParNewGC and not explicitly set ParallelGCThreads we


3039 #endif
3040 
3041   if (PrintGCDetails) {
3042     // Turn on -verbose:gc options as well
3043     PrintGC = true;
3044   }
3045 
3046   // Set object alignment values.
3047   set_object_alignment();
3048 
3049 #ifdef SERIALGC
3050   force_serial_gc();
3051 #endif // SERIALGC
3052 #ifdef KERNEL
3053   no_shared_spaces();
3054 #endif // KERNEL
3055 
3056   // Set flags based on ergonomics.
3057   set_ergonomics_flags();
3058 

3059   if (UseCompressedOops) {
3060     check_compressed_oops_compat();
3061   }

3062 
3063   // Check the GC selections again.
3064   if (!check_gc_consistency()) {
3065     return JNI_EINVAL;
3066   }
3067 
3068   if (TieredCompilation) {
3069     set_tiered_flags();
3070   } else {
3071     // Check if the policy is valid. Policies 0 and 1 are valid for non-tiered setup.
3072     if (CompilationPolicyChoice >= 2) {
3073       vm_exit_during_initialization(
3074         "Incompatible compilation policy selected", NULL);
3075     }
3076   }
3077 
3078 #ifndef KERNEL
3079   if (UseConcMarkSweepGC) {
3080     // Set flags for CMS and ParNew.  Check UseConcMarkSweep first
3081     // to ensure that when both UseConcMarkSweepGC and UseParNewGC


src/share/vm/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File