comparison src/share/vm/runtime/arguments.cpp @ 276:aa8f54688692

Merge
author trims
date Sun, 10 Aug 2008 21:31:42 -0700
parents b727c32788a9 4c5fa80d85da
children 93befa083681 1ee8caae33af
comparison
equal deleted inserted replaced
240:585535ec8a14 276:aa8f54688692
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
2469 settings_file_specified = true; 2494 settings_file_specified = true;
2470 } 2495 }
2471 if (match_option(option, "-XX:+PrintVMOptions", &tail)) { 2496 if (match_option(option, "-XX:+PrintVMOptions", &tail)) {
2472 PrintVMOptions = true; 2497 PrintVMOptions = true;
2473 } 2498 }
2499 if (match_option(option, "-XX:-PrintVMOptions", &tail)) {
2500 PrintVMOptions = false;
2501 }
2474 } 2502 }
2475 2503
2476 // Parse default .hotspotrc settings file 2504 // Parse default .hotspotrc settings file
2477 if (!settings_file_specified) { 2505 if (!settings_file_specified) {
2478 if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) { 2506 if (!process_settings_file(".hotspotrc", false, args->ignoreUnrecognized)) {