Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 6854:fb19af007ffc
7189254: Change makefiles for more flexibility to override defaults
Summary: Change makefiles so that targets and parameters can be overridden by alternate makefiles.
Reviewed-by: dholmes, coleenp
author | jprovino |
---|---|
date | Wed, 10 Oct 2012 14:35:58 -0400 |
parents | 22b8d3d181d9 |
children | 5876f980ea19 |
comparison
equal
deleted
inserted
replaced
6830:81e878c53615 | 6854:fb19af007ffc |
---|---|
1064 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { | 1064 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { |
1065 FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2); | 1065 FLAG_SET_DEFAULT(ReservedCodeCacheSize, ReservedCodeCacheSize * 2); |
1066 } | 1066 } |
1067 } | 1067 } |
1068 | 1068 |
1069 #ifndef KERNEL | 1069 #if INCLUDE_ALTERNATE_GCS |
1070 static void disable_adaptive_size_policy(const char* collector_name) { | 1070 static void disable_adaptive_size_policy(const char* collector_name) { |
1071 if (UseAdaptiveSizePolicy) { | 1071 if (UseAdaptiveSizePolicy) { |
1072 if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) { | 1072 if (FLAG_IS_CMDLINE(UseAdaptiveSizePolicy)) { |
1073 warning("disabling UseAdaptiveSizePolicy; it is incompatible with %s.", | 1073 warning("disabling UseAdaptiveSizePolicy; it is incompatible with %s.", |
1074 collector_name); | 1074 collector_name); |
1139 // unless explicitly forbidden. | 1139 // unless explicitly forbidden. |
1140 if (FLAG_IS_DEFAULT(UseParNewGC)) { | 1140 if (FLAG_IS_DEFAULT(UseParNewGC)) { |
1141 FLAG_SET_ERGO(bool, UseParNewGC, true); | 1141 FLAG_SET_ERGO(bool, UseParNewGC, true); |
1142 } | 1142 } |
1143 | 1143 |
1144 // Turn off AdaptiveSizePolicy for CMS until it is complete. | 1144 // Turn off AdaptiveSizePolicy by default for cms until it is complete. |
1145 disable_adaptive_size_policy("UseConcMarkSweepGC"); | 1145 disable_adaptive_size_policy("UseConcMarkSweepGC"); |
1146 | 1146 |
1147 // In either case, adjust ParallelGCThreads and/or UseParNewGC | 1147 // In either case, adjust ParallelGCThreads and/or UseParNewGC |
1148 // as needed. | 1148 // as needed. |
1149 if (UseParNewGC) { | 1149 if (UseParNewGC) { |
1281 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", | 1281 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", |
1282 MarkStackSize / K, MarkStackSizeMax / K); | 1282 MarkStackSize / K, MarkStackSizeMax / K); |
1283 tty->print_cr("ConcGCThreads: %u", ConcGCThreads); | 1283 tty->print_cr("ConcGCThreads: %u", ConcGCThreads); |
1284 } | 1284 } |
1285 } | 1285 } |
1286 #endif // KERNEL | 1286 #endif // INCLUDE_ALTERNATE_GCS |
1287 | 1287 |
1288 void set_object_alignment() { | 1288 void set_object_alignment() { |
1289 // Object alignment. | 1289 // Object alignment. |
1290 assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2"); | 1290 assert(is_power_of_2(ObjectAlignmentInBytes), "ObjectAlignmentInBytes must be power of 2"); |
1291 MinObjAlignmentInBytes = ObjectAlignmentInBytes; | 1291 MinObjAlignmentInBytes = ObjectAlignmentInBytes; |
1298 LogMinObjAlignment = LogMinObjAlignmentInBytes - LogHeapWordSize; | 1298 LogMinObjAlignment = LogMinObjAlignmentInBytes - LogHeapWordSize; |
1299 | 1299 |
1300 // Oop encoding heap max | 1300 // Oop encoding heap max |
1301 OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes; | 1301 OopEncodingHeapMax = (uint64_t(max_juint) + 1) << LogMinObjAlignmentInBytes; |
1302 | 1302 |
1303 #ifndef KERNEL | 1303 #if INCLUDE_ALTERNATE_GCS |
1304 // Set CMS global values | 1304 // Set CMS global values |
1305 CompactibleFreeListSpace::set_cms_values(); | 1305 CompactibleFreeListSpace::set_cms_values(); |
1306 #endif // KERNEL | 1306 #endif // INCLUDE_ALTERNATE_GCS |
1307 } | 1307 } |
1308 | 1308 |
1309 bool verify_object_alignment() { | 1309 bool verify_object_alignment() { |
1310 // Object alignment. | 1310 // Object alignment. |
1311 if (!is_power_of_2(ObjectAlignmentInBytes)) { | 1311 if (!is_power_of_2(ObjectAlignmentInBytes)) { |
1989 " on sun4v; please understand that you are using at your own risk!"); | 1989 " on sun4v; please understand that you are using at your own risk!"); |
1990 } | 1990 } |
1991 } | 1991 } |
1992 #endif // SPARC | 1992 #endif // SPARC |
1993 | 1993 |
1994 if (PrintNMTStatistics && MemTracker::tracking_level() == MemTracker::NMT_off) { | 1994 if (PrintNMTStatistics) { |
1995 warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled"); | 1995 #if INCLUDE_NMT |
1996 PrintNMTStatistics = false; | 1996 if (MemTracker::tracking_level() == MemTracker::NMT_off) { |
1997 #endif // INCLUDE_NMT | |
1998 warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled"); | |
1999 PrintNMTStatistics = false; | |
2000 #if INCLUDE_NMT | |
2001 } | |
2002 #endif | |
1997 } | 2003 } |
1998 | 2004 |
1999 return status; | 2005 return status; |
2000 } | 2006 } |
2001 | 2007 |
2218 char *options = NULL; | 2224 char *options = NULL; |
2219 if(pos != NULL) { | 2225 if(pos != NULL) { |
2220 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. | 2226 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. |
2221 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); | 2227 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); |
2222 } | 2228 } |
2223 #ifdef JVMTI_KERNEL | 2229 #if !INCLUDE_JVMTI |
2224 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { | 2230 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { |
2225 warning("profiling and debugging agents are not supported with Kernel VM"); | 2231 warning("profiling and debugging agents are not supported in this VM"); |
2226 } else | 2232 } else |
2227 #endif // JVMTI_KERNEL | 2233 #endif // !INCLUDE_JVMTI |
2228 add_init_library(name, options); | 2234 add_init_library(name, options); |
2229 } | 2235 } |
2230 // -agentlib and -agentpath | 2236 // -agentlib and -agentpath |
2231 } else if (match_option(option, "-agentlib:", &tail) || | 2237 } else if (match_option(option, "-agentlib:", &tail) || |
2232 (is_absolute_path = match_option(option, "-agentpath:", &tail))) { | 2238 (is_absolute_path = match_option(option, "-agentpath:", &tail))) { |
2233 if(tail != NULL) { | 2239 if(tail != NULL) { |
2238 | 2244 |
2239 char *options = NULL; | 2245 char *options = NULL; |
2240 if(pos != NULL) { | 2246 if(pos != NULL) { |
2241 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); | 2247 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); |
2242 } | 2248 } |
2243 #ifdef JVMTI_KERNEL | 2249 #if !INCLUDE_JVMTI |
2244 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { | 2250 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { |
2245 warning("profiling and debugging agents are not supported with Kernel VM"); | 2251 warning("profiling and debugging agents are not supported in this VM"); |
2246 } else | 2252 } else |
2247 #endif // JVMTI_KERNEL | 2253 #endif // !INCLUDE_JVMTI |
2248 add_init_agent(name, options, is_absolute_path); | 2254 add_init_agent(name, options, is_absolute_path); |
2249 | 2255 |
2250 } | 2256 } |
2251 // -javaagent | 2257 // -javaagent |
2252 } else if (match_option(option, "-javaagent:", &tail)) { | 2258 } else if (match_option(option, "-javaagent:", &tail)) { |
2259 #if !INCLUDE_JVMTI | |
2260 warning("Instrumentation agents are not supported in this VM"); | |
2261 #else | |
2253 if(tail != NULL) { | 2262 if(tail != NULL) { |
2254 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); | 2263 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); |
2255 add_init_agent("instrument", options, false); | 2264 add_init_agent("instrument", options, false); |
2256 } | 2265 } |
2266 #endif // !INCLUDE_JVMTI | |
2257 // -Xnoclassgc | 2267 // -Xnoclassgc |
2258 } else if (match_option(option, "-Xnoclassgc", &tail)) { | 2268 } else if (match_option(option, "-Xnoclassgc", &tail)) { |
2259 FLAG_SET_CMDLINE(bool, ClassUnloading, false); | 2269 FLAG_SET_CMDLINE(bool, ClassUnloading, false); |
2260 // -Xincgc: i-CMS | 2270 // -Xincgc: i-CMS |
2261 } else if (match_option(option, "-Xincgc", &tail)) { | 2271 } else if (match_option(option, "-Xincgc", &tail)) { |
2383 // -Xoptimize | 2393 // -Xoptimize |
2384 } else if (match_option(option, "-Xoptimize", &tail)) { | 2394 } else if (match_option(option, "-Xoptimize", &tail)) { |
2385 // EVM option, ignore silently for compatibility | 2395 // EVM option, ignore silently for compatibility |
2386 // -Xprof | 2396 // -Xprof |
2387 } else if (match_option(option, "-Xprof", &tail)) { | 2397 } else if (match_option(option, "-Xprof", &tail)) { |
2388 #ifndef FPROF_KERNEL | 2398 #if INCLUDE_FPROF |
2389 _has_profile = true; | 2399 _has_profile = true; |
2390 #else // FPROF_KERNEL | 2400 #else // INCLUDE_FPROF |
2391 // do we have to exit? | 2401 // do we have to exit? |
2392 warning("Kernel VM does not support flat profiling."); | 2402 warning("Flat profiling is not supported in this VM."); |
2393 #endif // FPROF_KERNEL | 2403 #endif // INCLUDE_FPROF |
2394 // -Xaprof | 2404 // -Xaprof |
2395 } else if (match_option(option, "-Xaprof", &tail)) { | 2405 } else if (match_option(option, "-Xaprof", &tail)) { |
2396 _has_alloc_profile = true; | 2406 _has_alloc_profile = true; |
2397 // -Xconcurrentio | 2407 // -Xconcurrentio |
2398 } else if (match_option(option, "-Xconcurrentio", &tail)) { | 2408 } else if (match_option(option, "-Xconcurrentio", &tail)) { |
2436 // -Xshare:dump | 2446 // -Xshare:dump |
2437 } else if (match_option(option, "-Xshare:dump", &tail)) { | 2447 } else if (match_option(option, "-Xshare:dump", &tail)) { |
2438 #if defined(KERNEL) | 2448 #if defined(KERNEL) |
2439 vm_exit_during_initialization( | 2449 vm_exit_during_initialization( |
2440 "Dumping a shared archive is not supported on the Kernel JVM.", NULL); | 2450 "Dumping a shared archive is not supported on the Kernel JVM.", NULL); |
2451 #elif !INCLUDE_CDS | |
2452 vm_exit_during_initialization( | |
2453 "Dumping a shared archive is not supported in this VM.", NULL); | |
2441 #else | 2454 #else |
2442 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); | 2455 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); |
2443 set_mode_flags(_int); // Prevent compilation, which creates objects | 2456 set_mode_flags(_int); // Prevent compilation, which creates objects |
2444 #endif | 2457 #endif |
2445 // -Xshare:on | 2458 // -Xshare:on |
2488 FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true); | 2501 FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true); |
2489 | 2502 |
2490 // JNI hooks | 2503 // JNI hooks |
2491 } else if (match_option(option, "-Xcheck", &tail)) { | 2504 } else if (match_option(option, "-Xcheck", &tail)) { |
2492 if (!strcmp(tail, ":jni")) { | 2505 if (!strcmp(tail, ":jni")) { |
2506 #if !INCLUDE_JNI_CHECK | |
2507 warning("JNI CHECKING is not supported in this VM"); | |
2508 #else | |
2493 CheckJNICalls = true; | 2509 CheckJNICalls = true; |
2510 #endif // INCLUDE_JNI_CHECK | |
2494 } else if (is_bad_option(option, args->ignoreUnrecognized, | 2511 } else if (is_bad_option(option, args->ignoreUnrecognized, |
2495 "check")) { | 2512 "check")) { |
2496 return JNI_EINVAL; | 2513 return JNI_EINVAL; |
2497 } | 2514 } |
2498 } else if (match_option(option, "vfprintf", &tail)) { | 2515 } else if (match_option(option, "vfprintf", &tail)) { |
3043 if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) { | 3060 if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) { |
3044 CommandLineFlags::printFlags(tty, false); | 3061 CommandLineFlags::printFlags(tty, false); |
3045 vm_exit(0); | 3062 vm_exit(0); |
3046 } | 3063 } |
3047 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { | 3064 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { |
3065 #if INCLUDE_NMT | |
3048 MemTracker::init_tracking_options(tail); | 3066 MemTracker::init_tracking_options(tail); |
3067 #else | |
3068 warning("Native Memory Tracking is not supported in this VM"); | |
3069 #endif | |
3049 } | 3070 } |
3050 | 3071 |
3051 | 3072 |
3052 #ifndef PRODUCT | 3073 #ifndef PRODUCT |
3053 if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) { | 3074 if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) { |
3106 | 3127 |
3107 #if (defined JAVASE_EMBEDDED || defined ARM) | 3128 #if (defined JAVASE_EMBEDDED || defined ARM) |
3108 UNSUPPORTED_OPTION(UseG1GC, "G1 GC"); | 3129 UNSUPPORTED_OPTION(UseG1GC, "G1 GC"); |
3109 #endif | 3130 #endif |
3110 | 3131 |
3132 #if !INCLUDE_ALTERNATE_GCS | |
3133 if (UseParallelGC) { | |
3134 warning("Parallel GC is not supported in this VM. Using Serial GC."); | |
3135 } | |
3136 if (UseParallelOldGC) { | |
3137 warning("Parallel Old GC is not supported in this VM. Using Serial GC."); | |
3138 } | |
3139 if (UseConcMarkSweepGC) { | |
3140 warning("Concurrent Mark Sweep GC is not supported in this VM. Using Serial GC."); | |
3141 } | |
3142 if (UseParNewGC) { | |
3143 warning("Par New GC is not supported in this VM. Using Serial GC."); | |
3144 } | |
3145 #endif // INCLUDE_ALTERNATE_GCS | |
3146 | |
3111 #ifndef PRODUCT | 3147 #ifndef PRODUCT |
3112 if (TraceBytecodesAt != 0) { | 3148 if (TraceBytecodesAt != 0) { |
3113 TraceBytecodes = true; | 3149 TraceBytecodes = true; |
3114 } | 3150 } |
3115 if (CountCompiledCalls) { | 3151 if (CountCompiledCalls) { |
3154 set_object_alignment(); | 3190 set_object_alignment(); |
3155 | 3191 |
3156 #ifdef SERIALGC | 3192 #ifdef SERIALGC |
3157 force_serial_gc(); | 3193 force_serial_gc(); |
3158 #endif // SERIALGC | 3194 #endif // SERIALGC |
3159 #ifdef KERNEL | 3195 #if !INCLUDE_CDS |
3160 no_shared_spaces(); | 3196 no_shared_spaces(); |
3161 #endif // KERNEL | 3197 #endif // INCLUDE_CDS |
3162 | 3198 |
3163 // Set flags based on ergonomics. | 3199 // Set flags based on ergonomics. |
3164 set_ergonomics_flags(); | 3200 set_ergonomics_flags(); |
3165 | 3201 |
3166 set_shared_spaces_flags(); | 3202 set_shared_spaces_flags(); |
3178 vm_exit_during_initialization( | 3214 vm_exit_during_initialization( |
3179 "Incompatible compilation policy selected", NULL); | 3215 "Incompatible compilation policy selected", NULL); |
3180 } | 3216 } |
3181 } | 3217 } |
3182 | 3218 |
3183 #ifndef KERNEL | |
3184 // Set heap size based on available physical memory | 3219 // Set heap size based on available physical memory |
3185 set_heap_size(); | 3220 set_heap_size(); |
3221 | |
3222 #if INCLUDE_ALTERNATE_GCS | |
3186 // Set per-collector flags | 3223 // Set per-collector flags |
3187 if (UseParallelGC || UseParallelOldGC) { | 3224 if (UseParallelGC || UseParallelOldGC) { |
3188 set_parallel_gc_flags(); | 3225 set_parallel_gc_flags(); |
3189 } else if (UseConcMarkSweepGC) { // should be done before ParNew check below | 3226 } else if (UseConcMarkSweepGC) { // should be done before ParNew check below |
3190 set_cms_and_parnew_gc_flags(); | 3227 set_cms_and_parnew_gc_flags(); |
3191 } else if (UseParNewGC) { // skipped if CMS is set above | 3228 } else if (UseParNewGC) { // skipped if CMS is set above |
3192 set_parnew_gc_flags(); | 3229 set_parnew_gc_flags(); |
3193 } else if (UseG1GC) { | 3230 } else if (UseG1GC) { |
3194 set_g1_gc_flags(); | 3231 set_g1_gc_flags(); |
3195 } | 3232 } |
3196 #endif // KERNEL | 3233 #endif // INCLUDE_ALTERNATE_GCS |
3197 | 3234 |
3198 #ifdef SERIALGC | 3235 #ifdef SERIALGC |
3199 assert(verify_serial_gc_flags(), "SerialGC unset"); | 3236 assert(verify_serial_gc_flags(), "SerialGC unset"); |
3200 #endif // SERIALGC | 3237 #endif // SERIALGC |
3201 | 3238 |