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 |