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

src/share/vm/runtime/arguments.cpp

Print this page




1111 static void no_shared_spaces() {
1112   if (RequireSharedSpaces) {
1113     jio_fprintf(defaultStream::error_stream(),
1114       "Class data sharing is inconsistent with other specified options.\n");
1115     vm_exit_during_initialization("Unable to use shared archive.", NULL);
1116   } else {
1117     FLAG_SET_DEFAULT(UseSharedSpaces, false);
1118   }
1119 }
1120 #endif
1121 
1122 void Arguments::set_tiered_flags() {
1123   // With tiered, set default policy to AdvancedThresholdPolicy, which is 3.
1124   if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) {
1125     FLAG_SET_DEFAULT(CompilationPolicyChoice, 3);
1126   }
1127   if (CompilationPolicyChoice < 2) {
1128     vm_exit_during_initialization(
1129       "Incompatible compilation policy selected", NULL);
1130   }









1131   // Increase the code cache size - tiered compiles a lot more.
1132   if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
1133     FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 5);
1134   }
1135   if (!UseInterpreter) { // -Xcomp
1136     Tier3InvokeNotifyFreqLog = 0;
1137     Tier4InvocationThreshold = 0;
1138   }
1139 }
1140 
1141 #if INCLUDE_ALL_GCS
1142 static void disable_adaptive_size_policy(const char* collector_name) {
1143   if (UseAdaptiveSizePolicy) {
1144     if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) {
1145       warning("disabling UseAdaptiveSizePolicy; it is incompatible with %s.",
1146               collector_name);
1147     }
1148     FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false);
1149   }
1150 }


2325   } else if (ReservedCodeCacheSize < InitialCodeCacheSize) {
2326     jio_fprintf(defaultStream::error_stream(),
2327                 "Invalid ReservedCodeCacheSize: %dK. Must be at least InitialCodeCacheSize=%dK.\n",
2328                 ReservedCodeCacheSize/K, InitialCodeCacheSize/K);
2329     status = false;
2330   } else if (ReservedCodeCacheSize < min_code_cache_size) {
2331     jio_fprintf(defaultStream::error_stream(),
2332                 "Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K,
2333                 min_code_cache_size/K);
2334     status = false;
2335   } else if (ReservedCodeCacheSize > 2*G) {
2336     // Code cache size larger than MAXINT is not supported.
2337     jio_fprintf(defaultStream::error_stream(),
2338                 "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
2339                 (2*G)/M);
2340     status = false;
2341   }
2342 
2343   status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction");
2344   status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity");


2345 
2346   return status;
2347 }
2348 
2349 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2350   const char* option_type) {
2351   if (ignore) return false;
2352 
2353   const char* spacer = " ";
2354   if (option_type == NULL) {
2355     option_type = ++spacer; // Set both to the empty string.
2356   }
2357 
2358   if (os::obsolete_option(option)) {
2359     jio_fprintf(defaultStream::error_stream(),
2360                 "Obsolete %s%soption: %s\n", option_type, spacer,
2361       option->optionString);
2362     return false;
2363   } else {
2364     jio_fprintf(defaultStream::error_stream(),




1111 static void no_shared_spaces() {
1112   if (RequireSharedSpaces) {
1113     jio_fprintf(defaultStream::error_stream(),
1114       "Class data sharing is inconsistent with other specified options.\n");
1115     vm_exit_during_initialization("Unable to use shared archive.", NULL);
1116   } else {
1117     FLAG_SET_DEFAULT(UseSharedSpaces, false);
1118   }
1119 }
1120 #endif
1121 
1122 void Arguments::set_tiered_flags() {
1123   // With tiered, set default policy to AdvancedThresholdPolicy, which is 3.
1124   if (FLAG_IS_DEFAULT(CompilationPolicyChoice)) {
1125     FLAG_SET_DEFAULT(CompilationPolicyChoice, 3);
1126   }
1127   if (CompilationPolicyChoice < 2) {
1128     vm_exit_during_initialization(
1129       "Incompatible compilation policy selected", NULL);
1130   }
1131   if (FLAG_IS_DEFAULT(CodeCacheSegmentSize) && FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
1132     // There is enough code cache available. Increasing CodeCacheSegmentSize results
1133     // in less memory fragmentation (and therefore a shorter freelist in the code heap.)
1134     // Testing shows a reduction of the freelist length by several factors compared to
1135     // using the default CodeCacheSegmentSize. A larger CodeCacheSegmentSize increases
1136     // the memory consumption (due to possibly unused memory at the end of an nmethod)
1137     // by a couple of percent only.
1138     FLAG_SET_DEFAULT(CodeCacheSegmentSize, CodeCacheSegmentSize * 2);
1139   }
1140   // Increase the code cache size - tiered compiles a lot more.
1141   if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
1142     FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 5);
1143   }
1144   if (!UseInterpreter) { // -Xcomp
1145     Tier3InvokeNotifyFreqLog = 0;
1146     Tier4InvocationThreshold = 0;
1147   }
1148 }
1149 
1150 #if INCLUDE_ALL_GCS
1151 static void disable_adaptive_size_policy(const char* collector_name) {
1152   if (UseAdaptiveSizePolicy) {
1153     if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) {
1154       warning("disabling UseAdaptiveSizePolicy; it is incompatible with %s.",
1155               collector_name);
1156     }
1157     FLAG_SET_DEFAULT(UseAdaptiveSizePolicy, false);
1158   }
1159 }


2334   } else if (ReservedCodeCacheSize < InitialCodeCacheSize) {
2335     jio_fprintf(defaultStream::error_stream(),
2336                 "Invalid ReservedCodeCacheSize: %dK. Must be at least InitialCodeCacheSize=%dK.\n",
2337                 ReservedCodeCacheSize/K, InitialCodeCacheSize/K);
2338     status = false;
2339   } else if (ReservedCodeCacheSize < min_code_cache_size) {
2340     jio_fprintf(defaultStream::error_stream(),
2341                 "Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K,
2342                 min_code_cache_size/K);
2343     status = false;
2344   } else if (ReservedCodeCacheSize > 2*G) {
2345     // Code cache size larger than MAXINT is not supported.
2346     jio_fprintf(defaultStream::error_stream(),
2347                 "Invalid ReservedCodeCacheSize=%dM. Must be at most %uM.\n", ReservedCodeCacheSize/M,
2348                 (2*G)/M);
2349     status = false;
2350   }
2351 
2352   status &= verify_interval(NmethodSweepFraction, 1, ReservedCodeCacheSize/K, "NmethodSweepFraction");
2353   status &= verify_interval(NmethodSweepActivity, 0, 2000, "NmethodSweepActivity");
2354   status &= verify_interval(CodeCacheMinBlockLength, 1, 100, "CodeCacheMinBlockLength");
2355   status &= verify_interval(CodeCacheSegmentSize, 1, 1024, "CodeCacheSegmentSize");
2356 
2357   return status;
2358 }
2359 
2360 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2361   const char* option_type) {
2362   if (ignore) return false;
2363 
2364   const char* spacer = " ";
2365   if (option_type == NULL) {
2366     option_type = ++spacer; // Set both to the empty string.
2367   }
2368 
2369   if (os::obsolete_option(option)) {
2370     jio_fprintf(defaultStream::error_stream(),
2371                 "Obsolete %s%soption: %s\n", option_type, spacer,
2372       option->optionString);
2373     return false;
2374   } else {
2375     jio_fprintf(defaultStream::error_stream(),


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