src/share/vm/runtime/globals.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/runtime/globals.hpp Wed Sep 25 13:54:50 2013
--- new/src/share/vm/runtime/globals.hpp Wed Sep 25 13:54:49 2013
*** 192,255 ****
--- 192,295 ----
// string type aliases used only in this file
typedef const char* ccstr;
typedef const char* ccstrlist; // represents string arguments which accumulate
! enum FlagValueOrigin {
! struct Flag {
+ enum Flags {
+ // value origin
DEFAULT = 0,
COMMAND_LINE = 1,
ENVIRON_VAR = 2,
CONFIG_FILE = 3,
MANAGEMENT = 4,
ERGONOMIC = 5,
ATTACH_ON_DEMAND = 6,
INTERNAL = 99
};
struct Flag {
const char *type;
const char *name;
void* addr;
+ INTERNAL = 7,
NOT_PRODUCT(const char *doc;)
const char *kind;
FlagValueOrigin origin;
+ LAST_VALUE_ORIGIN = INTERNAL,
+ VALUE_ORIGIN_BITS = 4,
+ VALUE_ORIGIN_MASK = right_n_bits(VALUE_ORIGIN_BITS),
+
+ // flag kind
+ KIND_PRODUCT = 1 << 4,
+ KIND_MANAGEABLE = 1 << 5,
+ KIND_DIAGNOSTIC = 1 << 6,
+ KIND_EXPERIMENTAL = 1 << 7,
+ KIND_NOT_PRODUCT = 1 << 8,
+ KIND_DEVELOP = 1 << 9,
+ KIND_PLATFORM_DEPENDENT = 1 << 10,
+ KIND_READ_WRITE = 1 << 11,
+ KIND_C1 = 1 << 12,
+ KIND_C2 = 1 << 13,
+ KIND_ARCH = 1 << 14,
+ KIND_SHARK = 1 << 15,
+ KIND_LP64_PRODUCT = 1 << 16,
+ KIND_COMMERCIAL = 1 << 17,
+
+ KIND_MASK = ~VALUE_ORIGIN_MASK
+ };
+
+ const char* _type;
+ const char* _name;
+ void* _addr;
+ NOT_PRODUCT(const char* _doc;)
+ Flags _flags;
// points to all Flags static array
! static Flag *flags;
! static Flag* flags;
// number of flags
static size_t numFlags;
static Flag* find_flag(const char* name, size_t length, bool allow_locked = false);
static Flag* fuzzy_match(const char* name, size_t length, bool allow_locked = false);
bool is_bool() const { return strcmp(type, "bool") == 0; }
bool get_bool() const { return *((bool*) addr); }
void set_bool(bool value) { *((bool*) addr) = value; }
bool is_intx() const { return strcmp(type, "intx") == 0; }
intx get_intx() const { return *((intx*) addr); }
void set_intx(intx value) { *((intx*) addr) = value; }
bool is_uintx() const { return strcmp(type, "uintx") == 0; }
uintx get_uintx() const { return *((uintx*) addr); }
void set_uintx(uintx value) { *((uintx*) addr) = value; }
bool is_uint64_t() const { return strcmp(type, "uint64_t") == 0; }
uint64_t get_uint64_t() const { return *((uint64_t*) addr); }
void set_uint64_t(uint64_t value) { *((uint64_t*) addr) = value; }
bool is_double() const { return strcmp(type, "double") == 0; }
double get_double() const { return *((double*) addr); }
void set_double(double value) { *((double*) addr) = value; }
bool is_ccstr() const { return strcmp(type, "ccstr") == 0 || strcmp(type, "ccstrlist") == 0; }
bool ccstr_accumulates() const { return strcmp(type, "ccstrlist") == 0; }
ccstr get_ccstr() const { return *((ccstr*) addr); }
void set_ccstr(ccstr value) { *((ccstr*) addr) = value; }
+ void check_writable();
+
+ bool is_bool() const;
+ bool get_bool() const;
+ void set_bool(bool value);
+
+ bool is_intx() const;
+ intx get_intx() const;
+ void set_intx(intx value);
+
+ bool is_uintx() const;
+ uintx get_uintx() const;
+ void set_uintx(uintx value);
+
+ bool is_uint64_t() const;
+ uint64_t get_uint64_t() const;
+ void set_uint64_t(uint64_t value);
+
+ bool is_double() const;
+ double get_double() const;
+ void set_double(double value);
+
+ bool is_ccstr() const;
+ bool ccstr_accumulates() const;
+ ccstr get_ccstr() const;
+ void set_ccstr(ccstr value);
+
+ Flags get_origin();
+ void set_origin(Flags origin);
+
+ bool is_default();
+ bool is_ergonomic();
+ bool is_command_line();
+
+ bool is_product() const;
+ bool is_manageable() const;
+ bool is_diagnostic() const;
+ bool is_experimental() const;
+ bool is_notproduct() const;
+ bool is_develop() const;
+ bool is_read_write() const;
+ bool is_commercial() const;
+
+ bool is_constant_in_binary() const;
bool is_unlocker() const;
bool is_unlocked() const;
bool is_writeable() const;
bool is_external() const;
*** 261,270 ****
--- 301,311 ----
void get_locked_message(char*, int) const;
void get_locked_message_ext(char*, int) const;
void print_on(outputStream* st, bool withComments = false );
+ void print_kind(outputStream* st);
void print_as_flag(outputStream* st);
};
// debug flags control various aspects of the VM and are global accessible
*** 308,344 ****
--- 349,385 ----
class CommandLineFlags {
public:
static bool boolAt(char* name, size_t len, bool* value);
static bool boolAt(char* name, bool* value) { return boolAt(name, strlen(name), value); }
! static bool boolAtPut(char* name, size_t len, bool* value, FlagValueOrigin origin);
! static bool boolAtPut(char* name, bool* value, FlagValueOrigin origin) { return boolAtPut(name, strlen(name), value, origin); }
! static bool boolAtPut(char* name, size_t len, bool* value, Flag::Flags origin);
! static bool boolAtPut(char* name, bool* value, Flag::Flags origin) { return boolAtPut(name, strlen(name), value, origin); }
static bool intxAt(char* name, size_t len, intx* value);
static bool intxAt(char* name, intx* value) { return intxAt(name, strlen(name), value); }
! static bool intxAtPut(char* name, size_t len, intx* value, FlagValueOrigin origin);
! static bool intxAtPut(char* name, intx* value, FlagValueOrigin origin) { return intxAtPut(name, strlen(name), value, origin); }
! static bool intxAtPut(char* name, size_t len, intx* value, Flag::Flags origin);
! static bool intxAtPut(char* name, intx* value, Flag::Flags origin) { return intxAtPut(name, strlen(name), value, origin); }
static bool uintxAt(char* name, size_t len, uintx* value);
static bool uintxAt(char* name, uintx* value) { return uintxAt(name, strlen(name), value); }
! static bool uintxAtPut(char* name, size_t len, uintx* value, FlagValueOrigin origin);
! static bool uintxAtPut(char* name, uintx* value, FlagValueOrigin origin) { return uintxAtPut(name, strlen(name), value, origin); }
! static bool uintxAtPut(char* name, size_t len, uintx* value, Flag::Flags origin);
! static bool uintxAtPut(char* name, uintx* value, Flag::Flags origin) { return uintxAtPut(name, strlen(name), value, origin); }
static bool uint64_tAt(char* name, size_t len, uint64_t* value);
static bool uint64_tAt(char* name, uint64_t* value) { return uint64_tAt(name, strlen(name), value); }
! static bool uint64_tAtPut(char* name, size_t len, uint64_t* value, FlagValueOrigin origin);
! static bool uint64_tAtPut(char* name, uint64_t* value, FlagValueOrigin origin) { return uint64_tAtPut(name, strlen(name), value, origin); }
! static bool uint64_tAtPut(char* name, size_t len, uint64_t* value, Flag::Flags origin);
! static bool uint64_tAtPut(char* name, uint64_t* value, Flag::Flags origin) { return uint64_tAtPut(name, strlen(name), value, origin); }
static bool doubleAt(char* name, size_t len, double* value);
static bool doubleAt(char* name, double* value) { return doubleAt(name, strlen(name), value); }
! static bool doubleAtPut(char* name, size_t len, double* value, FlagValueOrigin origin);
! static bool doubleAtPut(char* name, double* value, FlagValueOrigin origin) { return doubleAtPut(name, strlen(name), value, origin); }
! static bool doubleAtPut(char* name, size_t len, double* value, Flag::Flags origin);
! static bool doubleAtPut(char* name, double* value, Flag::Flags origin) { return doubleAtPut(name, strlen(name), value, origin); }
static bool ccstrAt(char* name, size_t len, ccstr* value);
static bool ccstrAt(char* name, ccstr* value) { return ccstrAt(name, strlen(name), value); }
! static bool ccstrAtPut(char* name, size_t len, ccstr* value, FlagValueOrigin origin);
! static bool ccstrAtPut(char* name, ccstr* value, FlagValueOrigin origin) { return ccstrAtPut(name, strlen(name), value, origin); }
! static bool ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Flags origin);
! static bool ccstrAtPut(char* name, ccstr* value, Flag::Flags origin) { return ccstrAtPut(name, strlen(name), value, origin); }
// Returns false if name is not a command line flag.
static bool wasSetOnCmdline(const char* name, bool* value);
static void printSetFlags(outputStream* out);
*** 3732,3744 ****
--- 3773,3785 ----
#define DECLARE_DIAGNOSTIC_FLAG(type, name, value, doc) extern "C" type name;
#define DECLARE_EXPERIMENTAL_FLAG(type, name, value, doc) extern "C" type name;
#define DECLARE_MANAGEABLE_FLAG(type, name, value, doc) extern "C" type name;
#define DECLARE_PRODUCT_RW_FLAG(type, name, value, doc) extern "C" type name;
#ifdef PRODUCT
! #define DECLARE_DEVELOPER_FLAG(type, name, value, doc) extern "C" type CONST_##name; const type name = value;
! #define DECLARE_PD_DEVELOPER_FLAG(type, name, doc) extern "C" type CONST_##name; const type name = pd_##name;
! #define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc) extern "C" type CONST_##name;
#else
#define DECLARE_DEVELOPER_FLAG(type, name, value, doc) extern "C" type name;
#define DECLARE_PD_DEVELOPER_FLAG(type, name, doc) extern "C" type name;
#define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc) extern "C" type name;
#endif
*** 3755,3767 ****
--- 3796,3808 ----
#define MATERIALIZE_DIAGNOSTIC_FLAG(type, name, value, doc) type name = value;
#define MATERIALIZE_EXPERIMENTAL_FLAG(type, name, value, doc) type name = value;
#define MATERIALIZE_MANAGEABLE_FLAG(type, name, value, doc) type name = value;
#define MATERIALIZE_PRODUCT_RW_FLAG(type, name, value, doc) type name = value;
#ifdef PRODUCT
! #define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc) /* flag name is constant */
! #define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc) /* flag name is constant */
! #define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc)
! #define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc) type CONST_##name = value;
! #define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc) type CONST_##name = pd_##name;
! #define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc) type CONST_##name = value;
#else
#define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc) type name = value;
#define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc) type name = pd_##name;
#define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc) type name = value;
#endif
src/share/vm/runtime/globals.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File