From cca7946f7b9c9495ac6109f079dbe1065af8691f Mon Sep 17 00:00:00 2001 From: jiangli Date: Tue, 14 Oct 2014 12:09:33 -0400 Subject: [PATCH] 8047934: Adding new API for unlocking diagnostic argument. Summary: New API for unlocking diagnostic argument. Reviewed-by: dholmes, ccheung, egahlin, iklam, bdelsart --- src/share/vm/runtime/arguments.cpp | 2 ++ src/share/vm/runtime/arguments_ext.hpp | 1 + src/share/vm/runtime/globals.cpp | 5 +++++ src/share/vm/runtime/globals.hpp | 2 ++ 4 files changed, 10 insertions(+) diff --git a/src/share/vm/runtime/arguments.cpp b/src/share/vm/runtime/arguments.cpp index c718f7bbe..f6c8661e2 100644 --- a/src/share/vm/runtime/arguments.cpp +++ b/src/share/vm/runtime/arguments.cpp @@ -3617,6 +3617,8 @@ jint Arguments::parse(const JavaVMInitArgs* args) { bool settings_file_specified = false; bool needs_hotspotrc_warning = false; + ArgumentsExt::process_options(args); + const char* flags_file; int index; for (index = 0; index < args->nOptions; index++) { diff --git a/src/share/vm/runtime/arguments_ext.hpp b/src/share/vm/runtime/arguments_ext.hpp index b8dbd5a89..b0fbcc3d8 100644 --- a/src/share/vm/runtime/arguments_ext.hpp +++ b/src/share/vm/runtime/arguments_ext.hpp @@ -34,6 +34,7 @@ public: static inline bool check_gc_consistency_user(); static inline bool check_gc_consistency_ergo(); static inline bool check_vm_args_consistency(); + static void process_options(const JavaVMInitArgs* args) {} }; void ArgumentsExt::select_gc_ergonomically() { diff --git a/src/share/vm/runtime/globals.cpp b/src/share/vm/runtime/globals.cpp index 928f7134e..310fc2eae 100644 --- a/src/share/vm/runtime/globals.cpp +++ b/src/share/vm/runtime/globals.cpp @@ -243,6 +243,11 @@ bool Flag::is_unlocked() const { return is_unlocked_ext(); } +void Flag::unlock_diagnostic() { + assert(is_diagnostic(), "sanity"); + _flags = Flags(_flags & ~KIND_DIAGNOSTIC); +} + // Get custom message for this locked flag, or return NULL if // none is available. void Flag::get_locked_message(char* buf, int buflen) const { diff --git a/src/share/vm/runtime/globals.hpp b/src/share/vm/runtime/globals.hpp index c7cc5b315..51f7f673e 100644 --- a/src/share/vm/runtime/globals.hpp +++ b/src/share/vm/runtime/globals.hpp @@ -313,6 +313,8 @@ struct Flag { bool is_writeable_ext() const; bool is_external_ext() const; + void unlock_diagnostic(); + void get_locked_message(char*, int) const; void get_locked_message_ext(char*, int) const; -- GitLab