Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/arguments.cpp @ 11097:fa6929d0b0a9
Merge
author | jiangli |
---|---|
date | Mon, 08 Jul 2013 14:21:20 -0400 |
parents | 71180a6e5080 8b789ce47503 |
children | ec173c8f3739 |
comparison
equal
deleted
inserted
replaced
11096:71180a6e5080 | 11097:fa6929d0b0a9 |
---|---|
846 arg_len = strlen(argname); | 846 arg_len = strlen(argname); |
847 } else { | 847 } else { |
848 arg_len = equal_sign - argname; | 848 arg_len = equal_sign - argname; |
849 } | 849 } |
850 | 850 |
851 Flag* found_flag = Flag::find_flag((char*)argname, arg_len, true); | 851 Flag* found_flag = Flag::find_flag((const char*)argname, arg_len, true); |
852 if (found_flag != NULL) { | 852 if (found_flag != NULL) { |
853 char locked_message_buf[BUFLEN]; | 853 char locked_message_buf[BUFLEN]; |
854 found_flag->get_locked_message(locked_message_buf, BUFLEN); | 854 found_flag->get_locked_message(locked_message_buf, BUFLEN); |
855 if (strlen(locked_message_buf) == 0) { | 855 if (strlen(locked_message_buf) == 0) { |
856 if (found_flag->is_bool() && !has_plus_minus) { | 856 if (found_flag->is_bool() && !has_plus_minus) { |
867 jio_fprintf(defaultStream::error_stream(), "%s", locked_message_buf); | 867 jio_fprintf(defaultStream::error_stream(), "%s", locked_message_buf); |
868 } | 868 } |
869 } else { | 869 } else { |
870 jio_fprintf(defaultStream::error_stream(), | 870 jio_fprintf(defaultStream::error_stream(), |
871 "Unrecognized VM option '%s'\n", argname); | 871 "Unrecognized VM option '%s'\n", argname); |
872 Flag* fuzzy_matched = Flag::fuzzy_match((const char*)argname, arg_len, true); | |
873 if (fuzzy_matched != NULL) { | |
874 jio_fprintf(defaultStream::error_stream(), | |
875 "Did you mean '%s%s%s'?\n", | |
876 (fuzzy_matched->is_bool()) ? "(+/-)" : "", | |
877 fuzzy_matched->name, | |
878 (fuzzy_matched->is_bool()) ? "" : "=<value>"); | |
879 } | |
872 } | 880 } |
873 | 881 |
874 // allow for commandline "commenting out" options like -XX:#+Verbose | 882 // allow for commandline "commenting out" options like -XX:#+Verbose |
875 return arg[0] == '#'; | 883 return arg[0] == '#'; |
876 } | 884 } |
1568 void Arguments::set_heap_base_min_address() { | 1576 void Arguments::set_heap_base_min_address() { |
1569 if (FLAG_IS_DEFAULT(HeapBaseMinAddress) && UseG1GC && HeapBaseMinAddress < 1*G) { | 1577 if (FLAG_IS_DEFAULT(HeapBaseMinAddress) && UseG1GC && HeapBaseMinAddress < 1*G) { |
1570 // By default HeapBaseMinAddress is 2G on all platforms except Solaris x86. | 1578 // By default HeapBaseMinAddress is 2G on all platforms except Solaris x86. |
1571 // G1 currently needs a lot of C-heap, so on Solaris we have to give G1 | 1579 // G1 currently needs a lot of C-heap, so on Solaris we have to give G1 |
1572 // some extra space for the C-heap compared to other collectors. | 1580 // some extra space for the C-heap compared to other collectors. |
1573 FLAG_SET_ERGO(uintx, HeapBaseMinAddress, 1*G); | 1581 // Use FLAG_SET_DEFAULT here rather than FLAG_SET_ERGO to make sure that |
1582 // code that checks for default values work correctly. | |
1583 FLAG_SET_DEFAULT(HeapBaseMinAddress, 1*G); | |
1574 } | 1584 } |
1575 } | 1585 } |
1576 | 1586 |
1577 void Arguments::set_heap_size() { | 1587 void Arguments::set_heap_size() { |
1578 if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) { | 1588 if (!FLAG_IS_DEFAULT(DefaultMaxRAMFraction)) { |
2191 "ContendedPaddingWidth=" INTX_FORMAT " must be the multiple of %d\n", | 2201 "ContendedPaddingWidth=" INTX_FORMAT " must be the multiple of %d\n", |
2192 ContendedPaddingWidth, BytesPerLong); | 2202 ContendedPaddingWidth, BytesPerLong); |
2193 status = false; | 2203 status = false; |
2194 } | 2204 } |
2195 | 2205 |
2196 if (ReservedCodeCacheSize < InitialCodeCacheSize) { | 2206 // Check lower bounds of the code cache |
2207 // Template Interpreter code is approximately 3X larger in debug builds. | |
2208 uint min_code_cache_size = (CodeCacheMinimumUseSpace DEBUG_ONLY(* 3)) + CodeCacheMinimumFreeSpace; | |
2209 if (InitialCodeCacheSize < (uintx)os::vm_page_size()) { | |
2197 jio_fprintf(defaultStream::error_stream(), | 2210 jio_fprintf(defaultStream::error_stream(), |
2198 "Invalid ReservedCodeCacheSize: %dK. Should be greater than InitialCodeCacheSize=%dK\n", | 2211 "Invalid InitialCodeCacheSize=%dK. Must be at least %dK.\n", InitialCodeCacheSize/K, |
2212 os::vm_page_size()/K); | |
2213 status = false; | |
2214 } else if (ReservedCodeCacheSize < InitialCodeCacheSize) { | |
2215 jio_fprintf(defaultStream::error_stream(), | |
2216 "Invalid ReservedCodeCacheSize: %dK. Must be at least InitialCodeCacheSize=%dK.\n", | |
2199 ReservedCodeCacheSize/K, InitialCodeCacheSize/K); | 2217 ReservedCodeCacheSize/K, InitialCodeCacheSize/K); |
2218 status = false; | |
2219 } else if (ReservedCodeCacheSize < min_code_cache_size) { | |
2220 jio_fprintf(defaultStream::error_stream(), | |
2221 "Invalid ReservedCodeCacheSize=%dK. Must be at least %uK.\n", ReservedCodeCacheSize/K, | |
2222 min_code_cache_size/K); | |
2200 status = false; | 2223 status = false; |
2201 } | 2224 } |
2202 | 2225 |
2203 return status; | 2226 return status; |
2204 } | 2227 } |
2596 FLAG_SET_CMDLINE(intx, ThreadStackSize, | 2619 FLAG_SET_CMDLINE(intx, ThreadStackSize, |
2597 round_to((int)long_ThreadStackSize, K) / K); | 2620 round_to((int)long_ThreadStackSize, K) / K); |
2598 // -Xoss | 2621 // -Xoss |
2599 } else if (match_option(option, "-Xoss", &tail)) { | 2622 } else if (match_option(option, "-Xoss", &tail)) { |
2600 // HotSpot does not have separate native and Java stacks, ignore silently for compatibility | 2623 // HotSpot does not have separate native and Java stacks, ignore silently for compatibility |
2601 // -Xmaxjitcodesize | 2624 } else if (match_option(option, "-XX:CodeCacheExpansionSize=", &tail)) { |
2625 julong long_CodeCacheExpansionSize = 0; | |
2626 ArgsRange errcode = parse_memory_size(tail, &long_CodeCacheExpansionSize, os::vm_page_size()); | |
2627 if (errcode != arg_in_range) { | |
2628 jio_fprintf(defaultStream::error_stream(), | |
2629 "Invalid argument: %s. Must be at least %luK.\n", option->optionString, | |
2630 os::vm_page_size()/K); | |
2631 return JNI_EINVAL; | |
2632 } | |
2633 FLAG_SET_CMDLINE(uintx, CodeCacheExpansionSize, (uintx)long_CodeCacheExpansionSize); | |
2602 } else if (match_option(option, "-Xmaxjitcodesize", &tail) || | 2634 } else if (match_option(option, "-Xmaxjitcodesize", &tail) || |
2603 match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) { | 2635 match_option(option, "-XX:ReservedCodeCacheSize=", &tail)) { |
2604 julong long_ReservedCodeCacheSize = 0; | 2636 julong long_ReservedCodeCacheSize = 0; |
2637 | |
2605 ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize, 1); | 2638 ArgsRange errcode = parse_memory_size(tail, &long_ReservedCodeCacheSize, 1); |
2606 if (errcode != arg_in_range) { | 2639 if (errcode != arg_in_range) { |
2607 jio_fprintf(defaultStream::error_stream(), | 2640 jio_fprintf(defaultStream::error_stream(), |
2608 "Invalid maximum code cache size: %s.\n", option->optionString); | 2641 "Invalid maximum code cache size: %s.\n", option->optionString); |
2609 return JNI_EINVAL; | 2642 return JNI_EINVAL; |