提交 5ba703d7 编写于 作者: J jprovino

8008310: Some adjustments needed to minimal VM warnings and errors for...

8008310: Some adjustments needed to minimal VM warnings and errors for unsupported command line options
Summary: Changes to arguments.cpp for warnings vs. errors.  Changes for CDS arguments.
Reviewed-by: coleenp, cjplummer
上级 1ec16191
...@@ -69,7 +69,7 @@ ifeq ($(INCLUDE_CDS), false) ...@@ -69,7 +69,7 @@ ifeq ($(INCLUDE_CDS), false)
CXXFLAGS += -DINCLUDE_CDS=0 CXXFLAGS += -DINCLUDE_CDS=0
CFLAGS += -DINCLUDE_CDS=0 CFLAGS += -DINCLUDE_CDS=0
Src_Files_EXCLUDE += metaspaceShared.cpp Src_Files_EXCLUDE += filemap.cpp metaspaceShared.cpp
endif endif
ifeq ($(INCLUDE_ALL_GCS), false) ifeq ($(INCLUDE_ALL_GCS), false)
......
...@@ -112,12 +112,19 @@ public: ...@@ -112,12 +112,19 @@ public:
char* region_base(int i) { return _header._space[i]._base; } char* region_base(int i) { return _header._space[i]._base; }
struct FileMapHeader* header() { return &_header; } struct FileMapHeader* header() { return &_header; }
static void set_current_info(FileMapInfo* info) { _current_info = info; } static void set_current_info(FileMapInfo* info) {
static FileMapInfo* current_info() { return _current_info; } CDS_ONLY(_current_info = info;)
}
static FileMapInfo* current_info() {
CDS_ONLY(return _current_info;)
NOT_CDS(return NULL;)
}
static void assert_mark(bool check); static void assert_mark(bool check);
// File manipulation. // File manipulation.
bool initialize(); bool initialize() NOT_CDS_RETURN_(false);
bool open_for_read(); bool open_for_read();
void open_for_write(); void open_for_write();
void write_header(); void write_header();
...@@ -141,7 +148,7 @@ public: ...@@ -141,7 +148,7 @@ public:
void fail_continue(const char *msg, ...); void fail_continue(const char *msg, ...);
// Return true if given address is in the mapped shared space. // Return true if given address is in the mapped shared space.
bool is_in_shared_space(const void* p); bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false);
}; };
#endif // SHARE_VM_MEMORY_FILEMAP_HPP #endif // SHARE_VM_MEMORY_FILEMAP_HPP
...@@ -2273,8 +2273,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, ...@@ -2273,8 +2273,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
} }
#if !INCLUDE_JVMTI #if !INCLUDE_JVMTI
if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
warning("profiling and debugging agents are not supported in this VM"); jio_fprintf(defaultStream::error_stream(),
} else "Profiling and debugging agents are not supported in this VM\n");
return JNI_ERR;
}
#endif // !INCLUDE_JVMTI #endif // !INCLUDE_JVMTI
add_init_library(name, options); add_init_library(name, options);
} }
...@@ -2293,16 +2295,19 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, ...@@ -2293,16 +2295,19 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
} }
#if !INCLUDE_JVMTI #if !INCLUDE_JVMTI
if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) {
warning("profiling and debugging agents are not supported in this VM"); jio_fprintf(defaultStream::error_stream(),
} else "Profiling and debugging agents are not supported in this VM\n");
return JNI_ERR;
}
#endif // !INCLUDE_JVMTI #endif // !INCLUDE_JVMTI
add_init_agent(name, options, is_absolute_path); add_init_agent(name, options, is_absolute_path);
} }
// -javaagent // -javaagent
} else if (match_option(option, "-javaagent:", &tail)) { } else if (match_option(option, "-javaagent:", &tail)) {
#if !INCLUDE_JVMTI #if !INCLUDE_JVMTI
warning("Instrumentation agents are not supported in this VM"); jio_fprintf(defaultStream::error_stream(),
"Instrumentation agents are not supported in this VM\n");
return JNI_ERR;
#else #else
if(tail != NULL) { if(tail != NULL) {
char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail);
...@@ -2443,8 +2448,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, ...@@ -2443,8 +2448,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
#if INCLUDE_FPROF #if INCLUDE_FPROF
_has_profile = true; _has_profile = true;
#else // INCLUDE_FPROF #else // INCLUDE_FPROF
// do we have to exit? jio_fprintf(defaultStream::error_stream(),
warning("Flat profiling is not supported in this VM."); "Flat profiling is not supported in this VM.\n");
return JNI_ERR;
#endif // INCLUDE_FPROF #endif // INCLUDE_FPROF
// -Xaprof // -Xaprof
} else if (match_option(option, "-Xaprof", &tail)) { } else if (match_option(option, "-Xaprof", &tail)) {
...@@ -2478,8 +2484,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, ...@@ -2478,8 +2484,9 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
#if INCLUDE_MANAGEMENT #if INCLUDE_MANAGEMENT
FLAG_SET_CMDLINE(bool, ManagementServer, true); FLAG_SET_CMDLINE(bool, ManagementServer, true);
#else #else
vm_exit_during_initialization( jio_fprintf(defaultStream::output_stream(),
"-Dcom.sun.management is not supported in this VM.", NULL); "-Dcom.sun.management is not supported in this VM.\n");
return JNI_ERR;
#endif #endif
} }
// -Xint // -Xint
...@@ -2492,16 +2499,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, ...@@ -2492,16 +2499,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
} else if (match_option(option, "-Xcomp", &tail)) { } else if (match_option(option, "-Xcomp", &tail)) {
// for testing the compiler; turn off all flags that inhibit compilation // for testing the compiler; turn off all flags that inhibit compilation
set_mode_flags(_comp); set_mode_flags(_comp);
// -Xshare:dump // -Xshare:dump
} else if (match_option(option, "-Xshare:dump", &tail)) { } else if (match_option(option, "-Xshare:dump", &tail)) {
#if !INCLUDE_CDS
vm_exit_during_initialization(
"Dumping a shared archive is not supported in this VM.", NULL);
#else
FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true);
set_mode_flags(_int); // Prevent compilation, which creates objects set_mode_flags(_int); // Prevent compilation, which creates objects
#endif
// -Xshare:on // -Xshare:on
} else if (match_option(option, "-Xshare:on", &tail)) { } else if (match_option(option, "-Xshare:on", &tail)) {
FLAG_SET_CMDLINE(bool, UseSharedSpaces, true); FLAG_SET_CMDLINE(bool, UseSharedSpaces, true);
...@@ -2514,7 +2515,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, ...@@ -2514,7 +2515,6 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args,
} else if (match_option(option, "-Xshare:off", &tail)) { } else if (match_option(option, "-Xshare:off", &tail)) {
FLAG_SET_CMDLINE(bool, UseSharedSpaces, false); FLAG_SET_CMDLINE(bool, UseSharedSpaces, false);
FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false); FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false);
// -Xverify // -Xverify
} else if (match_option(option, "-Xverify", &tail)) { } else if (match_option(option, "-Xverify", &tail)) {
if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) { if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) {
...@@ -2828,8 +2828,9 @@ SOLARIS_ONLY( ...@@ -2828,8 +2828,9 @@ SOLARIS_ONLY(
FLAG_SET_CMDLINE(bool, UseVMInterruptibleIO, true); FLAG_SET_CMDLINE(bool, UseVMInterruptibleIO, true);
#if !INCLUDE_MANAGEMENT #if !INCLUDE_MANAGEMENT
} else if (match_option(option, "-XX:+ManagementServer", &tail)) { } else if (match_option(option, "-XX:+ManagementServer", &tail)) {
vm_exit_during_initialization( jio_fprintf(defaultStream::error_stream(),
"ManagementServer is not supported in this VM.", NULL); "ManagementServer is not supported in this VM.\n");
return JNI_ERR;
#endif // INCLUDE_MANAGEMENT #endif // INCLUDE_MANAGEMENT
} else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx
// Skip -XX:Flags= since that case has already been handled // Skip -XX:Flags= since that case has already been handled
...@@ -3135,7 +3136,9 @@ jint Arguments::parse(const JavaVMInitArgs* args) { ...@@ -3135,7 +3136,9 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
#if INCLUDE_NMT #if INCLUDE_NMT
MemTracker::init_tracking_options(tail); MemTracker::init_tracking_options(tail);
#else #else
warning("Native Memory Tracking is not supported in this VM"); jio_fprintf(defaultStream::error_stream(),
"Native Memory Tracking is not supported in this VM\n");
return JNI_ERR;
#endif #endif
} }
...@@ -3254,6 +3257,16 @@ jint Arguments::parse(const JavaVMInitArgs* args) { ...@@ -3254,6 +3257,16 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
force_serial_gc(); force_serial_gc();
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
#if !INCLUDE_CDS #if !INCLUDE_CDS
if (DumpSharedSpaces || RequireSharedSpaces) {
jio_fprintf(defaultStream::error_stream(),
"Shared spaces are not supported in this VM\n");
return JNI_ERR;
}
if (UseSharedSpaces || PrintSharedSpaces) {
warning("Shared spaces are not supported in this VM");
FLAG_SET_DEFAULT(UseSharedSpaces, false);
FLAG_SET_DEFAULT(PrintSharedSpaces, false);
}
no_shared_spaces(); no_shared_spaces();
#endif // INCLUDE_CDS #endif // INCLUDE_CDS
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册