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 #include "precompiled.hpp"
26 #include "classfile/classLoader.hpp"
27 #include "classfile/javaAssertions.hpp"
28 #include "classfile/stringTable.hpp"
29 #include "classfile/symbolTable.hpp"
30 #include "code/codeCacheExtensions.hpp"
31 #include "compiler/compilerOracle.hpp"
32 #include "gc/shared/cardTableRS.hpp"
33 #include "gc/shared/genCollectedHeap.hpp"
34 #include "gc/shared/referenceProcessor.hpp"
35 #include "gc/shared/taskqueue.hpp"
36 #include "memory/allocation.inline.hpp"
37 #include "memory/universe.inline.hpp"
38 #include "oops/oop.inline.hpp"
39 #include "prims/jvmtiExport.hpp"
40 #include "runtime/arguments.hpp"
41 #include "runtime/arguments_ext.hpp"
42 #include "runtime/commandLineFlagConstraintList.hpp"
43 #include "runtime/commandLineFlagRangeList.hpp"
44 #include "runtime/globals.hpp"
45 #include "runtime/globals_extension.hpp"
46 #include "runtime/java.hpp"
47 #include "runtime/os.hpp"
48 #include "runtime/vm_version.hpp"
49 #include "services/management.hpp"
50 #include "services/memTracker.hpp"
51 #include "utilities/defaultStream.hpp"
52 #include "utilities/macros.hpp"
53 #include "utilities/stringUtils.hpp"
54 #if INCLUDE_ALL_GCS
55 #include "gc/cms/compactibleFreeListSpace.hpp"
2805 set_xdebug_mode(true);
2806 // -Xnoagent
2807 } else if (match_option(option, "-Xnoagent")) {
2808 // For compatibility with classic. HotSpot refuses to load the old style agent.dll.
2809 } else if (match_option(option, "-Xloggc:", &tail)) {
2810 // Redirect GC output to the file. -Xloggc:<filename>
2811 // ostream_init_log(), when called will use this filename
2812 // to initialize a fileStream.
2813 _gc_log_filename = os::strdup_check_oom(tail);
2814 if (!is_filename_valid(_gc_log_filename)) {
2815 jio_fprintf(defaultStream::output_stream(),
2816 "Invalid file name for use with -Xloggc: Filename can only contain the "
2817 "characters [A-Z][a-z][0-9]-_.%%[p|t] but it has been %s\n"
2818 "Note %%p or %%t can only be used once\n", _gc_log_filename);
2819 return JNI_EINVAL;
2820 }
2821 if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) {
2822 return JNI_EINVAL;
2823 }
2824 if (FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true) != Flag::SUCCESS) {
2825 return JNI_EINVAL;
2826 }
2827 // JNI hooks
2828 } else if (match_option(option, "-Xcheck", &tail)) {
2829 if (!strcmp(tail, ":jni")) {
2830 #if !INCLUDE_JNI_CHECK
2831 warning("JNI CHECKING is not supported in this VM");
2832 #else
2833 CheckJNICalls = true;
2834 #endif // INCLUDE_JNI_CHECK
2835 } else if (is_bad_option(option, args->ignoreUnrecognized,
2836 "check")) {
2837 return JNI_EINVAL;
2838 }
2839 } else if (match_option(option, "vfprintf")) {
2840 _vfprintf_hook = CAST_TO_FN_PTR(vfprintf_hook_t, option->extraInfo);
2841 } else if (match_option(option, "exit")) {
2842 _exit_hook = CAST_TO_FN_PTR(exit_hook_t, option->extraInfo);
2843 } else if (match_option(option, "abort")) {
2844 _abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo);
|
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 #include "precompiled.hpp"
26 #include "classfile/classLoader.hpp"
27 #include "classfile/javaAssertions.hpp"
28 #include "classfile/stringTable.hpp"
29 #include "classfile/symbolTable.hpp"
30 #include "code/codeCacheExtensions.hpp"
31 #include "compiler/compilerOracle.hpp"
32 #include "gc/shared/cardTableRS.hpp"
33 #include "gc/shared/genCollectedHeap.hpp"
34 #include "gc/shared/referenceProcessor.hpp"
35 #include "gc/shared/taskqueue.hpp"
36 #include "logging/logConfiguration.hpp"
37 #include "memory/allocation.inline.hpp"
38 #include "memory/universe.inline.hpp"
39 #include "oops/oop.inline.hpp"
40 #include "prims/jvmtiExport.hpp"
41 #include "runtime/arguments.hpp"
42 #include "runtime/arguments_ext.hpp"
43 #include "runtime/commandLineFlagConstraintList.hpp"
44 #include "runtime/commandLineFlagRangeList.hpp"
45 #include "runtime/globals.hpp"
46 #include "runtime/globals_extension.hpp"
47 #include "runtime/java.hpp"
48 #include "runtime/os.hpp"
49 #include "runtime/vm_version.hpp"
50 #include "services/management.hpp"
51 #include "services/memTracker.hpp"
52 #include "utilities/defaultStream.hpp"
53 #include "utilities/macros.hpp"
54 #include "utilities/stringUtils.hpp"
55 #if INCLUDE_ALL_GCS
56 #include "gc/cms/compactibleFreeListSpace.hpp"
2806 set_xdebug_mode(true);
2807 // -Xnoagent
2808 } else if (match_option(option, "-Xnoagent")) {
2809 // For compatibility with classic. HotSpot refuses to load the old style agent.dll.
2810 } else if (match_option(option, "-Xloggc:", &tail)) {
2811 // Redirect GC output to the file. -Xloggc:<filename>
2812 // ostream_init_log(), when called will use this filename
2813 // to initialize a fileStream.
2814 _gc_log_filename = os::strdup_check_oom(tail);
2815 if (!is_filename_valid(_gc_log_filename)) {
2816 jio_fprintf(defaultStream::output_stream(),
2817 "Invalid file name for use with -Xloggc: Filename can only contain the "
2818 "characters [A-Z][a-z][0-9]-_.%%[p|t] but it has been %s\n"
2819 "Note %%p or %%t can only be used once\n", _gc_log_filename);
2820 return JNI_EINVAL;
2821 }
2822 if (FLAG_SET_CMDLINE(bool, PrintGC, true) != Flag::SUCCESS) {
2823 return JNI_EINVAL;
2824 }
2825 if (FLAG_SET_CMDLINE(bool, PrintGCTimeStamps, true) != Flag::SUCCESS) {
2826 return JNI_EINVAL;
2827 }
2828 } else if (match_option(option, "-Xlog", &tail)) {
2829 bool ret = false;
2830 if (strcmp(tail, ":help") == 0) {
2831 LogConfiguration::print_command_line_help(defaultStream::output_stream());
2832 vm_exit(0);
2833 } else if (strcmp(tail, ":disable") == 0) {
2834 LogConfiguration::disable_logging();
2835 ret = true;
2836 } else if (*tail == '\0') {
2837 ret = LogConfiguration::parse_command_line_arguments();
2838 assert(ret, "-Xlog without arguments should never fail to parse");
2839 } else if (*tail == ':') {
2840 ret = LogConfiguration::parse_command_line_arguments(tail + 1);
2841 }
2842 if (ret == false) {
2843 jio_fprintf(defaultStream::error_stream(),
2844 "Invalid -Xlog option '-Xlog%s'\n",
2845 tail);
2846 return JNI_EINVAL;
2847 }
2848 // JNI hooks
2849 } else if (match_option(option, "-Xcheck", &tail)) {
2850 if (!strcmp(tail, ":jni")) {
2851 #if !INCLUDE_JNI_CHECK
2852 warning("JNI CHECKING is not supported in this VM");
2853 #else
2854 CheckJNICalls = true;
2855 #endif // INCLUDE_JNI_CHECK
2856 } else if (is_bad_option(option, args->ignoreUnrecognized,
2857 "check")) {
2858 return JNI_EINVAL;
2859 }
2860 } else if (match_option(option, "vfprintf")) {
2861 _vfprintf_hook = CAST_TO_FN_PTR(vfprintf_hook_t, option->extraInfo);
2862 } else if (match_option(option, "exit")) {
2863 _exit_hook = CAST_TO_FN_PTR(exit_hook_t, option->extraInfo);
2864 } else if (match_option(option, "abort")) {
2865 _abort_hook = CAST_TO_FN_PTR(abort_hook_t, option->extraInfo);
|