Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 1284:5f1f51edaff6
6928081: G1: rename parameters common with CMS
Summary: Rename marking stack sizing flags to be common between G1 and CMS
Reviewed-by: ysr, tonyp
author | jmasa |
---|---|
date | Wed, 24 Feb 2010 07:00:33 -0800 |
parents | 1c72304f1885 |
children | 76c1d7d13ec5 2a1472c30599 |
comparison
equal
deleted
inserted
replaced
1283:1c72304f1885 | 1284:5f1f51edaff6 |
---|---|
1201 // If either of the static initialization defaults have changed, note this | 1201 // If either of the static initialization defaults have changed, note this |
1202 // modification. | 1202 // modification. |
1203 if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) { | 1203 if (!FLAG_IS_DEFAULT(CMSParPromoteBlocksToClaim) || !FLAG_IS_DEFAULT(OldPLABWeight)) { |
1204 CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight); | 1204 CFLS_LAB::modify_initialization(OldPLABSize, OldPLABWeight); |
1205 } | 1205 } |
1206 if (PrintGCDetails && Verbose) { | |
1207 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", | |
1208 MarkStackSize / K, MarkStackSizeMax / K); | |
1209 tty->print_cr("ConcGCThreads: %u", ConcGCThreads); | |
1210 } | |
1206 } | 1211 } |
1207 #endif // KERNEL | 1212 #endif // KERNEL |
1208 | 1213 |
1209 inline uintx max_heap_for_compressed_oops() { | 1214 inline uintx max_heap_for_compressed_oops() { |
1210 LP64_ONLY(return oopDesc::OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); | 1215 LP64_ONLY(return oopDesc::OopEncodingHeapMax - MaxPermSize - os::vm_page_size()); |
1336 no_shared_spaces(); | 1341 no_shared_spaces(); |
1337 | 1342 |
1338 // Set the maximum pause time goal to be a reasonable default. | 1343 // Set the maximum pause time goal to be a reasonable default. |
1339 if (FLAG_IS_DEFAULT(MaxGCPauseMillis)) { | 1344 if (FLAG_IS_DEFAULT(MaxGCPauseMillis)) { |
1340 FLAG_SET_DEFAULT(MaxGCPauseMillis, 200); | 1345 FLAG_SET_DEFAULT(MaxGCPauseMillis, 200); |
1346 } | |
1347 | |
1348 if (FLAG_IS_DEFAULT(MarkStackSize)) { | |
1349 // Size as a multiple of TaskQueueSuper::N which is larger | |
1350 // for 64-bit. | |
1351 FLAG_SET_DEFAULT(MarkStackSize, 128 * TaskQueueSuper::total_size()); | |
1352 } | |
1353 if (PrintGCDetails && Verbose) { | |
1354 tty->print_cr("MarkStackSize: %uk MarkStackSizeMax: %uk", | |
1355 MarkStackSize / K, MarkStackSizeMax / K); | |
1356 tty->print_cr("ConcGCThreads: %u", ConcGCThreads); | |
1341 } | 1357 } |
1342 } | 1358 } |
1343 | 1359 |
1344 void Arguments::set_heap_size() { | 1360 void Arguments::set_heap_size() { |
1345 if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) { | 1361 if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) { |
1791 static bool match_option(const JavaVMOption* option, const char** names, const char** tail, | 1807 static bool match_option(const JavaVMOption* option, const char** names, const char** tail, |
1792 bool tail_allowed) { | 1808 bool tail_allowed) { |
1793 for (/* empty */; *names != NULL; ++names) { | 1809 for (/* empty */; *names != NULL; ++names) { |
1794 if (match_option(option, *names, tail)) { | 1810 if (match_option(option, *names, tail)) { |
1795 if (**tail == '\0' || tail_allowed && **tail == ':') { | 1811 if (**tail == '\0' || tail_allowed && **tail == ':') { |
1812 return true; | |
1813 } | |
1814 } | |
1815 } | |
1816 return false; | |
1817 } | |
1818 | |
1819 bool Arguments::parse_uintx(const char* value, | |
1820 uintx* uintx_arg, | |
1821 uintx min_size) { | |
1822 | |
1823 // Check the sign first since atomull() parses only unsigned values. | |
1824 bool value_is_positive = !(*value == '-'); | |
1825 | |
1826 if (value_is_positive) { | |
1827 julong n; | |
1828 bool good_return = atomull(value, &n); | |
1829 if (good_return) { | |
1830 bool above_minimum = n >= min_size; | |
1831 bool value_is_too_large = n > max_uintx; | |
1832 | |
1833 if (above_minimum && !value_is_too_large) { | |
1834 *uintx_arg = n; | |
1796 return true; | 1835 return true; |
1797 } | 1836 } |
1798 } | 1837 } |
1799 } | 1838 } |
1800 return false; | 1839 return false; |
2456 } | 2495 } |
2457 FLAG_SET_CMDLINE(uintx, YoungPLABSize, young_plab_size); | 2496 FLAG_SET_CMDLINE(uintx, YoungPLABSize, young_plab_size); |
2458 jio_fprintf(defaultStream::error_stream(), | 2497 jio_fprintf(defaultStream::error_stream(), |
2459 "Please use -XX:YoungPLABSize in place of " | 2498 "Please use -XX:YoungPLABSize in place of " |
2460 "-XX:ParallelGCToSpaceAllocBufferSize in the future\n"); | 2499 "-XX:ParallelGCToSpaceAllocBufferSize in the future\n"); |
2500 } else if (match_option(option, "-XX:CMSMarkStackSize=", &tail) || | |
2501 match_option(option, "-XX:G1MarkStackSize=", &tail)) { | |
2502 julong stack_size = 0; | |
2503 ArgsRange errcode = parse_memory_size(tail, &stack_size, 1); | |
2504 if (errcode != arg_in_range) { | |
2505 jio_fprintf(defaultStream::error_stream(), | |
2506 "Invalid mark stack size: %s\n", option->optionString); | |
2507 describe_range_error(errcode); | |
2508 return JNI_EINVAL; | |
2509 } | |
2510 FLAG_SET_CMDLINE(uintx, MarkStackSize, stack_size); | |
2511 } else if (match_option(option, "-XX:CMSMarkStackSizeMax=", &tail)) { | |
2512 julong max_stack_size = 0; | |
2513 ArgsRange errcode = parse_memory_size(tail, &max_stack_size, 1); | |
2514 if (errcode != arg_in_range) { | |
2515 jio_fprintf(defaultStream::error_stream(), | |
2516 "Invalid maximum mark stack size: %s\n", | |
2517 option->optionString); | |
2518 describe_range_error(errcode); | |
2519 return JNI_EINVAL; | |
2520 } | |
2521 FLAG_SET_CMDLINE(uintx, MarkStackSizeMax, max_stack_size); | |
2522 } else if (match_option(option, "-XX:ParallelMarkingThreads=", &tail) || | |
2523 match_option(option, "-XX:ParallelCMSThreads=", &tail)) { | |
2524 uintx conc_threads = 0; | |
2525 if (!parse_uintx(tail, &conc_threads, 1)) { | |
2526 jio_fprintf(defaultStream::error_stream(), | |
2527 "Invalid concurrent threads: %s\n", option->optionString); | |
2528 return JNI_EINVAL; | |
2529 } | |
2530 FLAG_SET_CMDLINE(uintx, ConcGCThreads, conc_threads); | |
2461 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx | 2531 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx |
2462 // Skip -XX:Flags= since that case has already been handled | 2532 // Skip -XX:Flags= since that case has already been handled |
2463 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { | 2533 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { |
2464 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { | 2534 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { |
2465 return JNI_EINVAL; | 2535 return JNI_EINVAL; |