1 /*
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
126 static JVMFlag* find_flag(const char* name) {
127 return find_flag(name, strlen(name), false, false);
128 }
129 static const JVMFlag* find_declared_flag(const char* name, size_t length) {
130 return find_flag(name, length, true, true);
131 }
132 static const JVMFlag* find_declared_flag(const char* name) {
133 return find_declared_flag(name, strlen(name));
134 }
135
136 static JVMFlag* fuzzy_match(const char* name, size_t length, bool allow_locked = false);
137
138 static const char* get_int_default_range_str();
139 static const char* get_uint_default_range_str();
140 static const char* get_intx_default_range_str();
141 static const char* get_uintx_default_range_str();
142 static const char* get_uint64_t_default_range_str();
143 static const char* get_size_t_default_range_str();
144 static const char* get_double_default_range_str();
145
146 JVMFlag::Error check_writable(bool changed);
147
148 bool is_bool() const;
149 bool get_bool() const;
150 JVMFlag::Error set_bool(bool value);
151
152 bool is_int() const;
153 int get_int() const;
154 JVMFlag::Error set_int(int value);
155
156 bool is_uint() const;
157 uint get_uint() const;
158 JVMFlag::Error set_uint(uint value);
159
160 bool is_intx() const;
161 intx get_intx() const;
162 JVMFlag::Error set_intx(intx value);
163
164 bool is_uintx() const;
165 uintx get_uintx() const;
166 JVMFlag::Error set_uintx(uintx value);
167
168 bool is_uint64_t() const;
169 uint64_t get_uint64_t() const;
170 JVMFlag::Error set_uint64_t(uint64_t value);
171
172 bool is_size_t() const;
173 size_t get_size_t() const;
174 JVMFlag::Error set_size_t(size_t value);
175
176 bool is_double() const;
177 double get_double() const;
178 JVMFlag::Error set_double(double value);
179
180 bool is_ccstr() const;
181 bool ccstr_accumulates() const;
182 ccstr get_ccstr() const;
183 JVMFlag::Error set_ccstr(ccstr value);
184
185 Flags get_origin();
186 void set_origin(Flags origin);
187
188 size_t get_name_length();
189
190 bool is_default();
191 bool is_ergonomic();
192 bool is_command_line();
193 void set_command_line();
194
195 bool is_product() const;
196 bool is_manageable() const;
197 bool is_diagnostic() const;
198 bool is_experimental() const;
199 bool is_notproduct() const;
200 bool is_develop() const;
201 bool is_read_write() const;
202
203 bool is_constant_in_binary() const;
|
1 /*
2 * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
126 static JVMFlag* find_flag(const char* name) {
127 return find_flag(name, strlen(name), false, false);
128 }
129 static const JVMFlag* find_declared_flag(const char* name, size_t length) {
130 return find_flag(name, length, true, true);
131 }
132 static const JVMFlag* find_declared_flag(const char* name) {
133 return find_declared_flag(name, strlen(name));
134 }
135
136 static JVMFlag* fuzzy_match(const char* name, size_t length, bool allow_locked = false);
137
138 static const char* get_int_default_range_str();
139 static const char* get_uint_default_range_str();
140 static const char* get_intx_default_range_str();
141 static const char* get_uintx_default_range_str();
142 static const char* get_uint64_t_default_range_str();
143 static const char* get_size_t_default_range_str();
144 static const char* get_double_default_range_str();
145
146 bool is_bool() const;
147 bool get_bool() const { return *((bool*) _addr); }
148 void set_bool(bool value) { *((bool*) _addr) = value; }
149
150 bool is_int() const;
151 int get_int() const { return *((int*) _addr); }
152 void set_int(int value) { *((int*) _addr) = value; }
153
154 bool is_uint() const;
155 uint get_uint() const { return *((uint*) _addr); }
156 void set_uint(uint value) { *((uint*) _addr) = value; }
157
158 bool is_intx() const;
159 intx get_intx() const { return *((intx*) _addr); }
160 void set_intx(intx value) { *((intx*) _addr) = value; }
161
162 bool is_uintx() const;
163 uintx get_uintx() const { return *((uintx*) _addr); }
164 void set_uintx(uintx value) { *((uintx*) _addr) = value; }
165
166 bool is_uint64_t() const;
167 uint64_t get_uint64_t() const { return *((uint64_t*) _addr); }
168 void set_uint64_t(uint64_t value) { *((uint64_t*) _addr) = value; }
169
170 bool is_size_t() const;
171 size_t get_size_t() const { return *((size_t*) _addr); }
172 void set_size_t(size_t value) { *((size_t*) _addr) = value; }
173
174 bool is_double() const;
175 double get_double() const { return *((double*) _addr); }
176 void set_double(double value) { *((double*) _addr) = value; }
177
178 bool is_ccstr() const;
179 bool ccstr_accumulates() const;
180 ccstr get_ccstr() const { return *((ccstr*) _addr); }
181 void set_ccstr(ccstr value) { *((ccstr*) _addr) = value; }
182
183 Flags get_origin();
184 void set_origin(Flags origin);
185
186 size_t get_name_length();
187
188 bool is_default();
189 bool is_ergonomic();
190 bool is_command_line();
191 void set_command_line();
192
193 bool is_product() const;
194 bool is_manageable() const;
195 bool is_diagnostic() const;
196 bool is_experimental() const;
197 bool is_notproduct() const;
198 bool is_develop() const;
199 bool is_read_write() const;
200
201 bool is_constant_in_binary() const;
|