Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 6911:d2582a08fa5d
Merge
author | asaha |
---|---|
date | Thu, 18 Oct 2012 21:58:55 -0700 |
parents | 6ba00f89fbe1 5876f980ea19 |
children | acabb5c282f5 |
comparison
equal
deleted
inserted
replaced
6910:6ba00f89fbe1 | 6911:d2582a08fa5d |
---|---|
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)) { |
1421 warning("UseCompressedKlassPointers requires UseCompressedOops"); | 1421 warning("UseCompressedKlassPointers requires UseCompressedOops"); |
1422 } | 1422 } |
1423 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false); | 1423 FLAG_SET_DEFAULT(UseCompressedKlassPointers, false); |
1424 } else { | 1424 } else { |
1425 // Turn on UseCompressedKlassPointers too | 1425 // Turn on UseCompressedKlassPointers too |
1426 // The compiler is broken for this so turn it on when the compiler is fixed. | 1426 if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) { |
1427 // if (FLAG_IS_DEFAULT(UseCompressedKlassPointers)) { | 1427 FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true); |
1428 // FLAG_SET_ERGO(bool, UseCompressedKlassPointers, true); | 1428 } |
1429 // } | |
1430 // Set the ClassMetaspaceSize to something that will not need to be | 1429 // Set the ClassMetaspaceSize to something that will not need to be |
1431 // expanded, since it cannot be expanded. | 1430 // expanded, since it cannot be expanded. |
1432 if (UseCompressedKlassPointers && FLAG_IS_DEFAULT(ClassMetaspaceSize)) { | 1431 if (UseCompressedKlassPointers && FLAG_IS_DEFAULT(ClassMetaspaceSize)) { |
1433 // 100,000 classes seems like a good size, so 100M assumes around 1K | 1432 // 100,000 classes seems like a good size, so 100M assumes around 1K |
1434 // per klass. The vtable and oopMap is embedded so we don't have a fixed | 1433 // per klass. The vtable and oopMap is embedded so we don't have a fixed |
1989 " on sun4v; please understand that you are using at your own risk!"); | 1988 " on sun4v; please understand that you are using at your own risk!"); |
1990 } | 1989 } |
1991 } | 1990 } |
1992 #endif // SPARC | 1991 #endif // SPARC |
1993 | 1992 |
1994 if (PrintNMTStatistics && MemTracker::tracking_level() == MemTracker::NMT_off) { | 1993 if (PrintNMTStatistics) { |
1995 warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled"); | 1994 #if INCLUDE_NMT |
1996 PrintNMTStatistics = false; | 1995 if (MemTracker::tracking_level() == MemTracker::NMT_off) { |
1996 #endif // INCLUDE_NMT | |
1997 warning("PrintNMTStatistics is disabled, because native memory tracking is not enabled"); | |
1998 PrintNMTStatistics = false; | |
1999 #if INCLUDE_NMT | |
2000 } | |
2001 #endif | |
1997 } | 2002 } |
1998 | 2003 |
1999 return status; | 2004 return status; |
2000 } | 2005 } |
2001 | 2006 |
2218 char *options = NULL; | 2223 char *options = NULL; |
2219 if(pos != NULL) { | 2224 if(pos != NULL) { |
2220 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. | 2225 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); | 2226 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); |
2222 } | 2227 } |
2223 #ifdef JVMTI_KERNEL | 2228 #if !INCLUDE_JVMTI |
2224 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { | 2229 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { |
2225 warning("profiling and debugging agents are not supported with Kernel VM"); | 2230 warning("profiling and debugging agents are not supported in this VM"); |
2226 } else | 2231 } else |
2227 #endif // JVMTI_KERNEL | 2232 #endif // !INCLUDE_JVMTI |
2228 add_init_library(name, options); | 2233 add_init_library(name, options); |
2229 } | 2234 } |
2230 // -agentlib and -agentpath | 2235 // -agentlib and -agentpath |
2231 } else if (match_option(option, "-agentlib:", &tail) || | 2236 } else if (match_option(option, "-agentlib:", &tail) || |
2232 (is_absolute_path = match_option(option, "-agentpath:", &tail))) { | 2237 (is_absolute_path = match_option(option, "-agentpath:", &tail))) { |
2233 if(tail != NULL) { | 2238 if(tail != NULL) { |
2238 | 2243 |
2239 char *options = NULL; | 2244 char *options = NULL; |
2240 if(pos != NULL) { | 2245 if(pos != NULL) { |
2241 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); | 2246 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); |
2242 } | 2247 } |
2243 #ifdef JVMTI_KERNEL | 2248 #if !INCLUDE_JVMTI |
2244 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { | 2249 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { |
2245 warning("profiling and debugging agents are not supported with Kernel VM"); | 2250 warning("profiling and debugging agents are not supported in this VM"); |
2246 } else | 2251 } else |
2247 #endif // JVMTI_KERNEL | 2252 #endif // !INCLUDE_JVMTI |
2248 add_init_agent(name, options, is_absolute_path); | 2253 add_init_agent(name, options, is_absolute_path); |
2249 | 2254 |
2250 } | 2255 } |
2251 // -javaagent | 2256 // -javaagent |
2252 } else if (match_option(option, "-javaagent:", &tail)) { | 2257 } else if (match_option(option, "-javaagent:", &tail)) { |
2258 #if !INCLUDE_JVMTI | |
2259 warning("Instrumentation agents are not supported in this VM"); | |
2260 #else | |
2253 if(tail != NULL) { | 2261 if(tail != NULL) { |
2254 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); | 2262 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); |
2255 add_init_agent("instrument", options, false); | 2263 add_init_agent("instrument", options, false); |
2256 } | 2264 } |
2265 #endif // !INCLUDE_JVMTI | |
2257 // -Xnoclassgc | 2266 // -Xnoclassgc |
2258 } else if (match_option(option, "-Xnoclassgc", &tail)) { | 2267 } else if (match_option(option, "-Xnoclassgc", &tail)) { |
2259 FLAG_SET_CMDLINE(bool, ClassUnloading, false); | 2268 FLAG_SET_CMDLINE(bool, ClassUnloading, false); |
2260 // -Xincgc: i-CMS | 2269 // -Xincgc: i-CMS |
2261 } else if (match_option(option, "-Xincgc", &tail)) { | 2270 } else if (match_option(option, "-Xincgc", &tail)) { |
2383 // -Xoptimize | 2392 // -Xoptimize |
2384 } else if (match_option(option, "-Xoptimize", &tail)) { | 2393 } else if (match_option(option, "-Xoptimize", &tail)) { |
2385 // EVM option, ignore silently for compatibility | 2394 // EVM option, ignore silently for compatibility |
2386 // -Xprof | 2395 // -Xprof |
2387 } else if (match_option(option, "-Xprof", &tail)) { | 2396 } else if (match_option(option, "-Xprof", &tail)) { |
2388 #ifndef FPROF_KERNEL | 2397 #if INCLUDE_FPROF |
2389 _has_profile = true; | 2398 _has_profile = true; |
2390 #else // FPROF_KERNEL | 2399 #else // INCLUDE_FPROF |
2391 // do we have to exit? | 2400 // do we have to exit? |
2392 warning("Kernel VM does not support flat profiling."); | 2401 warning("Flat profiling is not supported in this VM."); |
2393 #endif // FPROF_KERNEL | 2402 #endif // INCLUDE_FPROF |
2394 // -Xaprof | 2403 // -Xaprof |
2395 } else if (match_option(option, "-Xaprof", &tail)) { | 2404 } else if (match_option(option, "-Xaprof", &tail)) { |
2396 _has_alloc_profile = true; | 2405 _has_alloc_profile = true; |
2397 // -Xconcurrentio | 2406 // -Xconcurrentio |
2398 } else if (match_option(option, "-Xconcurrentio", &tail)) { | 2407 } else if (match_option(option, "-Xconcurrentio", &tail)) { |
2436 // -Xshare:dump | 2445 // -Xshare:dump |
2437 } else if (match_option(option, "-Xshare:dump", &tail)) { | 2446 } else if (match_option(option, "-Xshare:dump", &tail)) { |
2438 #if defined(KERNEL) | 2447 #if defined(KERNEL) |
2439 vm_exit_during_initialization( | 2448 vm_exit_during_initialization( |
2440 "Dumping a shared archive is not supported on the Kernel JVM.", NULL); | 2449 "Dumping a shared archive is not supported on the Kernel JVM.", NULL); |
2450 #elif !INCLUDE_CDS | |
2451 vm_exit_during_initialization( | |
2452 "Dumping a shared archive is not supported in this VM.", NULL); | |
2441 #else | 2453 #else |
2442 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); | 2454 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); |
2443 set_mode_flags(_int); // Prevent compilation, which creates objects | 2455 set_mode_flags(_int); // Prevent compilation, which creates objects |
2444 #endif | 2456 #endif |
2445 // -Xshare:on | 2457 // -Xshare:on |
2488 FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true); | 2500 FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true); |
2489 | 2501 |
2490 // JNI hooks | 2502 // JNI hooks |
2491 } else if (match_option(option, "-Xcheck", &tail)) { | 2503 } else if (match_option(option, "-Xcheck", &tail)) { |
2492 if (!strcmp(tail, ":jni")) { | 2504 if (!strcmp(tail, ":jni")) { |
2505 #if !INCLUDE_JNI_CHECK | |
2506 warning("JNI CHECKING is not supported in this VM"); | |
2507 #else | |
2493 CheckJNICalls = true; | 2508 CheckJNICalls = true; |
2509 #endif // INCLUDE_JNI_CHECK | |
2494 } else if (is_bad_option(option, args->ignoreUnrecognized, | 2510 } else if (is_bad_option(option, args->ignoreUnrecognized, |
2495 "check")) { | 2511 "check")) { |
2496 return JNI_EINVAL; | 2512 return JNI_EINVAL; |
2497 } | 2513 } |
2498 } else if (match_option(option, "vfprintf", &tail)) { | 2514 } else if (match_option(option, "vfprintf", &tail)) { |
3043 if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) { | 3059 if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) { |
3044 CommandLineFlags::printFlags(tty, false); | 3060 CommandLineFlags::printFlags(tty, false); |
3045 vm_exit(0); | 3061 vm_exit(0); |
3046 } | 3062 } |
3047 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { | 3063 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { |
3064 #if INCLUDE_NMT | |
3048 MemTracker::init_tracking_options(tail); | 3065 MemTracker::init_tracking_options(tail); |
3066 #else | |
3067 warning("Native Memory Tracking is not supported in this VM"); | |
3068 #endif | |
3049 } | 3069 } |
3050 | 3070 |
3051 | 3071 |
3052 #ifndef PRODUCT | 3072 #ifndef PRODUCT |
3053 if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) { | 3073 if (match_option(option, "-XX:+PrintFlagsWithComments", &tail)) { |
3106 | 3126 |
3107 #if (defined JAVASE_EMBEDDED || defined ARM) | 3127 #if (defined JAVASE_EMBEDDED || defined ARM) |
3108 UNSUPPORTED_OPTION(UseG1GC, "G1 GC"); | 3128 UNSUPPORTED_OPTION(UseG1GC, "G1 GC"); |
3109 #endif | 3129 #endif |
3110 | 3130 |
3131 #if !INCLUDE_ALTERNATE_GCS | |
3132 if (UseParallelGC) { | |
3133 warning("Parallel GC is not supported in this VM. Using Serial GC."); | |
3134 } | |
3135 if (UseParallelOldGC) { | |
3136 warning("Parallel Old GC is not supported in this VM. Using Serial GC."); | |
3137 } | |
3138 if (UseConcMarkSweepGC) { | |
3139 warning("Concurrent Mark Sweep GC is not supported in this VM. Using Serial GC."); | |
3140 } | |
3141 if (UseParNewGC) { | |
3142 warning("Par New GC is not supported in this VM. Using Serial GC."); | |
3143 } | |
3144 #endif // INCLUDE_ALTERNATE_GCS | |
3145 | |
3111 #ifndef PRODUCT | 3146 #ifndef PRODUCT |
3112 if (TraceBytecodesAt != 0) { | 3147 if (TraceBytecodesAt != 0) { |
3113 TraceBytecodes = true; | 3148 TraceBytecodes = true; |
3114 } | 3149 } |
3115 if (CountCompiledCalls) { | 3150 if (CountCompiledCalls) { |
3154 set_object_alignment(); | 3189 set_object_alignment(); |
3155 | 3190 |
3156 #ifdef SERIALGC | 3191 #ifdef SERIALGC |
3157 force_serial_gc(); | 3192 force_serial_gc(); |
3158 #endif // SERIALGC | 3193 #endif // SERIALGC |
3159 #ifdef KERNEL | 3194 #if !INCLUDE_CDS |
3160 no_shared_spaces(); | 3195 no_shared_spaces(); |
3161 #endif // KERNEL | 3196 #endif // INCLUDE_CDS |
3162 | 3197 |
3163 // Set flags based on ergonomics. | 3198 // Set flags based on ergonomics. |
3164 set_ergonomics_flags(); | 3199 set_ergonomics_flags(); |
3165 | 3200 |
3166 set_shared_spaces_flags(); | 3201 set_shared_spaces_flags(); |
3178 vm_exit_during_initialization( | 3213 vm_exit_during_initialization( |
3179 "Incompatible compilation policy selected", NULL); | 3214 "Incompatible compilation policy selected", NULL); |
3180 } | 3215 } |
3181 } | 3216 } |
3182 | 3217 |
3183 #ifndef KERNEL | |
3184 // Set heap size based on available physical memory | 3218 // Set heap size based on available physical memory |
3185 set_heap_size(); | 3219 set_heap_size(); |
3220 | |
3221 #if INCLUDE_ALTERNATE_GCS | |
3186 // Set per-collector flags | 3222 // Set per-collector flags |
3187 if (UseParallelGC || UseParallelOldGC) { | 3223 if (UseParallelGC || UseParallelOldGC) { |
3188 set_parallel_gc_flags(); | 3224 set_parallel_gc_flags(); |
3189 } else if (UseConcMarkSweepGC) { // should be done before ParNew check below | 3225 } else if (UseConcMarkSweepGC) { // should be done before ParNew check below |
3190 set_cms_and_parnew_gc_flags(); | 3226 set_cms_and_parnew_gc_flags(); |
3191 } else if (UseParNewGC) { // skipped if CMS is set above | 3227 } else if (UseParNewGC) { // skipped if CMS is set above |
3192 set_parnew_gc_flags(); | 3228 set_parnew_gc_flags(); |
3193 } else if (UseG1GC) { | 3229 } else if (UseG1GC) { |
3194 set_g1_gc_flags(); | 3230 set_g1_gc_flags(); |
3195 } | 3231 } |
3196 #endif // KERNEL | 3232 #endif // INCLUDE_ALTERNATE_GCS |
3197 | 3233 |
3198 #ifdef SERIALGC | 3234 #ifdef SERIALGC |
3199 assert(verify_serial_gc_flags(), "SerialGC unset"); | 3235 assert(verify_serial_gc_flags(), "SerialGC unset"); |
3200 #endif // SERIALGC | 3236 #endif // SERIALGC |
3201 | 3237 |