author | ddmitriev |
Fri, 11 Mar 2016 15:34:48 +0300 | |
changeset 37075 | 65bfef79cfb9 |
parent 36313 | e7eff81d7f1d |
child 37094 | c12f414936a1 |
child 36508 | 5f9eee6b383b |
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 |
#include "utilities/top.hpp" |
35 |
||
1 | 36 |
// Arguments parses the command line and recognizes options |
37 |
||
38 |
// Invocation API hook typedefs (these should really be defined in jni.hpp) |
|
39 |
extern "C" { |
|
40 |
typedef void (JNICALL *abort_hook_t)(void); |
|
41 |
typedef void (JNICALL *exit_hook_t)(jint code); |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
22735
diff
changeset
|
42 |
typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args) ATTRIBUTE_PRINTF(2, 0); |
1 | 43 |
} |
44 |
||
45 |
// Forward declarations |
|
46 |
||
47 |
class SysClassPath; |
|
48 |
||
49 |
// Element describing System and User (-Dkey=value flags) defined property. |
|
50 |
||
13195 | 51 |
class SystemProperty: public CHeapObj<mtInternal> { |
1 | 52 |
private: |
53 |
char* _key; |
|
54 |
char* _value; |
|
55 |
SystemProperty* _next; |
|
56 |
bool _writeable; |
|
57 |
bool writeable() { return _writeable; } |
|
58 |
||
59 |
public: |
|
60 |
// Accessors |
|
61 |
const char* key() const { return _key; } |
|
62 |
char* value() const { return _value; } |
|
63 |
SystemProperty* next() const { return _next; } |
|
64 |
void set_next(SystemProperty* next) { _next = next; } |
|
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
65 |
bool set_value(const char *value) { |
1 | 66 |
if (writeable()) { |
67 |
if (_value != NULL) { |
|
68 |
FreeHeap(_value); |
|
69 |
} |
|
13195 | 70 |
_value = AllocateHeap(strlen(value)+1, mtInternal); |
1 | 71 |
if (_value != NULL) { |
72 |
strcpy(_value, value); |
|
73 |
} |
|
74 |
return true; |
|
75 |
} |
|
76 |
return false; |
|
77 |
} |
|
78 |
||
79 |
void append_value(const char *value) { |
|
80 |
char *sp; |
|
81 |
size_t len = 0; |
|
82 |
if (value != NULL) { |
|
83 |
len = strlen(value); |
|
84 |
if (_value != NULL) { |
|
85 |
len += strlen(_value); |
|
86 |
} |
|
13195 | 87 |
sp = AllocateHeap(len+2, mtInternal); |
1 | 88 |
if (sp != NULL) { |
89 |
if (_value != NULL) { |
|
90 |
strcpy(sp, _value); |
|
91 |
strcat(sp, os::path_separator()); |
|
92 |
strcat(sp, value); |
|
93 |
FreeHeap(_value); |
|
94 |
} else { |
|
95 |
strcpy(sp, value); |
|
96 |
} |
|
97 |
_value = sp; |
|
98 |
} |
|
99 |
} |
|
100 |
} |
|
101 |
||
102 |
// Constructor |
|
103 |
SystemProperty(const char* key, const char* value, bool writeable) { |
|
104 |
if (key == NULL) { |
|
105 |
_key = NULL; |
|
106 |
} else { |
|
13195 | 107 |
_key = AllocateHeap(strlen(key)+1, mtInternal); |
1 | 108 |
strcpy(_key, key); |
109 |
} |
|
110 |
if (value == NULL) { |
|
111 |
_value = NULL; |
|
112 |
} else { |
|
13195 | 113 |
_value = AllocateHeap(strlen(value)+1, mtInternal); |
1 | 114 |
strcpy(_value, value); |
115 |
} |
|
116 |
_next = NULL; |
|
117 |
_writeable = writeable; |
|
118 |
} |
|
119 |
}; |
|
120 |
||
121 |
||
122 |
// For use by -agentlib, -agentpath and -Xrun |
|
13195 | 123 |
class AgentLibrary : public CHeapObj<mtInternal> { |
1 | 124 |
friend class AgentLibraryList; |
19553
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
125 |
public: |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
126 |
// 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
|
127 |
// 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
|
128 |
enum AgentState { |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
129 |
agent_invalid = 0, |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
130 |
agent_valid = 1 |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
131 |
}; |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
132 |
|
1 | 133 |
private: |
134 |
char* _name; |
|
135 |
char* _options; |
|
136 |
void* _os_lib; |
|
137 |
bool _is_absolute_path; |
|
19553
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
138 |
bool _is_static_lib; |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
139 |
AgentState _state; |
1 | 140 |
AgentLibrary* _next; |
141 |
||
142 |
public: |
|
143 |
// Accessors |
|
144 |
const char* name() const { return _name; } |
|
145 |
char* options() const { return _options; } |
|
146 |
bool is_absolute_path() const { return _is_absolute_path; } |
|
147 |
void* os_lib() const { return _os_lib; } |
|
148 |
void set_os_lib(void* os_lib) { _os_lib = os_lib; } |
|
149 |
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
|
150 |
bool is_static_lib() const { return _is_static_lib; } |
19973 | 151 |
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
|
152 |
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
|
153 |
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
|
154 |
void set_invalid() { _state = agent_invalid; } |
1 | 155 |
|
156 |
// Constructor |
|
157 |
AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) { |
|
13195 | 158 |
_name = AllocateHeap(strlen(name)+1, mtInternal); |
1 | 159 |
strcpy(_name, name); |
160 |
if (options == NULL) { |
|
161 |
_options = NULL; |
|
162 |
} else { |
|
13195 | 163 |
_options = AllocateHeap(strlen(options)+1, mtInternal); |
1 | 164 |
strcpy(_options, options); |
165 |
} |
|
166 |
_is_absolute_path = is_absolute_path; |
|
167 |
_os_lib = os_lib; |
|
168 |
_next = NULL; |
|
19553
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
169 |
_state = agent_invalid; |
9bbd930be684
8014135: The JVMTI specification does not conform to recent changes in JNI specification
bpittore
parents:
19319
diff
changeset
|
170 |
_is_static_lib = false; |
1 | 171 |
} |
172 |
}; |
|
173 |
||
174 |
// maintain an order of entry list of AgentLibrary |
|
175 |
class AgentLibraryList VALUE_OBJ_CLASS_SPEC { |
|
176 |
private: |
|
177 |
AgentLibrary* _first; |
|
178 |
AgentLibrary* _last; |
|
179 |
public: |
|
180 |
bool is_empty() const { return _first == NULL; } |
|
181 |
AgentLibrary* first() const { return _first; } |
|
182 |
||
183 |
// add to the end of the list |
|
184 |
void add(AgentLibrary* lib) { |
|
185 |
if (is_empty()) { |
|
186 |
_first = _last = lib; |
|
187 |
} else { |
|
188 |
_last->_next = lib; |
|
189 |
_last = lib; |
|
190 |
} |
|
191 |
lib->_next = NULL; |
|
192 |
} |
|
193 |
||
194 |
// search for and remove a library known to be in the list |
|
195 |
void remove(AgentLibrary* lib) { |
|
196 |
AgentLibrary* curr; |
|
197 |
AgentLibrary* prev = NULL; |
|
198 |
for (curr = first(); curr != NULL; prev = curr, curr = curr->next()) { |
|
199 |
if (curr == lib) { |
|
200 |
break; |
|
201 |
} |
|
202 |
} |
|
203 |
assert(curr != NULL, "always should be found"); |
|
204 |
||
205 |
if (curr != NULL) { |
|
206 |
// it was found, by-pass this library |
|
207 |
if (prev == NULL) { |
|
208 |
_first = curr->_next; |
|
209 |
} else { |
|
210 |
prev->_next = curr->_next; |
|
211 |
} |
|
212 |
if (curr == _last) { |
|
213 |
_last = prev; |
|
214 |
} |
|
215 |
curr->_next = NULL; |
|
216 |
} |
|
217 |
} |
|
218 |
||
219 |
AgentLibraryList() { |
|
220 |
_first = NULL; |
|
221 |
_last = NULL; |
|
222 |
} |
|
223 |
}; |
|
224 |
||
31853
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
225 |
// 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
|
226 |
class ScopedVMInitArgs; |
1 | 227 |
|
35489 | 228 |
// Most logging functions require 5 tags. Some of them may be _NO_TAG. |
229 |
typedef struct { |
|
230 |
const char* alias_name; |
|
231 |
LogLevelType level; |
|
232 |
bool exactMatch; |
|
233 |
LogTagType tag; |
|
234 |
} AliasedLoggingFlag; |
|
235 |
||
1 | 236 |
class Arguments : AllStatic { |
237 |
friend class VMStructs; |
|
238 |
friend class JvmtiExport; |
|
31620
53be635ad49c
8087333: Optionally Pre-Generate the HotSpot Template Interpreter
bdelsart
parents:
31608
diff
changeset
|
239 |
friend class CodeCacheExtensions; |
1 | 240 |
public: |
241 |
// Operation modi |
|
242 |
enum Mode { |
|
243 |
_int, // corresponds to -Xint |
|
244 |
_mixed, // corresponds to -Xmixed |
|
245 |
_comp // corresponds to -Xcomp |
|
246 |
}; |
|
247 |
||
248 |
enum ArgsRange { |
|
249 |
arg_unreadable = -3, |
|
250 |
arg_too_small = -2, |
|
251 |
arg_too_big = -1, |
|
252 |
arg_in_range = 0 |
|
253 |
}; |
|
254 |
||
255 |
private: |
|
256 |
||
34125
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
257 |
// 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
|
258 |
static char* _jvm_flags_file; |
1 | 259 |
// an array containing all flags specified in the .hotspotrc file |
260 |
static char** _jvm_flags_array; |
|
261 |
static int _num_jvm_flags; |
|
262 |
// an array containing all jvm arguments specified in the command line |
|
263 |
static char** _jvm_args_array; |
|
264 |
static int _num_jvm_args; |
|
265 |
// string containing all java command (class/jarfile name and app args) |
|
266 |
static char* _java_command; |
|
267 |
||
268 |
// Property list |
|
269 |
static SystemProperty* _system_properties; |
|
270 |
||
271 |
// Quick accessor to System properties in the list: |
|
272 |
static SystemProperty *_sun_boot_library_path; |
|
273 |
static SystemProperty *_java_library_path; |
|
274 |
static SystemProperty *_java_home; |
|
275 |
static SystemProperty *_java_class_path; |
|
276 |
static SystemProperty *_sun_boot_class_path; |
|
277 |
||
27562 | 278 |
// temporary: to emit warning if the default ext dirs are not empty. |
279 |
// remove this variable when the warning is no longer needed. |
|
280 |
static char* _ext_dirs; |
|
281 |
||
1 | 282 |
// java.vendor.url.bug, bug reporting URL for fatal errors. |
283 |
static const char* _java_vendor_url_bug; |
|
284 |
||
285 |
// 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
|
286 |
// java launcher |
1 | 287 |
static const char* _sun_java_launcher; |
288 |
||
289 |
// sun.java.launcher.pid, private property |
|
290 |
static int _sun_java_launcher_pid; |
|
291 |
||
22734
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
20288
diff
changeset
|
292 |
// 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
|
293 |
static bool _sun_java_launcher_is_altjvm; |
8476
7e34c2d4cf9b
7022037: Pause when exiting if debugger is attached on windows
sla
parents:
7397
diff
changeset
|
294 |
|
1 | 295 |
// Option flags |
296 |
static bool _has_profile; |
|
35872
7fb1e4de83ff
8145180: Add back PrintGC, PrintGCDetails and -Xloggc
brutisso
parents:
35489
diff
changeset
|
297 |
static const char* _gc_log_filename; |
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
298 |
// 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
|
299 |
static size_t _conservative_max_heap_alignment; |
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
300 |
|
26824
a04a1291103f
8055006: Store original value of Min/MaxHeapFreeRatio
jwilhelm
parents:
26585
diff
changeset
|
301 |
static uintx _min_heap_size; |
a04a1291103f
8055006: Store original value of Min/MaxHeapFreeRatio
jwilhelm
parents:
26585
diff
changeset
|
302 |
|
1 | 303 |
// -Xrun arguments |
304 |
static AgentLibraryList _libraryList; |
|
305 |
static void add_init_library(const char* name, char* options) |
|
306 |
{ _libraryList.add(new AgentLibrary(name, options, false, NULL)); } |
|
307 |
||
308 |
// -agentlib and -agentpath arguments |
|
309 |
static AgentLibraryList _agentList; |
|
310 |
static void add_init_agent(const char* name, char* options, bool absolute_path) |
|
311 |
{ _agentList.add(new AgentLibrary(name, options, absolute_path, NULL)); } |
|
312 |
||
313 |
// 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
|
314 |
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
|
315 |
{ _agentList.add(agentLib); } |
1 | 316 |
static void add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib) |
317 |
{ _agentList.add(new AgentLibrary(name, options, absolute_path, os_lib)); } |
|
318 |
||
319 |
// Operation modi |
|
320 |
static Mode _mode; |
|
321 |
static void set_mode_flags(Mode mode); |
|
322 |
static bool _java_compiler; |
|
323 |
static void set_java_compiler(bool arg) { _java_compiler = arg; } |
|
324 |
static bool java_compiler() { return _java_compiler; } |
|
325 |
||
326 |
// -Xdebug flag |
|
327 |
static bool _xdebug_mode; |
|
328 |
static void set_xdebug_mode(bool arg) { _xdebug_mode = arg; } |
|
329 |
static bool xdebug_mode() { return _xdebug_mode; } |
|
330 |
||
331 |
// Used to save default settings |
|
332 |
static bool _AlwaysCompileLoopMethods; |
|
333 |
static bool _UseOnStackReplacement; |
|
334 |
static bool _BackgroundCompilation; |
|
335 |
static bool _ClipInlining; |
|
336 |
static bool _CIDynamicCompilePriority; |
|
30201
cfe623bb3f9c
8075663: compiler/rangechecks/TestExplicitRangeChecks.java fails in compiler nightlies
roland
parents:
29697
diff
changeset
|
337 |
static intx _Tier3InvokeNotifyFreqLog; |
cfe623bb3f9c
8075663: compiler/rangechecks/TestExplicitRangeChecks.java fails in compiler nightlies
roland
parents:
29697
diff
changeset
|
338 |
static intx _Tier4InvocationThreshold; |
1 | 339 |
|
6453 | 340 |
// Tiered |
341 |
static void set_tiered_flags(); |
|
1 | 342 |
// CMS/ParNew garbage collectors |
343 |
static void set_parnew_gc_flags(); |
|
344 |
static void set_cms_and_parnew_gc_flags(); |
|
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
183
diff
changeset
|
345 |
// UseParallel[Old]GC |
1 | 346 |
static void set_parallel_gc_flags(); |
1374
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
183
diff
changeset
|
347 |
// Garbage-First (UseG1GC) |
4c24294029a9
6711316: Open source the Garbage-First garbage collector
ysr
parents:
183
diff
changeset
|
348 |
static void set_g1_gc_flags(); |
1 | 349 |
// GC ergonomics |
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
350 |
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
|
351 |
static void set_use_compressed_oops(); |
19319
0ad35be0733a
8003424: Enable Class Data Sharing for CompressedOops
hseigel
parents:
18687
diff
changeset
|
352 |
static void set_use_compressed_klass_ptrs(); |
26836
b27ec66071c7
8057531: refactor gc argument processing code slightly
jcoomes
parents:
26824
diff
changeset
|
353 |
static void select_gc(); |
1 | 354 |
static void set_ergonomics_flags(); |
8681
c691d94813f9
7018056: large pages not always enabled by default
jcoomes
parents:
8476
diff
changeset
|
355 |
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
|
356 |
// 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
|
357 |
// 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
|
358 |
static julong limit_by_allocatable_memory(julong size); |
4434 | 359 |
// Setup heap size |
360 |
static void set_heap_size(); |
|
1 | 361 |
// Based on automatic selection criteria, should the |
362 |
// low pause collector be used. |
|
363 |
static bool should_auto_select_low_pause_collector(); |
|
364 |
||
365 |
// Bytecode rewriting |
|
366 |
static void set_bytecode_flags(); |
|
367 |
||
368 |
// Invocation API hooks |
|
369 |
static abort_hook_t _abort_hook; |
|
370 |
static exit_hook_t _exit_hook; |
|
371 |
static vfprintf_hook_t _vfprintf_hook; |
|
372 |
||
373 |
// System properties |
|
374 |
static bool add_property(const char* prop); |
|
375 |
||
376 |
// Aggressive optimization flags. |
|
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
377 |
static jint set_aggressive_opts_flags(); |
1 | 378 |
|
32823
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
379 |
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
|
380 |
|
1 | 381 |
// Argument parsing |
382 |
static void do_pd_flag_adjustments(); |
|
20288
e2d549f40de9
8024545: make develop and notproduct flag values available in product builds
twisti
parents:
20006
diff
changeset
|
383 |
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
|
384 |
static bool process_argument(const char* arg, jboolean ignore_unrecognized, Flag::Flags origin); |
1 | 385 |
static void process_java_launcher_argument(const char*, void*); |
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
386 |
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
|
387 |
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
|
388 |
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
|
389 |
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
|
390 |
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
|
391 |
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
|
392 |
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
|
393 |
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
|
394 |
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
|
395 |
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
|
396 |
ScopedVMInitArgs* args_out); |
35466
4ace9ef0201b
8135198: Add -XX:VMOptionsFile support to JAVA_TOOL_OPTIONS and _JAVA_OPTIONS
rdurbin
parents:
35171
diff
changeset
|
397 |
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
|
398 |
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
|
399 |
ScopedVMInitArgs* mod_args, |
4ace9ef0201b
8135198: Add -XX:VMOptionsFile support to JAVA_TOOL_OPTIONS and _JAVA_OPTIONS
rdurbin
parents:
35171
diff
changeset
|
400 |
JavaVMInitArgs** args_out); |
32621
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
401 |
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
|
402 |
ScopedVMInitArgs* args_out); |
cdab920f3b6c
8061999: Enhance VM option parsing to allow options to be specified in a file
rdurbin
parents:
32619
diff
changeset
|
403 |
|
35872
7fb1e4de83ff
8145180: Add back PrintGC, PrintGCDetails and -Xloggc
brutisso
parents:
35489
diff
changeset
|
404 |
static bool handle_deprecated_print_gc_flags(); |
7fb1e4de83ff
8145180: Add back PrintGC, PrintGCDetails and -Xloggc
brutisso
parents:
35489
diff
changeset
|
405 |
|
31853
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
406 |
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
|
407 |
const JavaVMInitArgs *java_options_args, |
c70929a2573c
8079301: Some command line options not settable via JAVA_TOOL_OPTIONS
jmanson
parents:
31620
diff
changeset
|
408 |
const JavaVMInitArgs *cmd_line_args); |
20288
e2d549f40de9
8024545: make develop and notproduct flag values available in product builds
twisti
parents:
20006
diff
changeset
|
409 |
static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin); |
1 | 410 |
static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required); |
22555
ea32f6c51d08
8028391: Make the Min/MaxHeapFreeRatio flags manageable
jwilhelm
parents:
22551
diff
changeset
|
411 |
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
|
412 |
|
1 | 413 |
static bool is_bad_option(const JavaVMOption* option, jboolean ignore) { |
414 |
return is_bad_option(option, ignore, NULL); |
|
415 |
} |
|
22555
ea32f6c51d08
8028391: Make the Min/MaxHeapFreeRatio flags manageable
jwilhelm
parents:
22551
diff
changeset
|
416 |
|
1 | 417 |
static void describe_range_error(ArgsRange errcode); |
1676
d80e69372634
6653214: MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes.
swamyv
parents:
1388
diff
changeset
|
418 |
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
|
419 |
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
|
420 |
julong min_size); |
5035 | 421 |
// Parse a string for a unsigned integer. Returns true if value |
422 |
// is an unsigned integer greater than or equal to the minimum |
|
423 |
// parameter passed and returns the value in uintx_arg. Returns |
|
424 |
// false otherwise, with uintx_arg undefined. |
|
425 |
static bool parse_uintx(const char* value, uintx* uintx_arg, |
|
426 |
uintx min_size); |
|
1 | 427 |
|
428 |
// methods to build strings from individual args |
|
429 |
static void build_jvm_args(const char* arg); |
|
430 |
static void build_jvm_flags(const char* arg); |
|
431 |
static void add_string(char*** bldarray, int* count, const char* arg); |
|
432 |
static const char* build_resource_string(char** args, int count); |
|
433 |
||
434 |
static bool methodExists( |
|
435 |
char* className, char* methodName, |
|
436 |
int classesNum, char** classes, bool* allMethods, |
|
437 |
int methodsNum, char** methods, bool* allClasses |
|
438 |
); |
|
439 |
||
440 |
static void parseOnlyLine( |
|
441 |
const char* line, |
|
442 |
short* classesNum, short* classesMax, char*** classes, bool** allMethods, |
|
443 |
short* methodsNum, short* methodsMax, char*** methods, bool** allClasses |
|
444 |
); |
|
445 |
||
32823
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
446 |
// 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
|
447 |
// 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
|
448 |
// 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
|
449 |
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
|
450 |
|
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
451 |
// 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
|
452 |
// 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
|
453 |
// the flag became deprecated. |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
454 |
// 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
|
455 |
// Returns 0 otherwise. |
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
456 |
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
|
457 |
|
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
458 |
// 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
|
459 |
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
|
460 |
|
ca8fef4cd57b
8066821: Enhance command line processing to manage deprecating and obsoleting -XX command line arguments
drwhite
parents:
32621
diff
changeset
|
461 |
// 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
|
462 |
// 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
|
463 |
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
|
464 |
static bool lookup_logging_aliases(const char* arg, char* buffer); |
35489 | 465 |
static AliasedLoggingFlag catch_logging_aliases(const char* name); |
1 | 466 |
static short CompileOnlyClassesNum; |
467 |
static short CompileOnlyClassesMax; |
|
468 |
static char** CompileOnlyClasses; |
|
469 |
static bool* CompileOnlyAllMethods; |
|
470 |
||
471 |
static short CompileOnlyMethodsNum; |
|
472 |
static short CompileOnlyMethodsMax; |
|
473 |
static char** CompileOnlyMethods; |
|
474 |
static bool* CompileOnlyAllClasses; |
|
475 |
||
476 |
static short InterpretOnlyClassesNum; |
|
477 |
static short InterpretOnlyClassesMax; |
|
478 |
static char** InterpretOnlyClasses; |
|
479 |
static bool* InterpretOnlyAllMethods; |
|
480 |
||
481 |
static bool CheckCompileOnly; |
|
482 |
||
483 |
static char* SharedArchivePath; |
|
484 |
||
485 |
public: |
|
28650
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
486 |
// Scale compile thresholds |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
487 |
// Returns threshold scaled with CompileThresholdScaling |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
488 |
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
|
489 |
static intx scaled_compile_threshold(intx threshold) { |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
490 |
return scaled_compile_threshold(threshold, CompileThresholdScaling); |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
491 |
} |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
492 |
// Returns freq_log scaled with CompileThresholdScaling |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
493 |
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
|
494 |
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
|
495 |
return scaled_freq_log(freq_log, CompileThresholdScaling); |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
496 |
} |
772aaab2582f
8059606: Enable per-method usage of CompileThresholdScaling (per-method compilation thresholds)
zmajo
parents:
28372
diff
changeset
|
497 |
|
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
498 |
// Parses the arguments, first phase |
1 | 499 |
static jint parse(const JavaVMInitArgs* args); |
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
500 |
// Apply ergonomics |
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
501 |
static jint apply_ergo(); |
14580
3e2316663327
7198334: UseNUMA modifies system parameters on non-NUMA system
brutisso
parents:
13963
diff
changeset
|
502 |
// 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
|
503 |
static jint adjust_after_os(); |
22555
ea32f6c51d08
8028391: Make the Min/MaxHeapFreeRatio flags manageable
jwilhelm
parents:
22551
diff
changeset
|
504 |
|
27892
06a143c836ad
8065305: Make it possible to extend the G1CollectorPolicy
jwilhelm
parents:
27148
diff
changeset
|
505 |
static void set_gc_specific_flags(); |
26836
b27ec66071c7
8057531: refactor gc argument processing code slightly
jcoomes
parents:
26824
diff
changeset
|
506 |
static inline bool gc_selected(); // whether a gc has been selected |
b27ec66071c7
8057531: refactor gc argument processing code slightly
jcoomes
parents:
26824
diff
changeset
|
507 |
static void select_gc_ergonomically(); |
36313
e7eff81d7f1d
8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents:
35872
diff
changeset
|
508 |
#if INCLUDE_JVMCI |
e7eff81d7f1d
8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents:
35872
diff
changeset
|
509 |
// Check consistency of jvmci vm argument settings. |
e7eff81d7f1d
8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents:
35872
diff
changeset
|
510 |
static bool check_jvmci_args_consistency(); |
e7eff81d7f1d
8145333: -XX:+EnableJVMCI -XX:+UseJVMCICompiler -XX:-EnableJVMCI makes JVM crash
jcm
parents:
35872
diff
changeset
|
511 |
#endif |
183
ba55c7f3fd45
6362677: Change parallel GC collector default number of parallel GC threads.
jmasa
parents:
1
diff
changeset
|
512 |
// Check for consistency in the selection of the garbage collector. |
29696
01571dfab5be
8073944: Simplify ArgumentsExt and remove unneeded functionallity
sjohanss
parents:
29076
diff
changeset
|
513 |
static bool check_gc_consistency(); // Check user-selected gc |
22551 | 514 |
// Check consistency or otherwise of VM argument settings |
1 | 515 |
static bool check_vm_args_consistency(); |
516 |
// Used by os_solaris |
|
517 |
static bool process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized); |
|
518 |
||
19986
33d188c66ed9
8010722: assert: failed: heap size is too big for compressed oops
tschatzl
parents:
19732
diff
changeset
|
519 |
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
|
520 |
// 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
|
521 |
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
|
522 |
|
1 | 523 |
// return a char* array containing all options |
524 |
static char** jvm_flags_array() { return _jvm_flags_array; } |
|
525 |
static char** jvm_args_array() { return _jvm_args_array; } |
|
526 |
static int num_jvm_flags() { return _num_jvm_flags; } |
|
527 |
static int num_jvm_args() { return _num_jvm_args; } |
|
528 |
// return the arguments passed to the Java application |
|
529 |
static const char* java_command() { return _java_command; } |
|
530 |
||
531 |
// print jvm_flags, jvm_args and java_command |
|
532 |
static void print_on(outputStream* st); |
|
31963
641ed52732ec
8026324: hs_err improvement: Add summary section to hs_err file
coleenp
parents:
31853
diff
changeset
|
533 |
static void print_summary_on(outputStream* st); |
1 | 534 |
|
34125
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
535 |
// convenient methods to get and set jvm_flags_file |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
536 |
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
|
537 |
static void set_jvm_flags_file(const char *value) { |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
538 |
if (_jvm_flags_file != NULL) { |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
539 |
os::free(_jvm_flags_file); |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
540 |
} |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
541 |
_jvm_flags_file = os::strdup_check_oom(value); |
56c4a2d19ee1
8141068: refactor -XXFlags= code in preparation for removal
rdurbin
parents:
32823
diff
changeset
|
542 |
} |
1 | 543 |
// convenient methods to obtain / print jvm_flags and jvm_args |
544 |
static const char* jvm_flags() { return build_resource_string(_jvm_flags_array, _num_jvm_flags); } |
|
545 |
static const char* jvm_args() { return build_resource_string(_jvm_args_array, _num_jvm_args); } |
|
546 |
static void print_jvm_flags_on(outputStream* st); |
|
547 |
static void print_jvm_args_on(outputStream* st); |
|
548 |
||
549 |
// -Dkey=value flags |
|
550 |
static SystemProperty* system_properties() { return _system_properties; } |
|
551 |
static const char* get_property(const char* key); |
|
552 |
||
553 |
// -Djava.vendor.url.bug |
|
554 |
static const char* java_vendor_url_bug() { return _java_vendor_url_bug; } |
|
555 |
||
556 |
// -Dsun.java.launcher |
|
557 |
static const char* sun_java_launcher() { return _sun_java_launcher; } |
|
558 |
// Was VM created by a Java launcher? |
|
559 |
static bool created_by_java_launcher(); |
|
22734
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
20288
diff
changeset
|
560 |
// -Dsun.java.launcher.is_altjvm |
41757c1f3946
8027113: decouple the '-XXaltjvm=<path>' option from the gamma launcher
rdurbin
parents:
20288
diff
changeset
|
561 |
static bool sun_java_launcher_is_altjvm(); |
1 | 562 |
// -Dsun.java.launcher.pid |
563 |
static int sun_java_launcher_pid() { return _sun_java_launcher_pid; } |
|
564 |
||
18687
5a0543c157c9
7133260: AllocationProfiler uses space in metadata and doesn't seem to do anything useful.
jiangli
parents:
18090
diff
changeset
|
565 |
// -Xprof |
1 | 566 |
static bool has_profile() { return _has_profile; } |
567 |
||
22551 | 568 |
// -Xms |
29697
92501504191b
8074459: Flags handling memory sizes should be of type size_t
jwilhelm
parents:
29696
diff
changeset
|
569 |
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
|
570 |
static void set_min_heap_size(size_t v) { _min_heap_size = v; } |
1 | 571 |
|
572 |
// -Xrun |
|
573 |
static AgentLibrary* libraries() { return _libraryList.first(); } |
|
574 |
static bool init_libraries_at_startup() { return !_libraryList.is_empty(); } |
|
575 |
static void convert_library_to_agent(AgentLibrary* lib) |
|
576 |
{ _libraryList.remove(lib); |
|
577 |
_agentList.add(lib); } |
|
578 |
||
579 |
// -agentlib -agentpath |
|
580 |
static AgentLibrary* agents() { return _agentList.first(); } |
|
581 |
static bool init_agents_at_startup() { return !_agentList.is_empty(); } |
|
582 |
||
583 |
// abort, exit, vfprintf hooks |
|
584 |
static abort_hook_t abort_hook() { return _abort_hook; } |
|
585 |
static exit_hook_t exit_hook() { return _exit_hook; } |
|
586 |
static vfprintf_hook_t vfprintf_hook() { return _vfprintf_hook; } |
|
587 |
||
588 |
static bool GetCheckCompileOnly () { return CheckCompileOnly; } |
|
589 |
||
590 |
static const char* GetSharedArchivePath() { return SharedArchivePath; } |
|
591 |
||
592 |
static bool CompileMethod(char* className, char* methodName) { |
|
593 |
return |
|
594 |
methodExists( |
|
595 |
className, methodName, |
|
596 |
CompileOnlyClassesNum, CompileOnlyClasses, CompileOnlyAllMethods, |
|
597 |
CompileOnlyMethodsNum, CompileOnlyMethods, CompileOnlyAllClasses |
|
598 |
); |
|
599 |
} |
|
600 |
||
601 |
// Java launcher properties |
|
602 |
static void process_sun_java_launcher_properties(JavaVMInitArgs* args); |
|
603 |
||
604 |
// System properties |
|
605 |
static void init_system_properties(); |
|
606 |
||
6961
a32b2fc66321
6988363: Rebrand vm vendor property settings (jdk7 only)
zgu
parents:
6453
diff
changeset
|
607 |
// Update/Initialize System properties after JDK version number is known |
a32b2fc66321
6988363: Rebrand vm vendor property settings (jdk7 only)
zgu
parents:
6453
diff
changeset
|
608 |
static void init_version_specific_system_properties(); |
a32b2fc66321
6988363: Rebrand vm vendor property settings (jdk7 only)
zgu
parents:
6453
diff
changeset
|
609 |
|
2358 | 610 |
// Property List manipulation |
28372
ce0aad4b8c44
8064457: Introduce compressed oops mode disjoint base and improve compressed heap handling.
goetz
parents:
27926
diff
changeset
|
611 |
static void PropertyList_add(SystemProperty *element); |
1 | 612 |
static void PropertyList_add(SystemProperty** plist, SystemProperty *element); |
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
613 |
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
|
614 |
static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v) { |
2358 | 615 |
PropertyList_unique_add(plist, k, v, false); |
616 |
} |
|
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
617 |
static void PropertyList_unique_add(SystemProperty** plist, const char* k, const char* v, jboolean append); |
1 | 618 |
static const char* PropertyList_get_value(SystemProperty* plist, const char* key); |
619 |
static int PropertyList_count(SystemProperty* pl); |
|
620 |
static const char* PropertyList_get_key_at(SystemProperty* pl,int index); |
|
621 |
static char* PropertyList_get_value_at(SystemProperty* pl,int index); |
|
622 |
||
623 |
// Miscellaneous System property value getter and setters. |
|
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
624 |
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
|
625 |
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
|
626 |
static void set_library_path(const char *value) { _java_library_path->set_value(value); } |
27562 | 627 |
static void set_ext_dirs(char *value) { _ext_dirs = os::strdup_check_oom(value); } |
32595
8cde9aca5e9f
8132725: Memory leak in Arguments::add_property function
ddmitriev
parents:
32366
diff
changeset
|
628 |
static void set_sysclasspath(const char *value) { _sun_boot_class_path->set_value(value); } |
1 | 629 |
static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); } |
630 |
||
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25468
diff
changeset
|
631 |
static char* get_java_home() { return _java_home->value(); } |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25468
diff
changeset
|
632 |
static char* get_dll_dir() { return _sun_boot_library_path->value(); } |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25468
diff
changeset
|
633 |
static char* get_sysclasspath() { return _sun_boot_class_path->value(); } |
27562 | 634 |
static char* get_ext_dirs() { return _ext_dirs; } |
26135
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25468
diff
changeset
|
635 |
static char* get_appclasspath() { return _java_class_path->value(); } |
82b516c550f7
8046070: Class Data Sharing clean up and refactoring
iklam
parents:
25468
diff
changeset
|
636 |
static void fix_appclasspath(); |
1 | 637 |
|
27562 | 638 |
|
1 | 639 |
// Operation modi |
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
|
640 |
static Mode mode() { return _mode; } |
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
|
641 |
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
|
642 |
|
1 | 643 |
|
644 |
// Utility: copies src into buf, replacing "%%" with "%" and "%p" with pid. |
|
645 |
static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen); |
|
646 |
}; |
|
7397 | 647 |
|
26836
b27ec66071c7
8057531: refactor gc argument processing code slightly
jcoomes
parents:
26824
diff
changeset
|
648 |
bool Arguments::gc_selected() { |
27898
813ad96387b3
8065972: Remove support for ParNew+SerialOld and DefNew+CMS
brutisso
parents:
27892
diff
changeset
|
649 |
return UseConcMarkSweepGC || UseG1GC || UseParallelGC || UseParallelOldGC || UseSerialGC; |
26836
b27ec66071c7
8057531: refactor gc argument processing code slightly
jcoomes
parents:
26824
diff
changeset
|
650 |
} |
26838
344fb68e970a
8057623: add an extension class for argument handling
jcoomes
parents:
26836
diff
changeset
|
651 |
|
28838
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
652 |
// 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
|
653 |
// were explicitly requested on the command-line |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
654 |
#define UNSUPPORTED_OPTION(opt, description) \ |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
655 |
do { \ |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
656 |
if (opt) { \ |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
657 |
if (FLAG_IS_CMDLINE(opt)) { \ |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
658 |
warning(description " is disabled in this release."); \ |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
659 |
} \ |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
660 |
FLAG_SET_DEFAULT(opt, false); \ |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
661 |
} \ |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
662 |
} while(0) |
da47c3cc5c98
8067460: G1: TestResourceManagementFlagWithCommercialBuild.java failed on embedded platform
aharlap
parents:
28650
diff
changeset
|
663 |
|
7397 | 664 |
#endif // SHARE_VM_RUNTIME_ARGUMENTS_HPP |