author | stefank |
Tue, 12 Apr 2016 09:53:43 +0200 | |
changeset 37466 | 287c4ebd11b0 |
parent 37253 | 45e69c7b0bac |
child 37491 | edf4cc53f5a3 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
35489 | 2 |
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5035
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5035
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5035
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#ifndef SHARE_VM_RUNTIME_ARGUMENTS_HPP |
26 |
#define SHARE_VM_RUNTIME_ARGUMENTS_HPP |
|
27 |
||
35489 | 28 |
#include "logging/logLevel.hpp" |
29 |
#include "logging/logTag.hpp" |
|
7397 | 30 |
#include "runtime/java.hpp" |
25468
5331df506290
8048241: Introduce umbrella header os.inline.hpp and clean up includes
goetz
parents:
25074
diff
changeset
|
31 |
#include "runtime/os.hpp" |
7397 | 32 |
#include "runtime/perfData.hpp" |
22555
ea32f6c51d08
8028391: Make the Min/MaxHeapFreeRatio flags manageable
jwilhelm
parents:
22551
diff
changeset
|
33 |
#include "utilities/debug.hpp" |
7397 | 34 |
|
1 | 35 |
// Arguments parses the command line and recognizes options |
36 |
||
37 |
// Invocation API hook typedefs (these should really be defined in jni.hpp) |
|
38 |
extern "C" { |
|
39 |
typedef void (JNICALL *abort_hook_t)(void); |
|
40 |
typedef void (JNICALL *exit_hook_t)(jint code); |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
22735
diff
changeset
|
41 |
typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args) ATTRIBUTE_PRINTF(2, 0); |
1 | 42 |
} |
43 |
||
44 |
// Forward declarations |
|
36508 | 45 |
class ArgumentBootClassPath; |
1 | 46 |
|
36508 | 47 |
// PathString is used as the underlying value container for a |
48 |
// SystemProperty and for the string that represents the system |
|
49 |
// boot class path, Arguments::_system_boot_class_path. |
|
50 |
class PathString : public CHeapObj<mtInternal> { |
|
51 |
protected: |
|
1 | 52 |
char* _value; |
53 |
public: |
|
54 |
char* value() const { return _value; } |
|
36508 | 55 |
|
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
56 |
bool set_value(const char *value) { |
36508 | 57 |
if (_value != NULL) { |
58 |
FreeHeap(_value); |
|
1 | 59 |
} |
36508 | 60 |
_value = AllocateHeap(strlen(value)+1, mtInternal); |
61 |
assert(_value != NULL, "Unable to allocate space for new path value"); |
|
62 |
if (_value != NULL) { |
|
63 |
strcpy(_value, value); |
|
64 |
} else { |
|
65 |
// not able to allocate |
|
66 |
return false; |
|
67 |
} |
|
68 |
return true; |
|
1 | 69 |
} |
70 |
||
71 |
void append_value(const char *value) { |
|
72 |
char *sp; |
|
73 |
size_t len = 0; |
|
74 |
if (value != NULL) { |
|
75 |
len = strlen(value); |
|
76 |
if (_value != NULL) { |
|
77 |
len += strlen(_value); |
|
78 |
} |
|
13195 | 79 |
sp = AllocateHeap(len+2, mtInternal); |
36508 | 80 |
assert(sp != NULL, "Unable to allocate space for new append path value"); |
1 | 81 |
if (sp != NULL) { |
82 |
if (_value != NULL) { |
|
83 |
strcpy(sp, _value); |
|
84 |
strcat(sp, os::path_separator()); |
|
85 |
strcat(sp, value); |
|
86 |
FreeHeap(_value); |
|
87 |
} else { |
|
88 |
strcpy(sp, value); |
|
89 |
} |
|
90 |
_value = sp; |
|
91 |
} |
|
92 |
} |
|
93 |
} |
|
94 |
||
95 |
// Constructor |
|
36508 | 96 |
PathString(const char* value) { |
97 |
if (value == NULL) { |
|
98 |
_value = NULL; |
|
99 |
} else { |
|
100 |
_value = AllocateHeap(strlen(value)+1, mtInternal); |
|
101 |
strcpy(_value, value); |
|
102 |
} |
|
103 |
} |
|
104 |
}; |
|
105 |
||
106 |
// Element describing System and User (-Dkey=value flags) defined property. |
|
107 |
// |
|
108 |
// An internal SystemProperty is one that has been removed in |
|
109 |
// jdk.internal.VM.saveAndRemoveProperties, like jdk.boot.class.path.append. |
|
110 |
// |
|
111 |
class SystemProperty : public PathString { |
|
112 |
private: |
|
113 |
char* _key; |
|
114 |
SystemProperty* _next; |
|
115 |
bool _internal; |
|
116 |
bool _writeable; |
|
117 |
bool writeable() { return _writeable; } |
|
118 |
||
119 |
public: |
|
120 |
// Accessors |
|
121 |
char* value() const { return PathString::value(); } |
|
122 |
const char* key() const { return _key; } |
|
123 |
bool internal() const { return _internal; } |
|
124 |
SystemProperty* next() const { return _next; } |
|
125 |
void set_next(SystemProperty* next) { _next = next; } |
|
126 |
||
127 |
// A system property should only have its value set |
|
128 |
// via an external interface if it is a writeable property. |
|
129 |
// The internal, non-writeable property jdk.boot.class.path.append |
|
130 |
// is the only exception to this rule. It can be set externally |
|
131 |
// via -Xbootclasspath/a or JVMTI OnLoad phase call to AddToBootstrapClassLoaderSearch. |
|
132 |
// In those cases for jdk.boot.class.path.append, the base class |
|
133 |
// set_value and append_value methods are called directly. |
|
134 |
bool set_writeable_value(const char *value) { |
|
135 |
if (writeable()) { |
|
136 |
return set_value(value); |
|
137 |
} |
|
138 |
return false; |
|
139 |
} |
|
140 |
||
141 |
// Constructor |
|
142 |
SystemProperty(const char* key, const char* value, bool writeable, bool internal = false) : PathString(value) { |
|
1 | 143 |
if (key == NULL) { |
144 |
_key = NULL; |
|
145 |
} else { |
|
13195 | 146 |
_key = AllocateHeap(strlen(key)+1, mtInternal); |
1 | 147 |
strcpy(_key, key); |
148 |
} |
|
149 |
_next = NULL; |
|
36508 | 150 |
_internal = internal; |
1 | 151 |
_writeable = writeable; |
152 |
} |
|
153 |
}; |
|
154 |
||
155 |
||
156 |
// For use by -agentlib, -agentpath and -Xrun |
|
13195 | 157 |
class AgentLibrary : public CHeapObj<mtInternal> { |
1 | 158 |
friend class AgentLibraryList; |
19553
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
159 |
public: |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
160 |
// Is this library valid or not. Don't rely on os_lib == NULL as statically |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
161 |
// linked lib could have handle of RTLD_DEFAULT which == 0 on some platforms |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
162 |
enum AgentState { |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
163 |
agent_invalid = 0, |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
164 |
agent_valid = 1 |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
165 |
}; |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
166 |
|
1 | 167 |
private: |
168 |
char* _name; |
|
169 |
char* _options; |
|
170 |
void* _os_lib; |
|
171 |
bool _is_absolute_path; |
|
19553
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
172 |
bool _is_static_lib; |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
173 |
AgentState _state; |
1 | 174 |
AgentLibrary* _next; |
175 |
||
176 |
public: |
|
177 |
// Accessors |
|
178 |
const char* name() const { return _name; } |
|
179 |
char* options() const { return _options; } |
|
180 |
bool is_absolute_path() const { return _is_absolute_path; } |
|
181 |
void* os_lib() const { return _os_lib; } |
|
182 |
void set_os_lib(void* os_lib) { _os_lib = os_lib; } |
|
183 |
AgentLibrary* next() const { return _next; } |
|
19553
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
184 |
bool is_static_lib() const { return _is_static_lib; } |
19973 | 185 |
void set_static_lib(bool is_static_lib) { _is_static_lib = is_static_lib; } |
19553
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
186 |
bool valid() { return (_state == agent_valid); } |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
187 |
void set_valid() { _state = agent_valid; } |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
188 |
void set_invalid() { _state = agent_invalid; } |
1 | 189 |
|
190 |
// Constructor |
|
191 |
AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) { |
|
13195 | 192 |
_name = AllocateHeap(strlen(name)+1, mtInternal); |
1 | 193 |
strcpy(_name, name); |
194 |
if (options == NULL) { |
|
195 |
_options = NULL; |
|
196 |
} else { |
|
13195 | 197 |
_options = AllocateHeap(strlen(options)+1, mtInternal); |
1 | 198 |
strcpy(_options, options); |
199 |
} |
|
200 |
_is_absolute_path = is_absolute_path; |
|
201 |
_os_lib = os_lib; |
|
202 |
_next = NULL; |
|
19553
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
203 |
_state = agent_invalid; |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
204 |
_is_static_lib = false; |
1 | 205 |
} |
206 |
}; |
|
207 |
||
208 |
// maintain an order of entry list of AgentLibrary |
|
209 |
class AgentLibraryList VALUE_OBJ_CLASS_SPEC { |
|
210 |
private: |
|
211 |
AgentLibrary* _first; |
|
212 |
AgentLibrary* _last; |
|
213 |
public: |
|
214 |
bool is_empty() const { return _first == NULL; } |
|
215 |
AgentLibrary* first() const { return _first; } |
|
216 |
||
217 |
// add to the end of the list |
|
218 |
void add(AgentLibrary* lib) { |
|
219 |
if (is_empty()) { |
|
220 |
_first = _last = lib; |
|
221 |
} else { |
|
222 |
_last->_next = lib; |
|
223 |
_last = lib; |
|
224 |
} |
|
225 |
lib->_next = NULL; |
|
226 |
} |
|
227 |
||
228 |
// search for and remove a library known to be in the list |
|
229 |
void remove(AgentLibrary* lib) { |
|
230 |
AgentLibrary* curr; |
|
231 |
AgentLibrary* prev = NULL; |
|
232 |
for (curr = first(); curr != NULL; prev = curr, curr = curr->next()) { |
|
233 |
if (curr == lib) { |
|
234 |
break; |
|
235 |
} |
|
236 |
} |
|
237 |
assert(curr != NULL, "always should be found"); |
|
238 |
||
239 |
if (curr != NULL) { |
|
240 |
// it was found, by-pass this library |
|
241 |
if (prev == NULL) { |
|
242 |
_first = curr->_next; |
|
243 |
} else { |
|
244 |
prev->_next = curr->_next; |
|
245 |
} |
|
246 |
if (curr == _last) { |
|
247 |
_last = prev; |
|
248 |
} |
|
249 |
curr->_next = NULL; |
|
250 |
} |
|
251 |
} |
|
252 |
||
253 |
AgentLibraryList() { |
|
254 |
_first = NULL; |
|
255 |
_last = NULL; |
|
256 |
} |
|
257 |
}; |
|
258 |
||
31853
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
259 |
// Helper class for controlling the lifetime of JavaVMInitArgs objects. |
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
260 |
class ScopedVMInitArgs; |
1 | 261 |
|
35489 | 262 |
// Most logging functions require 5 tags. Some of them may be _NO_TAG. |
263 |
typedef struct { |
|
264 |
const char* alias_name; |
|
265 |
LogLevelType level; |
|
266 |
bool exactMatch; |
|
37094
c12f414936a1
8149995: TraceClassLoadingPreorder has been converted to Unified Logging.
mockner
parents:
36313
diff
changeset
|
267 |
LogTagType tag0; |
c12f414936a1
8149995: TraceClassLoadingPreorder has been converted to Unified Logging.
mockner
parents:
36313
diff
changeset
|
268 |
LogTagType tag1; |
c12f414936a1
8149995: TraceClassLoadingPreorder has been converted to Unified Logging.
mockner
parents:
36313
diff
changeset
|
269 |
LogTagType tag2; |
c12f414936a1
8149995: TraceClassLoadingPreorder has been converted to Unified Logging.
mockner
parents:
36313
diff
changeset
|
270 |
LogTagType tag3; |
c12f414936a1
8149995: TraceClassLoadingPreorder has been converted to Unified Logging.
mockner
parents:
36313
diff
changeset
|
271 |
LogTagType tag4; |
c12f414936a1
8149995: TraceClassLoadingPreorder has been converted to Unified Logging.
mockner
parents:
36313
diff
changeset
|
272 |
LogTagType tag5; |
35489 | 273 |
} AliasedLoggingFlag; |
274 |
||
1 | 275 |
class Arguments : AllStatic { |
276 |
friend class VMStructs; |
|
277 |
friend class JvmtiExport; |
|
31620
53be635ad49c
8087333: Optionally Pre-Generate the HotSpot Template Interpreter
bdelsart
parents:
31608
diff
changeset
|
278 |
friend class CodeCacheExtensions; |
1 | 279 |
public: |
280 |
// Operation modi |
|
281 |
enum Mode { |
|
282 |
_int, // corresponds to -Xint |
|
283 |
_mixed, // corresponds to -Xmixed |
|
284 |
_comp // corresponds to -Xcomp |
|
285 |
}; |
|
286 |
||
287 |
enum ArgsRange { |
|
288 |
arg_unreadable = -3, |
|
289 |
arg_too_small = -2, |
|
290 |
arg_too_big = -1, |
|
291 |
arg_in_range = 0 |
|
292 |
}; |
|
293 |
||
294 |
private: |
|
295 |
||
34125
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
296 |
// a pointer to the flags file name if it is specified |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
297 |
static char* _jvm_flags_file; |
1 | 298 |
// an array containing all flags specified in the .hotspotrc file |
299 |
static char** _jvm_flags_array; |
|
300 |
static int _num_jvm_flags; |
|
301 |
// an array containing all jvm arguments specified in the command line |
|
302 |
static char** _jvm_args_array; |
|
303 |
static int _num_jvm_args; |
|
304 |
// string containing all java command (class/jarfile name and app args) |
|
305 |
static char* _java_command; |
|
306 |
||
307 |
// Property list |
|
308 |
static SystemProperty* _system_properties; |
|
309 |
||
310 |
// Quick accessor to System properties in the list: |
|
311 |
static SystemProperty *_sun_boot_library_path; |
|
312 |
static SystemProperty *_java_library_path; |
|
313 |
static SystemProperty *_java_home; |
|
314 |
static SystemProperty *_java_class_path; |
|
36508 | 315 |
static SystemProperty *_jdk_boot_class_path_append; |
316 |
||
317 |
// The constructed value of the system class path after |
|
318 |
// argument processing and JVMTI OnLoad additions via |
|
319 |
// calls to AddToBootstrapClassLoaderSearch. This is the |
|
320 |
// final form before ClassLoader::setup_bootstrap_search(). |
|
321 |
static PathString *_system_boot_class_path; |
|
1 | 322 |
|
27562 | 323 |
// temporary: to emit warning if the default ext dirs are not empty. |
324 |
// remove this variable when the warning is no longer needed. |
|
325 |
static char* _ext_dirs; |
|
326 |
||
1 | 327 |
// java.vendor.url.bug, bug reporting URL for fatal errors. |
328 |
static const char* _java_vendor_url_bug; |
|
329 |
||
330 |
// sun.java.launcher, private property to provide information about |
|
22734
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
20288
diff
changeset
|
331 |
// java launcher |
1 | 332 |
static const char* _sun_java_launcher; |
333 |
||
334 |
// sun.java.launcher.pid, private property |
|
335 |
static int _sun_java_launcher_pid; |
|
336 |
||
22734
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
20288
diff
changeset
|
337 |
// was this VM created via the -XXaltjvm=<path> option |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
20288
diff
changeset
|
338 |
static bool _sun_java_launcher_is_altjvm; |
8476
7e34c2d4cf9b
7022037: Pause when exiting if debugger is attached on windows
sla
parents:
7397
diff
changeset
|
339 |
|
1 | 340 |
// Option flags |
341 |
static bool _has_profile; |
|
35872
7fb1e4de83ff
8145180: Add back PrintGC, PrintGCDetails and -Xloggc
brutisso
parents:
35489
diff
changeset
|
342 |
static const char* _gc_log_filename; |
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
343 |
// Value of the conservative maximum heap alignment needed |
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
344 |
static size_t _conservative_max_heap_alignment; |
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
345 |
|
36508 | 346 |
static uintx _min_heap_size; |
26824
a04a1291103f
8055006: Store original value of Min/MaxHeapFreeRatio
jwilhelm
parents:
26585
diff
changeset
|
347 |
|
1 | 348 |
// -Xrun arguments |
349 |
static AgentLibraryList _libraryList; |
|
350 |
static void add_init_library(const char* name, char* options) |
|
351 |
{ _libraryList.add(new AgentLibrary(name, options, false, NULL)); } |
|
352 |
||
353 |
// -agentlib and -agentpath arguments |
|
354 |
static AgentLibraryList _agentList; |
|
355 |
static void add_init_agent(const char* name, char* options, bool absolute_path) |
|
356 |
{ _agentList.add(new AgentLibrary(name, options, absolute_path, NULL)); } |
|
357 |
||
358 |
// Late-binding agents not started via arguments |
|
19553
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
359 |
static void add_loaded_agent(AgentLibrary *agentLib) |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
360 |
{ _agentList.add(agentLib); } |
1 | 361 |
static void add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib) |
362 |
{ _agentList.add(new AgentLibrary(name, options, absolute_path, os_lib)); } |
|
363 |
||
364 |
// Operation modi |
|
365 |
static Mode _mode; |
|
366 |
static void set_mode_flags(Mode mode); |
|
367 |
static bool _java_compiler; |
|
368 |
static void set_java_compiler(bool arg) { _java_compiler = arg; } |
|
369 |
static bool java_compiler() { return _java_compiler; } |
|
370 |
||
36508 | 371 |
// Capture the index location of -Xbootclasspath\a within sysclasspath. |
372 |
// Used when setting up the bootstrap search path in order to |
|
373 |
// mark the boot loader's append path observability boundary. |
|
374 |
static int _bootclassloader_append_index; |
|
375 |
||
376 |
// -Xpatch flag |
|
377 |
static char** _patch_dirs; |
|
378 |
static int _patch_dirs_count; |
|
379 |
static void set_patch_dirs(char** dirs) { _patch_dirs = dirs; } |
|
380 |
static void set_patch_dirs_count(int count) { _patch_dirs_count = count; } |
|
381 |
||
1 | 382 |
// -Xdebug flag |
383 |
static bool _xdebug_mode; |
|
384 |
static void set_xdebug_mode(bool arg) { _xdebug_mode = arg; } |
|
385 |
static bool xdebug_mode() { return _xdebug_mode; } |
|
386 |
||
387 |
// Used to save default settings |
|
388 |
static bool _AlwaysCompileLoopMethods; |
|
389 |
static bool _UseOnStackReplacement; |
|
390 |
static bool _BackgroundCompilation; |
|
391 |
static bool _ClipInlining; |
|
392 |
static bool _CIDynamicCompilePriority; |
|
30201
cfe623bb3f9c
8075663: compiler/rangechecks/TestExplicitRangeChecks.java fails in compiler nightlies
roland
parents:
29697
diff
changeset
|
393 |
static intx _Tier3InvokeNotifyFreqLog; |
cfe623bb3f9c
8075663: compiler/rangechecks/TestExplicitRangeChecks.java fails in compiler nightlies
roland
parents:
29697
diff
changeset
|
394 |
static intx _Tier4InvocationThreshold; |
1 | 395 |
|
6453 | 396 |
// Tiered |
397 |
static void set_tiered_flags(); |
|
1 | 398 |
// CMS/ParNew garbage collectors |
399 |
static void set_parnew_gc_flags(); |
|
400 |
static void set_cms_and_parnew_gc_flags(); |
|
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
183
diff
changeset
|
401 |
// UseParallel[Old]GC |
1 | 402 |
static void set_parallel_gc_flags(); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
183
diff
changeset
|
403 |
// Garbage-First (UseG1GC) |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
183
diff
changeset
|
404 |
static void set_g1_gc_flags(); |
1 | 405 |
// GC ergonomics |
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
406 |
static void set_conservative_max_heap_alignment(); |
15957
58302a2ffb9a
8001049: VM crashes when running with large -Xms and not specifying ObjectAlignmentInBytes
brutisso
parents:
15950
diff
changeset
|
407 |
static void set_use_compressed_oops(); |
19319
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18687
diff
changeset
|
408 |
static void set_use_compressed_klass_ptrs(); |
26836
b27ec66071c7
8057531: refactor gc argument processing code slightly
jcoomes
parents:
26824
diff
changeset
|
409 |
static void select_gc(); |
1 | 410 |
static void set_ergonomics_flags(); |
8681
c691d94813f9
7018056: large pages not always enabled by default
jcoomes
parents:
8476
diff
changeset
|
411 |
static void set_shared_spaces_flags(); |
16605
ba13efd453bc
7112912: Message "Error occurred during initialization of VM" on boxes with lots of RAM
tschatzl
parents:
15957
diff
changeset
|
412 |
// limits the given memory size by the maximum amount of memory this process is |
ba13efd453bc
7112912: Message "Error occurred during initialization of VM" on boxes with lots of RAM
tschatzl
parents:
15957
diff
changeset
|
413 |
// currently allowed to allocate or reserve. |
ba13efd453bc
7112912: Message "Error occurred during initialization of VM" on boxes with lots of RAM
tschatzl
parents:
15957
diff
changeset
|
414 |
static julong limit_by_allocatable_memory(julong size); |
4434 | 415 |
// Setup heap size |
416 |
static void set_heap_size(); |
|
1 | 417 |
// Based on automatic selection criteria, should the |
418 |
// low pause collector be used. |
|
419 |
static bool should_auto_select_low_pause_collector(); |
|
420 |
||
421 |
// Bytecode rewriting |
|
422 |
static void set_bytecode_flags(); |
|
423 |
||
424 |
// Invocation API hooks |
|
425 |
static abort_hook_t _abort_hook; |
|
426 |
static exit_hook_t _exit_hook; |
|
427 |
static vfprintf_hook_t _vfprintf_hook; |
|
428 |
||
429 |
// System properties |
|
430 |
static bool add_property(const char* prop); |
|
431 |
||
36508 | 432 |
// Miscellaneous system property setter |
433 |
static bool append_to_addmods_property(const char* module_name); |
|
434 |
||
1 | 435 |
// Aggressive optimization flags. |
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
436 |
static jint set_aggressive_opts_flags(); |
1 | 437 |
|
32823
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
438 |
static jint set_aggressive_heap_flags(); |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
439 |
|
1 | 440 |
// Argument parsing |
441 |
static void do_pd_flag_adjustments(); |
|
20288
e2d549f40de9
8024545: make develop and notproduct flag values available in product builds
twisti
parents:
20006
diff
changeset
|
442 |
static bool parse_argument(const char* arg, Flag::Flags origin); |
e2d549f40de9
8024545: make develop and notproduct flag values available in product builds
twisti
parents:
20006
diff
changeset
|
443 |
static bool process_argument(const char* arg, jboolean ignore_unrecognized, Flag::Flags origin); |
1 | 444 |
static void process_java_launcher_argument(const char*, void*); |
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
445 |
static void process_java_compiler_argument(const char* arg); |
31853
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
446 |
static jint parse_options_environment_variable(const char* name, ScopedVMInitArgs* vm_args); |
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
447 |
static jint parse_java_tool_options_environment_variable(ScopedVMInitArgs* vm_args); |
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
448 |
static jint parse_java_options_environment_variable(ScopedVMInitArgs* vm_args); |
32621
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
449 |
static jint parse_vm_options_file(const char* file_name, ScopedVMInitArgs* vm_args); |
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
450 |
static jint parse_options_buffer(const char* name, char* buffer, const size_t buf_len, ScopedVMInitArgs* vm_args); |
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
451 |
static jint insert_vm_options_file(const JavaVMInitArgs* args, |
35466
4ace9ef0201b
8135198: Add -XX:VMOptionsFile support to JAVA_TOOL_OPTIONS and _JAVA_OPTIONS
rdurbin
parents:
35171
diff
changeset
|
452 |
const char* vm_options_file, |
32621
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
453 |
const int vm_options_file_pos, |
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
454 |
ScopedVMInitArgs* vm_options_file_args, |
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
455 |
ScopedVMInitArgs* args_out); |
35466
4ace9ef0201b
8135198: Add -XX:VMOptionsFile support to JAVA_TOOL_OPTIONS and _JAVA_OPTIONS
rdurbin
parents:
35171
diff
changeset
|
456 |
static bool args_contains_vm_options_file_arg(const JavaVMInitArgs* args); |
4ace9ef0201b
8135198: Add -XX:VMOptionsFile support to JAVA_TOOL_OPTIONS and _JAVA_OPTIONS
rdurbin
parents:
35171
diff
changeset
|
457 |
static jint expand_vm_options_as_needed(const JavaVMInitArgs* args_in, |
4ace9ef0201b
8135198: Add -XX:VMOptionsFile support to JAVA_TOOL_OPTIONS and _JAVA_OPTIONS
rdurbin
parents:
35171
diff
changeset
|
458 |
ScopedVMInitArgs* mod_args, |
4ace9ef0201b
8135198: Add -XX:VMOptionsFile support to JAVA_TOOL_OPTIONS and _JAVA_OPTIONS
rdurbin
parents:
35171
diff
changeset
|
459 |
JavaVMInitArgs** args_out); |
32621
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
460 |
static jint match_special_option_and_act(const JavaVMInitArgs* args, |
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
461 |
ScopedVMInitArgs* args_out); |
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
462 |
|
35872
7fb1e4de83ff
8145180: Add back PrintGC, PrintGCDetails and -Xloggc
brutisso
parents:
35489
diff
changeset
|
463 |
static bool handle_deprecated_print_gc_flags(); |
7fb1e4de83ff
8145180: Add back PrintGC, PrintGCDetails and -Xloggc
brutisso
parents:
35489
diff
changeset
|
464 |
|
31853
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
465 |
static jint parse_vm_init_args(const JavaVMInitArgs *java_tool_options_args, |
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
466 |
const JavaVMInitArgs *java_options_args, |
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
467 |
const JavaVMInitArgs *cmd_line_args); |
36508 | 468 |
static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, ArgumentBootClassPath* bcp_p, bool* bcp_assembly_required_p, Flag::Flags origin); |
469 |
static jint finalize_vm_init_args(ArgumentBootClassPath* bcp_p, bool bcp_assembly_required); |
|
22555
ea32f6c51d08
8028391: Make the Min/MaxHeapFreeRatio flags manageable
jwilhelm
parents:
22551
diff
changeset
|
470 |
static bool is_bad_option(const JavaVMOption* option, jboolean ignore, const char* option_type); |
ea32f6c51d08
8028391: Make the Min/MaxHeapFreeRatio flags manageable
jwilhelm
parents:
22551
diff
changeset
|
471 |
|
1 | 472 |
static bool is_bad_option(const JavaVMOption* option, jboolean ignore) { |
473 |
return is_bad_option(option, ignore, NULL); |
|
474 |
} |
|
22555
ea32f6c51d08
8028391: Make the Min/MaxHeapFreeRatio flags manageable
jwilhelm
parents:
22551
diff
changeset
|
475 |
|
1 | 476 |
static void describe_range_error(ArgsRange errcode); |
1676
d80e69372634
6653214: MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes.
swamyv
parents:
1388
diff
changeset
|
477 |
static ArgsRange check_memory_size(julong size, julong min_size); |
d80e69372634
6653214: MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes.
swamyv
parents:
1388
diff
changeset
|
478 |
static ArgsRange parse_memory_size(const char* s, julong* long_arg, |
d80e69372634
6653214: MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes.
swamyv
parents:
1388
diff
changeset
|
479 |
julong min_size); |
5035 | 480 |
// Parse a string for a unsigned integer. Returns true if value |
481 |
// is an unsigned integer greater than or equal to the minimum |
|
482 |
// parameter passed and returns the value in uintx_arg. Returns |
|
483 |
// false otherwise, with uintx_arg undefined. |
|
484 |
static bool parse_uintx(const char* value, uintx* uintx_arg, |
|
485 |
uintx min_size); |
|
1 | 486 |
|
487 |
// methods to build strings from individual args |
|
488 |
static void build_jvm_args(const char* arg); |
|
489 |
static void build_jvm_flags(const char* arg); |
|
490 |
static void add_string(char*** bldarray, int* count, const char* arg); |
|
491 |
static const char* build_resource_string(char** args, int count); |
|
492 |
||
493 |
static bool methodExists( |
|
494 |
char* className, char* methodName, |
|
495 |
int classesNum, char** classes, bool* allMethods, |
|
496 |
int methodsNum, char** methods, bool* allClasses |
|
497 |
); |
|
498 |
||
499 |
static void parseOnlyLine( |
|
500 |
const char* line, |
|
501 |
short* classesNum, short* classesMax, char*** classes, bool** allMethods, |
|
502 |
short* methodsNum, short* methodsMax, char*** methods, bool** allClasses |
|
503 |
); |
|
504 |
||
32823
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
505 |
// Returns true if the flag is obsolete (and not yet expired). |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
506 |
// In this case the 'version' buffer is filled in with |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
507 |
// the version number when the flag became obsolete. |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
508 |
static bool is_obsolete_flag(const char* flag_name, JDK_Version* version); |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
509 |
|
37173
d8aea1500483
8146632: Add descriptive error messages for removed non-product logging flags.
mockner
parents:
37094
diff
changeset
|
510 |
#ifndef PRODUCT |
d8aea1500483
8146632: Add descriptive error messages for removed non-product logging flags.
mockner
parents:
37094
diff
changeset
|
511 |
static const char* removed_develop_logging_flag_name(const char* name); |
d8aea1500483
8146632: Add descriptive error messages for removed non-product logging flags.
mockner
parents:
37094
diff
changeset
|
512 |
#endif // PRODUCT |
d8aea1500483
8146632: Add descriptive error messages for removed non-product logging flags.
mockner
parents:
37094
diff
changeset
|
513 |
|
32823
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
514 |
// Returns 1 if the flag is deprecated (and not yet obsolete or expired). |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
515 |
// In this case the 'version' buffer is filled in with the version number when |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
516 |
// the flag became deprecated. |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
517 |
// Returns -1 if the flag is expired or obsolete. |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
518 |
// Returns 0 otherwise. |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
519 |
static int is_deprecated_flag(const char* flag_name, JDK_Version* version); |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
520 |
|
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
521 |
// Return the real name for the flag passed on the command line (either an alias name or "flag_name"). |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
522 |
static const char* real_flag_name(const char *flag_name); |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
523 |
|
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
524 |
// Return the "real" name for option arg if arg is an alias, and print a warning if arg is deprecated. |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
525 |
// Return NULL if the arg has expired. |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
526 |
static const char* handle_aliases_and_deprecation(const char* arg, bool warn); |
35171
cf7d5a1d0662
8145153: Convert TraceMonitorInflation to Unified Logging
rprotacio
parents:
35061
diff
changeset
|
527 |
static bool lookup_logging_aliases(const char* arg, char* buffer); |
37216
5555c1f804c4
8145235: Deprecate product flags that have been converted to Unified Logging
rprotacio
parents:
37199
diff
changeset
|
528 |
static AliasedLoggingFlag catch_logging_aliases(const char* name, bool on); |
1 | 529 |
static short CompileOnlyClassesNum; |
530 |
static short CompileOnlyClassesMax; |
|
531 |
static char** CompileOnlyClasses; |
|
532 |
static bool* CompileOnlyAllMethods; |
|
533 |
||
534 |
static short CompileOnlyMethodsNum; |
|
535 |
static short CompileOnlyMethodsMax; |
|
536 |
static char** CompileOnlyMethods; |
|
537 |
static bool* CompileOnlyAllClasses; |
|
538 |
||
539 |
static short InterpretOnlyClassesNum; |
|
540 |
static short InterpretOnlyClassesMax; |
|
541 |
static char** InterpretOnlyClasses; |
|
542 |
static bool* InterpretOnlyAllMethods; |
|
543 |
||
544 |
static bool CheckCompileOnly; |
|
545 |
||
546 |
static char* SharedArchivePath; |
|
547 |
||
548 |
public: |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
549 |
// Scale compile thresholds |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
550 |
// Returns threshold scaled with CompileThresholdScaling |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
551 |
static intx scaled_compile_threshold(intx threshold, double scale); |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
552 |
static intx scaled_compile_threshold(intx threshold) { |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
553 |
return scaled_compile_threshold(threshold, CompileThresholdScaling); |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
554 |
} |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
555 |
// Returns freq_log scaled with CompileThresholdScaling |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
556 |
static intx scaled_freq_log(intx freq_log, double scale); |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
557 |
static intx scaled_freq_log(intx freq_log) { |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
558 |
return scaled_freq_log(freq_log, CompileThresholdScaling); |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
559 |
} |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
560 |
|
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
561 |
// Parses the arguments, first phase |
1 | 562 |
static jint parse(const JavaVMInitArgs* args); |
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
563 |
// Apply ergonomics |
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
564 |
static jint apply_ergo(); |
14580
3e2316663327
7198334: UseNUMA modifies system parameters on non-NUMA system
brutisso
parents:
13963
diff
changeset
|
565 |
// Adjusts the arguments after the OS have adjusted the arguments |
3e2316663327
7198334: UseNUMA modifies system parameters on non-NUMA system
brutisso
parents:
13963
diff
changeset
|
566 |
static jint adjust_after_os(); |
22555
ea32f6c51d08
8028391: Make the Min/MaxHeapFreeRatio flags manageable
jwilhelm
parents:
22551
diff
changeset
|
567 |
|
27892
06a143c836ad
8065305: Make it possible to extend the G1CollectorPolicy
jwilhelm
parents:
27148
diff
changeset
|
568 |
static void set_gc_specific_flags(); |
37199
74703ea13069
8068579: Running with -XX:-UseParallelGC does not turn ParalleGC off
pliden
parents:
37179
diff
changeset
|
569 |
static bool gc_selected(); // whether a gc has been selected |
26836
b27ec66071c7
8057531: refactor gc argument processing code slightly
jcoomes
parents:
26824
diff
changeset
|
570 |
static void select_gc_ergonomically(); |
36313
e7eff81d7f1d
8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents:
35872
diff
changeset
|
571 |
#if INCLUDE_JVMCI |
e7eff81d7f1d
8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents:
35872
diff
changeset
|
572 |
// Check consistency of jvmci vm argument settings. |
e7eff81d7f1d
8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents:
35872
diff
changeset
|
573 |
static bool check_jvmci_args_consistency(); |
e7eff81d7f1d
8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents:
35872
diff
changeset
|
574 |
#endif |
183
ba55c7f3fd45
6362677: Change parallel GC collector default number of parallel GC threads.
jmasa
parents:
1
diff
changeset
|
575 |
// Check for consistency in the selection of the garbage collector. |
29696
01571dfab5be
8073944: Simplify ArgumentsExt and remove unneeded functionallity
sjohanss
parents:
29076
diff
changeset
|
576 |
static bool check_gc_consistency(); // Check user-selected gc |
22551 | 577 |
// Check consistency or otherwise of VM argument settings |
1 | 578 |
static bool check_vm_args_consistency(); |
579 |
// Used by os_solaris |
|
580 |
static bool process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized); |
|
581 |
||
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
582 |
static size_t conservative_max_heap_alignment() { return _conservative_max_heap_alignment; } |
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
583 |
// Return the maximum size a heap with compressed oops can take |
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
584 |
static size_t max_heap_for_compressed_oops(); |
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
585 |
|
1 | 586 |
// return a char* array containing all options |
587 |
static char** jvm_flags_array() { return _jvm_flags_array; } |
|
588 |
static char** jvm_args_array() { return _jvm_args_array; } |
|
589 |
static int num_jvm_flags() { return _num_jvm_flags; } |
|
590 |
static int num_jvm_args() { return _num_jvm_args; } |
|
591 |
// return the arguments passed to the Java application |
|
592 |
static const char* java_command() { return _java_command; } |
|
593 |
||
594 |
// print jvm_flags, jvm_args and java_command |
|
595 |
static void print_on(outputStream* st); |
|
31963
641ed52732ec
8026324: hs_err improvement: Add summary section to hs_err file
coleenp
parents:
31853
diff
changeset
|
596 |
static void print_summary_on(outputStream* st); |
1 | 597 |
|
34125
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
598 |
// convenient methods to get and set jvm_flags_file |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
599 |
static const char* get_jvm_flags_file() { return _jvm_flags_file; } |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
600 |
static void set_jvm_flags_file(const char *value) { |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
601 |
if (_jvm_flags_file != NULL) { |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
602 |
os::free(_jvm_flags_file); |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
603 |
} |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
604 |
_jvm_flags_file = os::strdup_check_oom(value); |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
605 |
} |
1 | 606 |
// convenient methods to obtain / print jvm_flags and jvm_args |
607 |
static const char* jvm_flags() { return build_resource_string(_jvm_flags_array, _num_jvm_flags); } |
|
608 |
static const char* jvm_args() { return build_resource_string(_jvm_args_array, _num_jvm_args); } |
|
609 |
static void print_jvm_flags_on(outputStream* st); |
|
610 |
static void print_jvm_args_on(outputStream* st); |
|
611 |
||
612 |
// -Dkey=value flags |
|
613 |
static SystemProperty* system_properties() { return _system_properties; } |
|
614 |
static const char* get_property(const char* key); |
|
615 |
||
616 |
// -Djava.vendor.url.bug |
|
617 |
static const char* java_vendor_url_bug() { return _java_vendor_url_bug; } |
|
618 |
||
619 |
// -Dsun.java.launcher |
|
620 |
static const char* sun_java_launcher() { return _sun_java_launcher; } |
|
621 |
// Was VM created by a Java launcher? |
|
622 |
static bool created_by_java_launcher(); |
|
22734
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
20288
diff
changeset
|
623 |
// -Dsun.java.launcher.is_altjvm |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
20288
diff
changeset
|
624 |
static bool sun_java_launcher_is_altjvm(); |
1 | 625 |
// -Dsun.java.launcher.pid |
626 |
static int sun_java_launcher_pid() { return _sun_java_launcher_pid; } |
|
627 |
||
18687
5a0543c157c9
7133260: AllocationProfiler uses space in metadata and doesn't seem to do anything useful.
jiangli
parents:
18090
diff
changeset
|
628 |
// -Xprof |
1 | 629 |
static bool has_profile() { return _has_profile; } |
630 |
||
22551 | 631 |
// -Xms |
29697
92501504191b
8074459: Flags handling memory sizes should be of type size_t
jwilhelm
parents:
29696
diff
changeset
|
632 |
static size_t min_heap_size() { return _min_heap_size; } |
92501504191b
8074459: Flags handling memory sizes should be of type size_t
jwilhelm
parents:
29696
diff
changeset
|
633 |
static void set_min_heap_size(size_t v) { _min_heap_size = v; } |
1 | 634 |
|
36508 | 635 |
// -Xbootclasspath/a |
636 |
static int bootclassloader_append_index() { |
|
637 |
return _bootclassloader_append_index; |
|
638 |
} |
|
639 |
static void set_bootclassloader_append_index(int value) { |
|
640 |
_bootclassloader_append_index = value; |
|
641 |
} |
|
642 |
||
643 |
// -Xpatch |
|
644 |
static char** patch_dirs() { return _patch_dirs; } |
|
645 |
static int patch_dirs_count() { return _patch_dirs_count; } |
|
646 |
||
1 | 647 |
// -Xrun |
648 |
static AgentLibrary* libraries() { return _libraryList.first(); } |
|
649 |
static bool init_libraries_at_startup() { return !_libraryList.is_empty(); } |
|
650 |
static void convert_library_to_agent(AgentLibrary* lib) |
|
651 |
{ _libraryList.remove(lib); |
|
652 |
_agentList.add(lib); } |
|
653 |
||
654 |
// -agentlib -agentpath |
|
655 |
static AgentLibrary* agents() { return _agentList.first(); } |
|
656 |
static bool init_agents_at_startup() { return !_agentList.is_empty(); } |
|
657 |
||
658 |
// abort, exit, vfprintf hooks |
|
659 |
static abort_hook_t abort_hook() { return _abort_hook; } |
|
660 |
static exit_hook_t exit_hook() { return _exit_hook; } |
|
661 |
static vfprintf_hook_t vfprintf_hook() { return _vfprintf_hook; } |
|
662 |
||
663 |
static bool GetCheckCompileOnly () { return CheckCompileOnly; } |
|
664 |
||
665 |
static const char* GetSharedArchivePath() { return SharedArchivePath; } |
|
666 |
||
667 |
static bool CompileMethod(char* className, char* methodName) { |
|
668 |
return |
|
669 |
methodExists( |
|
670 |
className, methodName, |
|
671 |
CompileOnlyClassesNum, CompileOnlyClasses, CompileOnlyAllMethods, |
|
672 |
CompileOnlyMethodsNum, CompileOnlyMethods, CompileOnlyAllClasses |
|
673 |
); |
|
674 |
} |
|
675 |
||
676 |
// Java launcher properties |
|
677 |
static void process_sun_java_launcher_properties(JavaVMInitArgs* args); |
|
678 |
||
679 |
// System properties |
|
680 |
static void init_system_properties(); |
|
681 |
||
6961
a32b2fc66321
6988363: Rebrand vm vendor property settings (jdk7 only)
zgu
parents:
6453
diff
changeset
|
682 |
// Update/Initialize System properties after JDK version number is known |
a32b2fc66321
6988363: Rebrand vm vendor property settings (jdk7 only)
zgu
parents:
6453
diff
changeset
|
683 |
static void init_version_specific_system_properties(); |
a32b2fc66321
6988363: Rebrand vm vendor property settings (jdk7 only)
zgu
parents:
6453
diff
changeset
|
684 |
|
2358 | 685 |
// Property List manipulation |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
27926
diff
changeset
|
686 |
static void PropertyList_add(SystemProperty *element); |
1 | 687 |
static void PropertyList_add(SystemProperty** plist, SystemProperty *element); |
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
688 |
static void PropertyList_add(SystemProperty** plist, const char* k, const char* v); |
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
689 |
static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v) { |
2358 | 690 |
PropertyList_unique_add(plist, k, v, false); |
691 |
} |
|
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
692 |
static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v, jboolean append); |
1 | 693 |
static const char* PropertyList_get_value(SystemProperty* plist, const char* key); |
694 |
static int PropertyList_count(SystemProperty* pl); |
|
695 |
static const char* PropertyList_get_key_at(SystemProperty* pl,int index); |
|
696 |
static char* PropertyList_get_value_at(SystemProperty* pl,int index); |
|
697 |
||
698 |
// Miscellaneous System property value getter and setters. |
|
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
699 |
static void set_dll_dir(const char *value) { _sun_boot_library_path->set_value(value); } |
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
700 |
static void set_java_home(const char *value) { _java_home->set_value(value); } |
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
701 |
static void set_library_path(const char *value) { _java_library_path->set_value(value); } |
27562 | 702 |
static void set_ext_dirs(char *value) { _ext_dirs = os::strdup_check_oom(value); } |
36508 | 703 |
|
704 |
// Set up of the underlying system boot class path |
|
705 |
static void set_jdkbootclasspath_append(); |
|
706 |
static void set_sysclasspath(const char *value) { |
|
707 |
_system_boot_class_path->set_value(value); |
|
708 |
set_jdkbootclasspath_append(); |
|
709 |
} |
|
710 |
static void append_sysclasspath(const char *value) { |
|
711 |
_system_boot_class_path->append_value(value); |
|
712 |
set_jdkbootclasspath_append(); |
|
713 |
} |
|
1 | 714 |
|
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25468
diff
changeset
|
715 |
static char* get_java_home() { return _java_home->value(); } |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25468
diff
changeset
|
716 |
static char* get_dll_dir() { return _sun_boot_library_path->value(); } |
36508 | 717 |
static char* get_sysclasspath() { return _system_boot_class_path->value(); } |
27562 | 718 |
static char* get_ext_dirs() { return _ext_dirs; } |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25468
diff
changeset
|
719 |
static char* get_appclasspath() { return _java_class_path->value(); } |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25468
diff
changeset
|
720 |
static void fix_appclasspath(); |
1 | 721 |
|
27562 | 722 |
|
1 | 723 |
// Operation modi |
36508 | 724 |
static Mode mode() { return _mode; } |
26585
2048b8d90c91
8058092: Test vm/mlvm/meth/stress/compiler/deoptimize. Assert in src/share/vm/classfile/systemDictionary.cpp: MH intrinsic invariant
iveresov
parents:
26135
diff
changeset
|
725 |
static bool is_interpreter_only() { return mode() == _int; } |
2048b8d90c91
8058092: Test vm/mlvm/meth/stress/compiler/deoptimize. Assert in src/share/vm/classfile/systemDictionary.cpp: MH intrinsic invariant
iveresov
parents:
26135
diff
changeset
|
726 |
|
1 | 727 |
|
728 |
// Utility: copies src into buf, replacing "%%" with "%" and "%p" with pid. |
|
729 |
static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen); |
|
36508 | 730 |
|
731 |
static void check_unsupported_dumping_properties() NOT_CDS_RETURN; |
|
1 | 732 |
}; |
7397 | 733 |
|
28838
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
734 |
// Disable options not supported in this release, with a warning if they |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
735 |
// were explicitly requested on the command-line |
37253
45e69c7b0bac
8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents:
37216
diff
changeset
|
736 |
#define UNSUPPORTED_OPTION(opt) \ |
45e69c7b0bac
8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents:
37216
diff
changeset
|
737 |
do { \ |
45e69c7b0bac
8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents:
37216
diff
changeset
|
738 |
if (opt) { \ |
45e69c7b0bac
8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents:
37216
diff
changeset
|
739 |
if (FLAG_IS_CMDLINE(opt)) { \ |
45e69c7b0bac
8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents:
37216
diff
changeset
|
740 |
warning("-XX:+" #opt " not supported in this VM"); \ |
45e69c7b0bac
8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents:
37216
diff
changeset
|
741 |
} \ |
45e69c7b0bac
8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents:
37216
diff
changeset
|
742 |
FLAG_SET_DEFAULT(opt, false); \ |
45e69c7b0bac
8152929: Remove UNSUPPORTED_GC_OPTION, use UNSUPPORTED_OPTION instead
pliden
parents:
37216
diff
changeset
|
743 |
} \ |
28838
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
744 |
} while(0) |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
745 |
|
7397 | 746 |
#endif // SHARE_VM_RUNTIME_ARGUMENTS_HPP |