13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_RUNTIME_ARGUMENTS_HPP
26 #define SHARE_VM_RUNTIME_ARGUMENTS_HPP
27
28 #include "runtime/java.hpp"
29 #include "runtime/os.hpp"
30 #include "runtime/perfData.hpp"
31 #include "utilities/debug.hpp"
32 #include "utilities/top.hpp"
33
34 // Arguments parses the command line and recognizes options
35
36 // Invocation API hook typedefs (these should really be defined in jni.hpp)
37 extern "C" {
38 typedef void (JNICALL *abort_hook_t)(void);
39 typedef void (JNICALL *exit_hook_t)(jint code);
40 typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args) ATTRIBUTE_PRINTF(2, 0);
41 }
42
43 // Forward declarations
44
45 class SysClassPath;
46
47 // Element describing System and User (-Dkey=value flags) defined property.
48
49 class SystemProperty: public CHeapObj<mtInternal> {
50 private:
51 char* _key;
52 char* _value;
53 SystemProperty* _next;
206 _first = curr->_next;
207 } else {
208 prev->_next = curr->_next;
209 }
210 if (curr == _last) {
211 _last = prev;
212 }
213 curr->_next = NULL;
214 }
215 }
216
217 AgentLibraryList() {
218 _first = NULL;
219 _last = NULL;
220 }
221 };
222
223 // Helper class for controlling the lifetime of JavaVMInitArgs objects.
224 class ScopedVMInitArgs;
225
226 class Arguments : AllStatic {
227 friend class VMStructs;
228 friend class JvmtiExport;
229 friend class CodeCacheExtensions;
230 public:
231 // Operation modi
232 enum Mode {
233 _int, // corresponds to -Xint
234 _mixed, // corresponds to -Xmixed
235 _comp // corresponds to -Xcomp
236 };
237
238 enum ArgsRange {
239 arg_unreadable = -3,
240 arg_too_small = -2,
241 arg_too_big = -1,
242 arg_in_range = 0
243 };
244
245 private:
429
430 // Returns true if the flag is obsolete (and not yet expired).
431 // In this case the 'version' buffer is filled in with
432 // the version number when the flag became obsolete.
433 static bool is_obsolete_flag(const char* flag_name, JDK_Version* version);
434
435 // Returns 1 if the flag is deprecated (and not yet obsolete or expired).
436 // In this case the 'version' buffer is filled in with the version number when
437 // the flag became deprecated.
438 // Returns -1 if the flag is expired or obsolete.
439 // Returns 0 otherwise.
440 static int is_deprecated_flag(const char* flag_name, JDK_Version* version);
441
442 // Return the real name for the flag passed on the command line (either an alias name or "flag_name").
443 static const char* real_flag_name(const char *flag_name);
444
445 // Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated.
446 // Return NULL if the arg has expired.
447 static const char* handle_aliases_and_deprecation(const char* arg, bool warn);
448 static bool lookup_logging_aliases(const char* arg, char* buffer);
449
450 static short CompileOnlyClassesNum;
451 static short CompileOnlyClassesMax;
452 static char** CompileOnlyClasses;
453 static bool* CompileOnlyAllMethods;
454
455 static short CompileOnlyMethodsNum;
456 static short CompileOnlyMethodsMax;
457 static char** CompileOnlyMethods;
458 static bool* CompileOnlyAllClasses;
459
460 static short InterpretOnlyClassesNum;
461 static short InterpretOnlyClassesMax;
462 static char** InterpretOnlyClasses;
463 static bool* InterpretOnlyAllMethods;
464
465 static bool CheckCompileOnly;
466
467 static char* SharedArchivePath;
468
469 public:
|
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_RUNTIME_ARGUMENTS_HPP
26 #define SHARE_VM_RUNTIME_ARGUMENTS_HPP
27
28 #include "runtime/java.hpp"
29 #include "runtime/os.hpp"
30 #include "runtime/perfData.hpp"
31 #include "utilities/debug.hpp"
32 #include "utilities/top.hpp"
33 #include "logging/logTag.hpp"
34 #include "logging/logLevel.hpp"
35 // Arguments parses the command line and recognizes options
36
37 // Invocation API hook typedefs (these should really be defined in jni.hpp)
38 extern "C" {
39 typedef void (JNICALL *abort_hook_t)(void);
40 typedef void (JNICALL *exit_hook_t)(jint code);
41 typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args) ATTRIBUTE_PRINTF(2, 0);
42 }
43
44 // Forward declarations
45
46 class SysClassPath;
47
48 // Element describing System and User (-Dkey=value flags) defined property.
49
50 class SystemProperty: public CHeapObj<mtInternal> {
51 private:
52 char* _key;
53 char* _value;
54 SystemProperty* _next;
207 _first = curr->_next;
208 } else {
209 prev->_next = curr->_next;
210 }
211 if (curr == _last) {
212 _last = prev;
213 }
214 curr->_next = NULL;
215 }
216 }
217
218 AgentLibraryList() {
219 _first = NULL;
220 _last = NULL;
221 }
222 };
223
224 // Helper class for controlling the lifetime of JavaVMInitArgs objects.
225 class ScopedVMInitArgs;
226
227 // Most logging functions require 5 tags. Some of them may be _NO_TAG.
228 typedef struct {
229 const char* alias_name;
230 LogLevelType level;
231 bool exactMatch;
232 LogTagType tag;
233 } AliasedLoggingFlag;
234
235 class Arguments : AllStatic {
236 friend class VMStructs;
237 friend class JvmtiExport;
238 friend class CodeCacheExtensions;
239 public:
240 // Operation modi
241 enum Mode {
242 _int, // corresponds to -Xint
243 _mixed, // corresponds to -Xmixed
244 _comp // corresponds to -Xcomp
245 };
246
247 enum ArgsRange {
248 arg_unreadable = -3,
249 arg_too_small = -2,
250 arg_too_big = -1,
251 arg_in_range = 0
252 };
253
254 private:
438
439 // Returns true if the flag is obsolete (and not yet expired).
440 // In this case the 'version' buffer is filled in with
441 // the version number when the flag became obsolete.
442 static bool is_obsolete_flag(const char* flag_name, JDK_Version* version);
443
444 // Returns 1 if the flag is deprecated (and not yet obsolete or expired).
445 // In this case the 'version' buffer is filled in with the version number when
446 // the flag became deprecated.
447 // Returns -1 if the flag is expired or obsolete.
448 // Returns 0 otherwise.
449 static int is_deprecated_flag(const char* flag_name, JDK_Version* version);
450
451 // Return the real name for the flag passed on the command line (either an alias name or "flag_name").
452 static const char* real_flag_name(const char *flag_name);
453
454 // Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated.
455 // Return NULL if the arg has expired.
456 static const char* handle_aliases_and_deprecation(const char* arg, bool warn);
457 static bool lookup_logging_aliases(const char* arg, char* buffer);
458 static AliasedLoggingFlag catch_logging_aliases(const char* name);
459 static short CompileOnlyClassesNum;
460 static short CompileOnlyClassesMax;
461 static char** CompileOnlyClasses;
462 static bool* CompileOnlyAllMethods;
463
464 static short CompileOnlyMethodsNum;
465 static short CompileOnlyMethodsMax;
466 static char** CompileOnlyMethods;
467 static bool* CompileOnlyAllClasses;
468
469 static short InterpretOnlyClassesNum;
470 static short InterpretOnlyClassesMax;
471 static char** InterpretOnlyClasses;
472 static bool* InterpretOnlyAllMethods;
473
474 static bool CheckCompileOnly;
475
476 static char* SharedArchivePath;
477
478 public:
|