# HG changeset patch # User phh # Date 1324327847 18000 # Node ID 6c995c08526c5f9f448239dd013c427deeb82d7e # Parent 3b688d6ff3d0b19895e5ecb1d4b026a8374376b3 7122880: Extend vendor-specific command interface to include manageable switches Summary: Add Flag::external_ext()/writable_ext(), both return false. Reviewed-by: coleenp, zgu diff -r 3b688d6ff3d0 -r 6c995c08526c src/share/vm/runtime/globals.cpp --- a/src/share/vm/runtime/globals.cpp Wed Dec 14 04:30:57 2011 -0800 +++ b/src/share/vm/runtime/globals.cpp Mon Dec 19 15:50:47 2011 -0500 @@ -82,16 +82,19 @@ } bool Flag::is_writeable() const { - return (strcmp(kind, "{manageable}") == 0 || strcmp(kind, "{product rw}") == 0); + return strcmp(kind, "{manageable}") == 0 || + strcmp(kind, "{product rw}") == 0 || + is_writeable_ext(); } -// All flags except "manageable" are assumed internal flags. +// All flags except "manageable" are assumed to be internal flags. // Long term, we need to define a mechanism to specify which flags // are external/stable and change this function accordingly. bool Flag::is_external() const { - return (strcmp(kind, "{manageable}") == 0); + return strcmp(kind, "{manageable}") == 0 || is_external_ext(); } + // Length of format string (e.g. "%.1234s") for printing ccstr below #define FORMAT_BUFFER_LEN 16 diff -r 3b688d6ff3d0 -r 6c995c08526c src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Wed Dec 14 04:30:57 2011 -0800 +++ b/src/share/vm/runtime/globals.hpp Mon Dec 19 15:50:47 2011 -0500 @@ -245,6 +245,8 @@ bool is_unlocker_ext() const; bool is_unlocked_ext() const; + bool is_writeable_ext() const; + bool is_external_ext() const; void print_on(outputStream* st, bool withComments = false ); void print_as_flag(outputStream* st); diff -r 3b688d6ff3d0 -r 6c995c08526c src/share/vm/runtime/globals_ext.hpp --- a/src/share/vm/runtime/globals_ext.hpp Wed Dec 14 04:30:57 2011 -0800 +++ b/src/share/vm/runtime/globals_ext.hpp Mon Dec 19 15:50:47 2011 -0500 @@ -53,4 +53,12 @@ return true; } +inline bool Flag::is_writeable_ext() const { + return false; +} + +inline bool Flag::is_external_ext() const { + return false; +} + #endif // SHARE_VM_RUNTIME_GLOBALS_EXT_HPP diff -r 3b688d6ff3d0 -r 6c995c08526c src/share/vm/services/management.cpp --- a/src/share/vm/services/management.cpp Wed Dec 14 04:30:57 2011 -0800 +++ b/src/share/vm/services/management.cpp Mon Dec 19 15:50:47 2011 -0500 @@ -33,6 +33,7 @@ #include "oops/objArrayKlass.hpp" #include "oops/oop.inline.hpp" #include "runtime/arguments.hpp" +#include "runtime/globals.hpp" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/javaCalls.hpp"