23 */ |
23 */ |
24 |
24 |
25 #ifndef SHARE_VM_SERVICES_WRITEABLEFLAG_HPP |
25 #ifndef SHARE_VM_SERVICES_WRITEABLEFLAG_HPP |
26 #define SHARE_VM_SERVICES_WRITEABLEFLAG_HPP |
26 #define SHARE_VM_SERVICES_WRITEABLEFLAG_HPP |
27 |
27 |
|
28 #include "runtime/flags/jvmFlag.hpp" |
28 #include "runtime/globals.hpp" |
29 #include "runtime/globals.hpp" |
29 #include "utilities/formatBuffer.hpp" |
30 #include "utilities/formatBuffer.hpp" |
30 |
31 |
31 class WriteableFlags : AllStatic { |
32 class WriteableFlags : AllStatic { |
32 private: |
33 private: |
33 // a writeable flag setter accepting either 'jvalue' or 'char *' values |
34 // a writeable flag setter accepting either 'jvalue' or 'char *' values |
34 static Flag::Error set_flag(const char* name, const void* value, Flag::Error(*setter)(Flag*, const void*, Flag::Flags, FormatBuffer<80>&), Flag::Flags origin, FormatBuffer<80>& err_msg); |
35 static JVMFlag::Error set_flag(const char* name, const void* value, JVMFlag::Error(*setter)(JVMFlag*, const void*, JVMFlag::Flags, FormatBuffer<80>&), JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
35 // a writeable flag setter accepting 'char *' values |
36 // a writeable flag setter accepting 'char *' values |
36 static Flag::Error set_flag_from_char(Flag* f, const void* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
37 static JVMFlag::Error set_flag_from_char(JVMFlag* f, const void* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
37 // a writeable flag setter accepting 'jvalue' values |
38 // a writeable flag setter accepting 'jvalue' values |
38 static Flag::Error set_flag_from_jvalue(Flag* f, const void* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
39 static JVMFlag::Error set_flag_from_jvalue(JVMFlag* f, const void* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
39 |
40 |
40 // set a boolean global flag |
41 // set a boolean global flag |
41 static Flag::Error set_bool_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
42 static JVMFlag::Error set_bool_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
42 // set a int global flag |
43 // set a int global flag |
43 static Flag::Error set_int_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
44 static JVMFlag::Error set_int_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
44 // set a uint global flag |
45 // set a uint global flag |
45 static Flag::Error set_uint_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
46 static JVMFlag::Error set_uint_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
46 // set a intx global flag |
47 // set a intx global flag |
47 static Flag::Error set_intx_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
48 static JVMFlag::Error set_intx_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
48 // set a uintx global flag |
49 // set a uintx global flag |
49 static Flag::Error set_uintx_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
50 static JVMFlag::Error set_uintx_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
50 // set a uint64_t global flag |
51 // set a uint64_t global flag |
51 static Flag::Error set_uint64_t_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
52 static JVMFlag::Error set_uint64_t_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
52 // set a size_t global flag using value from AttachOperation |
53 // set a size_t global flag using value from AttachOperation |
53 static Flag::Error set_size_t_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
54 static JVMFlag::Error set_size_t_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
54 // set a boolean global flag |
55 // set a boolean global flag |
55 static Flag::Error set_bool_flag(const char* name, bool value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
56 static JVMFlag::Error set_bool_flag(const char* name, bool value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
56 // set a int global flag |
57 // set a int global flag |
57 static Flag::Error set_int_flag(const char* name, int value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
58 static JVMFlag::Error set_int_flag(const char* name, int value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
58 // set a uint global flag |
59 // set a uint global flag |
59 static Flag::Error set_uint_flag(const char* name, uint value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
60 static JVMFlag::Error set_uint_flag(const char* name, uint value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
60 // set a intx global flag |
61 // set a intx global flag |
61 static Flag::Error set_intx_flag(const char* name, intx value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
62 static JVMFlag::Error set_intx_flag(const char* name, intx value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
62 // set a uintx global flag |
63 // set a uintx global flag |
63 static Flag::Error set_uintx_flag(const char* name, uintx value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
64 static JVMFlag::Error set_uintx_flag(const char* name, uintx value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
64 // set a uint64_t global flag |
65 // set a uint64_t global flag |
65 static Flag::Error set_uint64_t_flag(const char* name, uint64_t value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
66 static JVMFlag::Error set_uint64_t_flag(const char* name, uint64_t value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
66 // set a size_t global flag using value from AttachOperation |
67 // set a size_t global flag using value from AttachOperation |
67 static Flag::Error set_size_t_flag(const char* name, size_t value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
68 static JVMFlag::Error set_size_t_flag(const char* name, size_t value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
68 // set a string global flag |
69 // set a string global flag |
69 static Flag::Error set_ccstr_flag(const char* name, const char* value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
70 static JVMFlag::Error set_ccstr_flag(const char* name, const char* value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
70 |
71 |
71 public: |
72 public: |
72 /* sets a writeable flag to the provided value |
73 /* sets a writeable flag to the provided value |
73 * |
74 * |
74 * - return status is one of the WriteableFlags::err enum values |
75 * - return status is one of the WriteableFlags::err enum values |
75 * - an eventual error message will be generated to the provided err_msg buffer |
76 * - an eventual error message will be generated to the provided err_msg buffer |
76 */ |
77 */ |
77 static Flag::Error set_flag(const char* flag_name, const char* flag_value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
78 static JVMFlag::Error set_flag(const char* flag_name, const char* flag_value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
78 |
79 |
79 /* sets a writeable flag to the provided value |
80 /* sets a writeable flag to the provided value |
80 * |
81 * |
81 * - return status is one of the WriteableFlags::err enum values |
82 * - return status is one of the WriteableFlags::err enum values |
82 * - an eventual error message will be generated to the provided err_msg buffer |
83 * - an eventual error message will be generated to the provided err_msg buffer |
83 */ |
84 */ |
84 static Flag::Error set_flag(const char* flag_name, jvalue flag_value, Flag::Flags origin, FormatBuffer<80>& err_msg); |
85 static JVMFlag::Error set_flag(const char* flag_name, jvalue flag_value, JVMFlag::Flags origin, FormatBuffer<80>& err_msg); |
85 }; |
86 }; |
86 |
87 |
87 #endif /* SHARE_VM_SERVICES_WRITEABLEFLAG_HPP */ |
88 #endif /* SHARE_VM_SERVICES_WRITEABLEFLAG_HPP */ |