Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 356:1ee8caae33af
Merge
author | tonyp |
---|---|
date | Thu, 21 Aug 2008 23:36:31 -0400 |
parents | 6aae2f9d0294 aa8f54688692 |
children | 032ddb9432ad |
comparison
equal
deleted
inserted
replaced
355:0edda524b58c | 356:1ee8caae33af |
---|---|
1 /* | 1 /* |
2 * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. | 2 * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
151 | 151 |
152 // Set OS specific system properties values | 152 // Set OS specific system properties values |
153 os::init_system_properties_values(); | 153 os::init_system_properties_values(); |
154 } | 154 } |
155 | 155 |
156 // String containing commands that will be ignored and cause a | 156 /** |
157 // warning to be issued. These commands should be accepted | 157 * Provide a slightly more user-friendly way of eliminating -XX flags. |
158 // for 1.6 but not 1.7. The string should be cleared at the | 158 * When a flag is eliminated, it can be added to this list in order to |
159 // beginning of 1.7. | 159 * continue accepting this flag on the command-line, while issuing a warning |
160 static const char* obsolete_jvm_flags_1_5_0[] = { | 160 * and ignoring the value. Once the JDK version reaches the 'accept_until' |
161 "UseTrainGC", | 161 * limit, we flatly refuse to admit the existence of the flag. This allows |
162 "UseSpecialLargeObjectHandling", | 162 * a flag to die correctly over JDK releases using HSX. |
163 "UseOversizedCarHandling", | 163 */ |
164 "TraceCarAllocation", | 164 typedef struct { |
165 "PrintTrainGCProcessingStats", | 165 const char* name; |
166 "LogOfCarSpaceSize", | 166 JDK_Version obsoleted_in; // when the flag went away |
167 "OversizedCarThreshold", | 167 JDK_Version accept_until; // which version to start denying the existence |
168 "MinTickInterval", | 168 } ObsoleteFlag; |
169 "DefaultTickInterval", | 169 |
170 "MaxTickInterval", | 170 static ObsoleteFlag obsolete_jvm_flags[] = { |
171 "DelayTickAdjustment", | 171 { "UseTrainGC", JDK_Version::jdk(5), JDK_Version::jdk(7) }, |
172 "ProcessingToTenuringRatio", | 172 { "UseSpecialLargeObjectHandling", JDK_Version::jdk(5), JDK_Version::jdk(7) }, |
173 "MinTrainLength", | 173 { "UseOversizedCarHandling", JDK_Version::jdk(5), JDK_Version::jdk(7) }, |
174 0}; | 174 { "TraceCarAllocation", JDK_Version::jdk(5), JDK_Version::jdk(7) }, |
175 | 175 { "PrintTrainGCProcessingStats", JDK_Version::jdk(5), JDK_Version::jdk(7) }, |
176 bool Arguments::made_obsolete_in_1_5_0(const char *s) { | 176 { "LogOfCarSpaceSize", JDK_Version::jdk(5), JDK_Version::jdk(7) }, |
177 { "OversizedCarThreshold", JDK_Version::jdk(5), JDK_Version::jdk(7) }, | |
178 { "MinTickInterval", JDK_Version::jdk(5), JDK_Version::jdk(7) }, | |
179 { "DefaultTickInterval", JDK_Version::jdk(5), JDK_Version::jdk(7) }, | |
180 { "MaxTickInterval", JDK_Version::jdk(5), JDK_Version::jdk(7) }, | |
181 { "DelayTickAdjustment", JDK_Version::jdk(5), JDK_Version::jdk(7) }, | |
182 { "ProcessingToTenuringRatio", JDK_Version::jdk(5), JDK_Version::jdk(7) }, | |
183 { "MinTrainLength", JDK_Version::jdk(5), JDK_Version::jdk(7) }, | |
184 { "AppendRatio", JDK_Version::jdk_update(6,10), JDK_Version::jdk(7) }, | |
185 { NULL, JDK_Version(0), JDK_Version(0) } | |
186 }; | |
187 | |
188 // Returns true if the flag is obsolete and fits into the range specified | |
189 // for being ignored. In the case that the flag is ignored, the 'version' | |
190 // value is filled in with the version number when the flag became | |
191 // obsolete so that that value can be displayed to the user. | |
192 bool Arguments::is_newly_obsolete(const char *s, JDK_Version* version) { | |
177 int i = 0; | 193 int i = 0; |
178 while (obsolete_jvm_flags_1_5_0[i] != NULL) { | 194 assert(version != NULL, "Must provide a version buffer"); |
195 while (obsolete_jvm_flags[i].name != NULL) { | |
196 const ObsoleteFlag& flag_status = obsolete_jvm_flags[i]; | |
179 // <flag>=xxx form | 197 // <flag>=xxx form |
180 // [-|+]<flag> form | 198 // [-|+]<flag> form |
181 if ((strncmp(obsolete_jvm_flags_1_5_0[i], s, | 199 if ((strncmp(flag_status.name, s, strlen(flag_status.name)) == 0) || |
182 strlen(obsolete_jvm_flags_1_5_0[i])) == 0) || | |
183 ((s[0] == '+' || s[0] == '-') && | 200 ((s[0] == '+' || s[0] == '-') && |
184 (strncmp(obsolete_jvm_flags_1_5_0[i], &s[1], | 201 (strncmp(flag_status.name, &s[1], strlen(flag_status.name)) == 0))) { |
185 strlen(obsolete_jvm_flags_1_5_0[i])) == 0))) { | 202 if (JDK_Version::current().compare(flag_status.accept_until) == -1) { |
186 return true; | 203 *version = flag_status.obsoleted_in; |
204 return true; | |
205 } | |
187 } | 206 } |
188 i++; | 207 i++; |
189 } | 208 } |
190 return false; | 209 return false; |
191 } | 210 } |
703 } | 722 } |
704 st->print_cr(""); | 723 st->print_cr(""); |
705 } | 724 } |
706 } | 725 } |
707 | 726 |
708 bool Arguments::process_argument(const char* arg, jboolean ignore_unrecognized, FlagValueOrigin origin) { | 727 bool Arguments::process_argument(const char* arg, |
728 jboolean ignore_unrecognized, FlagValueOrigin origin) { | |
729 | |
730 JDK_Version since = JDK_Version(); | |
709 | 731 |
710 if (parse_argument(arg, origin)) { | 732 if (parse_argument(arg, origin)) { |
711 // do nothing | 733 // do nothing |
712 } else if (made_obsolete_in_1_5_0(arg)) { | 734 } else if (is_newly_obsolete(arg, &since)) { |
735 enum { bufsize = 256 }; | |
736 char buffer[bufsize]; | |
737 since.to_string(buffer, bufsize); | |
713 jio_fprintf(defaultStream::error_stream(), | 738 jio_fprintf(defaultStream::error_stream(), |
714 "Warning: The flag %s has been EOL'd as of 1.5.0 and will" | 739 "Warning: The flag %s has been EOL'd as of %s and will" |
715 " be ignored\n", arg); | 740 " be ignored\n", arg, buffer); |
716 } else { | 741 } else { |
717 if (!ignore_unrecognized) { | 742 if (!ignore_unrecognized) { |
718 jio_fprintf(defaultStream::error_stream(), | 743 jio_fprintf(defaultStream::error_stream(), |
719 "Unrecognized VM option '%s'\n", arg); | 744 "Unrecognized VM option '%s'\n", arg); |
720 // allow for commandline "commenting out" options like -XX:#+Verbose | 745 // allow for commandline "commenting out" options like -XX:#+Verbose |
1171 // field offset to determine free list chunk markers. | 1196 // field offset to determine free list chunk markers. |
1172 // Check that UseCompressedOops can be set with the max heap size allocated | 1197 // Check that UseCompressedOops can be set with the max heap size allocated |
1173 // by ergonomics. | 1198 // by ergonomics. |
1174 if (MaxHeapSize <= max_heap_for_compressed_oops()) { | 1199 if (MaxHeapSize <= max_heap_for_compressed_oops()) { |
1175 if (FLAG_IS_DEFAULT(UseCompressedOops) && !UseG1GC) { | 1200 if (FLAG_IS_DEFAULT(UseCompressedOops) && !UseG1GC) { |
1176 // Leave compressed oops off by default. Uncomment | 1201 // Turn off until bug is fixed. |
1177 // the following line to return it to default status. | 1202 // the following line to return it to default status. |
1178 // FLAG_SET_ERGO(bool, UseCompressedOops, true); | 1203 // FLAG_SET_ERGO(bool, UseCompressedOops, true); |
1179 } else if (UseCompressedOops && UseG1GC) { | 1204 } else if (UseCompressedOops && UseG1GC) { |
1180 warning(" UseCompressedOops does not currently work with UseG1GC; switching off UseCompressedOops. "); | 1205 warning(" UseCompressedOops does not currently work with UseG1GC; switching off UseCompressedOops. "); |
1181 FLAG_SET_DEFAULT(UseCompressedOops, false); | 1206 FLAG_SET_DEFAULT(UseCompressedOops, false); |
2480 settings_file_specified = true; | 2505 settings_file_specified = true; |
2481 } | 2506 } |
2482 if (match_option(option, "-XX:+PrintVMOptions", &tail)) { | 2507 if (match_option(option, "-XX:+PrintVMOptions", &tail)) { |
2483 PrintVMOptions = true; | 2508 PrintVMOptions = true; |
2484 } | 2509 } |
2510 if (match_option(option, "-XX:-PrintVMOptions", &tail)) { | |
2511 PrintVMOptions = false; | |
2512 } | |
2485 } | 2513 } |
2486 | 2514 |
2487 // Parse default .hotspotrc settings file | 2515 // Parse default .hotspotrc settings file |
2488 if (!settings_file_specified) { | 2516 if (!settings_file_specified) { |
2489 if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) { | 2517 if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) { |