Mercurial > hg > truffle
annotate src/share/vm/runtime/arguments.hpp @ 7666:31540ca73e81
Remove ControlFlowException in SimpleLanguage.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 01 Feb 2013 19:53:52 +0100 |
parents | 989155e2d07a |
children | 5fc51c1ecdeb |
rev | line source |
---|---|
0 | 1 /* |
6842
b9a9ed0f8eeb
7197424: update copyright year to match last edit in jdk8 hotspot repository
mikael
parents:
6197
diff
changeset
|
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1284
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1284
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1284
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_RUNTIME_ARGUMENTS_HPP |
26 #define SHARE_VM_RUNTIME_ARGUMENTS_HPP | |
27 | |
28 #include "runtime/java.hpp" | |
29 #include "runtime/perfData.hpp" | |
30 #include "utilities/top.hpp" | |
31 | |
0 | 32 // Arguments parses the command line and recognizes options |
33 | |
34 // Invocation API hook typedefs (these should really be defined in jni.hpp) | |
35 extern "C" { | |
36 typedef void (JNICALL *abort_hook_t)(void); | |
37 typedef void (JNICALL *exit_hook_t)(jint code); | |
38 typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args); | |
39 } | |
40 | |
41 // Forward declarations | |
42 | |
43 class SysClassPath; | |
44 | |
45 // Element describing System and User (-Dkey=value flags) defined property. | |
46 | |
6197 | 47 class SystemProperty: public CHeapObj<mtInternal> { |
0 | 48 private: |
49 char* _key; | |
50 char* _value; | |
51 SystemProperty* _next; | |
52 bool _writeable; | |
53 bool writeable() { return _writeable; } | |
54 | |
55 public: | |
56 // Accessors | |
57 const char* key() const { return _key; } | |
58 char* value() const { return _value; } | |
59 SystemProperty* next() const { return _next; } | |
60 void set_next(SystemProperty* next) { _next = next; } | |
61 bool set_value(char *value) { | |
62 if (writeable()) { | |
63 if (_value != NULL) { | |
64 FreeHeap(_value); | |
65 } | |
6197 | 66 _value = AllocateHeap(strlen(value)+1, mtInternal); |
0 | 67 if (_value != NULL) { |
68 strcpy(_value, value); | |
69 } | |
70 return true; | |
71 } | |
72 return false; | |
73 } | |
74 | |
75 void append_value(const char *value) { | |
76 char *sp; | |
77 size_t len = 0; | |
78 if (value != NULL) { | |
79 len = strlen(value); | |
80 if (_value != NULL) { | |
81 len += strlen(_value); | |
82 } | |
6197 | 83 sp = AllocateHeap(len+2, mtInternal); |
0 | 84 if (sp != NULL) { |
85 if (_value != NULL) { | |
86 strcpy(sp, _value); | |
87 strcat(sp, os::path_separator()); | |
88 strcat(sp, value); | |
89 FreeHeap(_value); | |
90 } else { | |
91 strcpy(sp, value); | |
92 } | |
93 _value = sp; | |
94 } | |
95 } | |
96 } | |
97 | |
98 // Constructor | |
99 SystemProperty(const char* key, const char* value, bool writeable) { | |
100 if (key == NULL) { | |
101 _key = NULL; | |
102 } else { | |
6197 | 103 _key = AllocateHeap(strlen(key)+1, mtInternal); |
0 | 104 strcpy(_key, key); |
105 } | |
106 if (value == NULL) { | |
107 _value = NULL; | |
108 } else { | |
6197 | 109 _value = AllocateHeap(strlen(value)+1, mtInternal); |
0 | 110 strcpy(_value, value); |
111 } | |
112 _next = NULL; | |
113 _writeable = writeable; | |
114 } | |
115 }; | |
116 | |
117 | |
118 // For use by -agentlib, -agentpath and -Xrun | |
6197 | 119 class AgentLibrary : public CHeapObj<mtInternal> { |
0 | 120 friend class AgentLibraryList; |
121 private: | |
122 char* _name; | |
123 char* _options; | |
124 void* _os_lib; | |
125 bool _is_absolute_path; | |
126 AgentLibrary* _next; | |
127 | |
128 public: | |
129 // Accessors | |
130 const char* name() const { return _name; } | |
131 char* options() const { return _options; } | |
132 bool is_absolute_path() const { return _is_absolute_path; } | |
133 void* os_lib() const { return _os_lib; } | |
134 void set_os_lib(void* os_lib) { _os_lib = os_lib; } | |
135 AgentLibrary* next() const { return _next; } | |
136 | |
137 // Constructor | |
138 AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) { | |
6197 | 139 _name = AllocateHeap(strlen(name)+1, mtInternal); |
0 | 140 strcpy(_name, name); |
141 if (options == NULL) { | |
142 _options = NULL; | |
143 } else { | |
6197 | 144 _options = AllocateHeap(strlen(options)+1, mtInternal); |
0 | 145 strcpy(_options, options); |
146 } | |
147 _is_absolute_path = is_absolute_path; | |
148 _os_lib = os_lib; | |
149 _next = NULL; | |
150 } | |
151 }; | |
152 | |
153 // maintain an order of entry list of AgentLibrary | |
154 class AgentLibraryList VALUE_OBJ_CLASS_SPEC { | |
155 private: | |
156 AgentLibrary* _first; | |
157 AgentLibrary* _last; | |
158 public: | |
159 bool is_empty() const { return _first == NULL; } | |
160 AgentLibrary* first() const { return _first; } | |
161 | |
162 // add to the end of the list | |
163 void add(AgentLibrary* lib) { | |
164 if (is_empty()) { | |
165 _first = _last = lib; | |
166 } else { | |
167 _last->_next = lib; | |
168 _last = lib; | |
169 } | |
170 lib->_next = NULL; | |
171 } | |
172 | |
173 // search for and remove a library known to be in the list | |
174 void remove(AgentLibrary* lib) { | |
175 AgentLibrary* curr; | |
176 AgentLibrary* prev = NULL; | |
177 for (curr = first(); curr != NULL; prev = curr, curr = curr->next()) { | |
178 if (curr == lib) { | |
179 break; | |
180 } | |
181 } | |
182 assert(curr != NULL, "always should be found"); | |
183 | |
184 if (curr != NULL) { | |
185 // it was found, by-pass this library | |
186 if (prev == NULL) { | |
187 _first = curr->_next; | |
188 } else { | |
189 prev->_next = curr->_next; | |
190 } | |
191 if (curr == _last) { | |
192 _last = prev; | |
193 } | |
194 curr->_next = NULL; | |
195 } | |
196 } | |
197 | |
198 AgentLibraryList() { | |
199 _first = NULL; | |
200 _last = NULL; | |
201 } | |
202 }; | |
203 | |
204 | |
205 class Arguments : AllStatic { | |
206 friend class VMStructs; | |
207 friend class JvmtiExport; | |
208 public: | |
209 // Operation modi | |
210 enum Mode { | |
211 _int, // corresponds to -Xint | |
212 _mixed, // corresponds to -Xmixed | |
213 _comp // corresponds to -Xcomp | |
214 }; | |
215 | |
216 enum ArgsRange { | |
217 arg_unreadable = -3, | |
218 arg_too_small = -2, | |
219 arg_too_big = -1, | |
220 arg_in_range = 0 | |
221 }; | |
222 | |
223 private: | |
224 | |
225 // an array containing all flags specified in the .hotspotrc file | |
226 static char** _jvm_flags_array; | |
227 static int _num_jvm_flags; | |
228 // an array containing all jvm arguments specified in the command line | |
229 static char** _jvm_args_array; | |
230 static int _num_jvm_args; | |
4657
d4e039a3e083
Print java.exe when execuing "mx vm"
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4559
diff
changeset
|
231 #ifdef GRAAL |
7125
1baf7f1e3f23
decoupled C++ Graal runtime from C1
Doug Simon <doug.simon@oracle.com>
parents:
6948
diff
changeset
|
232 // an array containing all Graal arguments specified in the command line |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2491
diff
changeset
|
233 static char** _graal_args_array; |
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2491
diff
changeset
|
234 static int _num_graal_args; |
4657
d4e039a3e083
Print java.exe when execuing "mx vm"
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4559
diff
changeset
|
235 #endif |
0 | 236 // string containing all java command (class/jarfile name and app args) |
237 static char* _java_command; | |
238 | |
239 // Property list | |
240 static SystemProperty* _system_properties; | |
241 | |
242 // Quick accessor to System properties in the list: | |
243 static SystemProperty *_java_ext_dirs; | |
244 static SystemProperty *_java_endorsed_dirs; | |
245 static SystemProperty *_sun_boot_library_path; | |
246 static SystemProperty *_java_library_path; | |
247 static SystemProperty *_java_home; | |
248 static SystemProperty *_java_class_path; | |
249 static SystemProperty *_sun_boot_class_path; | |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
250 #ifdef GRAAL |
3546
4aa80ca3dbec
Separate compiler bootstrappath from application bootstrappath.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
251 static SystemProperty *_compiler_class_path; |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
252 #endif |
0 | 253 |
254 // Meta-index for knowing what packages are in the boot class path | |
255 static char* _meta_index_path; | |
256 static char* _meta_index_dir; | |
257 | |
258 // java.vendor.url.bug, bug reporting URL for fatal errors. | |
259 static const char* _java_vendor_url_bug; | |
260 | |
261 // sun.java.launcher, private property to provide information about | |
262 // java/gamma launcher | |
263 static const char* _sun_java_launcher; | |
264 | |
265 // sun.java.launcher.pid, private property | |
266 static int _sun_java_launcher_pid; | |
267 | |
2302
da091bb67459
7022037: Pause when exiting if debugger is attached on windows
sla
parents:
1972
diff
changeset
|
268 // was this VM created by the gamma launcher |
da091bb67459
7022037: Pause when exiting if debugger is attached on windows
sla
parents:
1972
diff
changeset
|
269 static bool _created_by_gamma_launcher; |
da091bb67459
7022037: Pause when exiting if debugger is attached on windows
sla
parents:
1972
diff
changeset
|
270 |
0 | 271 // Option flags |
272 static bool _has_profile; | |
273 static bool _has_alloc_profile; | |
274 static const char* _gc_log_filename; | |
275 static uintx _min_heap_size; | |
276 | |
277 // -Xrun arguments | |
278 static AgentLibraryList _libraryList; | |
279 static void add_init_library(const char* name, char* options) | |
280 { _libraryList.add(new AgentLibrary(name, options, false, NULL)); } | |
281 | |
282 // -agentlib and -agentpath arguments | |
283 static AgentLibraryList _agentList; | |
284 static void add_init_agent(const char* name, char* options, bool absolute_path) | |
285 { _agentList.add(new AgentLibrary(name, options, absolute_path, NULL)); } | |
286 | |
287 // Late-binding agents not started via arguments | |
288 static void add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib) | |
289 { _agentList.add(new AgentLibrary(name, options, absolute_path, os_lib)); } | |
290 | |
291 // Operation modi | |
292 static Mode _mode; | |
293 static void set_mode_flags(Mode mode); | |
294 static bool _java_compiler; | |
295 static void set_java_compiler(bool arg) { _java_compiler = arg; } | |
296 static bool java_compiler() { return _java_compiler; } | |
297 | |
298 // -Xdebug flag | |
299 static bool _xdebug_mode; | |
300 static void set_xdebug_mode(bool arg) { _xdebug_mode = arg; } | |
301 static bool xdebug_mode() { return _xdebug_mode; } | |
302 | |
303 // Used to save default settings | |
304 static bool _AlwaysCompileLoopMethods; | |
305 static bool _UseOnStackReplacement; | |
306 static bool _BackgroundCompilation; | |
307 static bool _ClipInlining; | |
308 static bool _CIDynamicCompilePriority; | |
309 | |
1783 | 310 // Tiered |
311 static void set_tiered_flags(); | |
0 | 312 // CMS/ParNew garbage collectors |
313 static void set_parnew_gc_flags(); | |
314 static void set_cms_and_parnew_gc_flags(); | |
342
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
10
diff
changeset
|
315 // UseParallel[Old]GC |
0 | 316 static void set_parallel_gc_flags(); |
342
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
10
diff
changeset
|
317 // Garbage-First (UseG1GC) |
37f87013dfd8
6711316: Open source the Garbage-First garbage collector
ysr
parents:
10
diff
changeset
|
318 static void set_g1_gc_flags(); |
0 | 319 // GC ergonomics |
320 static void set_ergonomics_flags(); | |
2362
a2c2eac1ca62
7018056: large pages not always enabled by default
jcoomes
parents:
2302
diff
changeset
|
321 static void set_shared_spaces_flags(); |
1064 | 322 // Setup heap size |
323 static void set_heap_size(); | |
0 | 324 // Based on automatic selection criteria, should the |
325 // low pause collector be used. | |
326 static bool should_auto_select_low_pause_collector(); | |
327 | |
328 // Bytecode rewriting | |
329 static void set_bytecode_flags(); | |
330 | |
331 // Invocation API hooks | |
332 static abort_hook_t _abort_hook; | |
333 static exit_hook_t _exit_hook; | |
334 static vfprintf_hook_t _vfprintf_hook; | |
335 | |
336 // System properties | |
337 static bool add_property(const char* prop); | |
338 | |
339 // Aggressive optimization flags. | |
340 static void set_aggressive_opts_flags(); | |
341 | |
342 // Argument parsing | |
343 static void do_pd_flag_adjustments(); | |
344 static bool parse_argument(const char* arg, FlagValueOrigin origin); | |
345 static bool process_argument(const char* arg, jboolean ignore_unrecognized, FlagValueOrigin origin); | |
346 static void process_java_launcher_argument(const char*, void*); | |
347 static void process_java_compiler_argument(char* arg); | |
348 static jint parse_options_environment_variable(const char* name, SysClassPath* scp_p, bool* scp_assembly_required_p); | |
349 static jint parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p); | |
350 static jint parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p); | |
351 static jint parse_vm_init_args(const JavaVMInitArgs* args); | |
352 static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, FlagValueOrigin origin); | |
353 static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required); | |
354 static bool is_bad_option(const JavaVMOption* option, jboolean ignore, | |
355 const char* option_type); | |
356 static bool is_bad_option(const JavaVMOption* option, jboolean ignore) { | |
357 return is_bad_option(option, ignore, NULL); | |
358 } | |
1244
745c853ee57f
6885297: java -XX:RefDiscoveryPolicy=2 or -XX:TLABWasteTargetPercent=0 cause VM crash
johnc
parents:
1064
diff
changeset
|
359 static bool verify_interval(uintx val, uintx min, |
745c853ee57f
6885297: java -XX:RefDiscoveryPolicy=2 or -XX:TLABWasteTargetPercent=0 cause VM crash
johnc
parents:
1064
diff
changeset
|
360 uintx max, const char* name); |
1744
f8c5d1bdaad4
6885308: The incorrect -XX:StackRedPages, -XX:StackShadowPages, -XX:StackYellowPages could cause VM crash
ptisnovs
parents:
1552
diff
changeset
|
361 static bool verify_min_value(intx val, intx min, const char* name); |
0 | 362 static bool verify_percentage(uintx value, const char* name); |
363 static void describe_range_error(ArgsRange errcode); | |
489
2494ab195856
6653214: MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes.
swamyv
parents:
356
diff
changeset
|
364 static ArgsRange check_memory_size(julong size, julong min_size); |
2494ab195856
6653214: MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes.
swamyv
parents:
356
diff
changeset
|
365 static ArgsRange parse_memory_size(const char* s, julong* long_arg, |
2494ab195856
6653214: MemoryPoolMXBean.setUsageThreshold() does not support large heap sizes.
swamyv
parents:
356
diff
changeset
|
366 julong min_size); |
1284 | 367 // Parse a string for a unsigned integer. Returns true if value |
368 // is an unsigned integer greater than or equal to the minimum | |
369 // parameter passed and returns the value in uintx_arg. Returns | |
370 // false otherwise, with uintx_arg undefined. | |
371 static bool parse_uintx(const char* value, uintx* uintx_arg, | |
372 uintx min_size); | |
0 | 373 |
374 // methods to build strings from individual args | |
375 static void build_jvm_args(const char* arg); | |
376 static void build_jvm_flags(const char* arg); | |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
377 #ifdef GRAAL |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2491
diff
changeset
|
378 static void add_graal_arg(const char* arg); |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
379 #endif |
0 | 380 static void add_string(char*** bldarray, int* count, const char* arg); |
381 static const char* build_resource_string(char** args, int count); | |
382 | |
383 static bool methodExists( | |
384 char* className, char* methodName, | |
385 int classesNum, char** classes, bool* allMethods, | |
386 int methodsNum, char** methods, bool* allClasses | |
387 ); | |
388 | |
389 static void parseOnlyLine( | |
390 const char* line, | |
391 short* classesNum, short* classesMax, char*** classes, bool** allMethods, | |
392 short* methodsNum, short* methodsMax, char*** methods, bool** allClasses | |
393 ); | |
394 | |
242 | 395 // Returns true if the string s is in the list of flags that have recently |
396 // been made obsolete. If we detect one of these flags on the command | |
397 // line, instead of failing we print a warning message and ignore the | |
398 // flag. This gives the user a release or so to stop using the flag. | |
399 static bool is_newly_obsolete(const char* s, JDK_Version* buffer); | |
0 | 400 |
401 static short CompileOnlyClassesNum; | |
402 static short CompileOnlyClassesMax; | |
403 static char** CompileOnlyClasses; | |
404 static bool* CompileOnlyAllMethods; | |
405 | |
406 static short CompileOnlyMethodsNum; | |
407 static short CompileOnlyMethodsMax; | |
408 static char** CompileOnlyMethods; | |
409 static bool* CompileOnlyAllClasses; | |
410 | |
411 static short InterpretOnlyClassesNum; | |
412 static short InterpretOnlyClassesMax; | |
413 static char** InterpretOnlyClasses; | |
414 static bool* InterpretOnlyAllMethods; | |
415 | |
416 static bool CheckCompileOnly; | |
417 | |
418 static char* SharedArchivePath; | |
419 | |
420 public: | |
421 // Parses the arguments | |
422 static jint parse(const JavaVMInitArgs* args); | |
7177
53715fb1597d
7198334: UseNUMA modifies system parameters on non-NUMA system
brutisso
parents:
6842
diff
changeset
|
423 // Adjusts the arguments after the OS have adjusted the arguments |
53715fb1597d
7198334: UseNUMA modifies system parameters on non-NUMA system
brutisso
parents:
6842
diff
changeset
|
424 static jint adjust_after_os(); |
10
28372612af5e
6362677: Change parallel GC collector default number of parallel GC threads.
jmasa
parents:
0
diff
changeset
|
425 // Check for consistency in the selection of the garbage collector. |
28372612af5e
6362677: Change parallel GC collector default number of parallel GC threads.
jmasa
parents:
0
diff
changeset
|
426 static bool check_gc_consistency(); |
7452
e0ab18eafbde
8003820: Deprecate untested and rarely used GC combinations
brutisso
parents:
7177
diff
changeset
|
427 static void check_deprecated_gcs(); |
0 | 428 // Check consistecy or otherwise of VM argument settings |
429 static bool check_vm_args_consistency(); | |
1744
f8c5d1bdaad4
6885308: The incorrect -XX:StackRedPages, -XX:StackShadowPages, -XX:StackYellowPages could cause VM crash
ptisnovs
parents:
1552
diff
changeset
|
430 // Check stack pages settings |
f8c5d1bdaad4
6885308: The incorrect -XX:StackRedPages, -XX:StackShadowPages, -XX:StackYellowPages could cause VM crash
ptisnovs
parents:
1552
diff
changeset
|
431 static bool check_stack_pages(); |
0 | 432 // Used by os_solaris |
433 static bool process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized); | |
434 | |
435 // return a char* array containing all options | |
436 static char** jvm_flags_array() { return _jvm_flags_array; } | |
437 static char** jvm_args_array() { return _jvm_args_array; } | |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
438 #ifdef GRAAL |
2891
75a99b4f1c98
Rebranded C++ part from C1X to Graal.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2491
diff
changeset
|
439 static char** graal_args_array() { return _graal_args_array; } |
4657
d4e039a3e083
Print java.exe when execuing "mx vm"
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4559
diff
changeset
|
440 static int num_graal_args() { return _num_graal_args; } |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
441 #endif |
0 | 442 static int num_jvm_flags() { return _num_jvm_flags; } |
443 static int num_jvm_args() { return _num_jvm_args; } | |
444 // return the arguments passed to the Java application | |
445 static const char* java_command() { return _java_command; } | |
446 | |
447 // print jvm_flags, jvm_args and java_command | |
448 static void print_on(outputStream* st); | |
449 | |
450 // convenient methods to obtain / print jvm_flags and jvm_args | |
451 static const char* jvm_flags() { return build_resource_string(_jvm_flags_array, _num_jvm_flags); } | |
452 static const char* jvm_args() { return build_resource_string(_jvm_args_array, _num_jvm_args); } | |
453 static void print_jvm_flags_on(outputStream* st); | |
454 static void print_jvm_args_on(outputStream* st); | |
455 | |
456 // -Dkey=value flags | |
457 static SystemProperty* system_properties() { return _system_properties; } | |
458 static const char* get_property(const char* key); | |
459 | |
460 // -Djava.vendor.url.bug | |
461 static const char* java_vendor_url_bug() { return _java_vendor_url_bug; } | |
462 | |
463 // -Dsun.java.launcher | |
464 static const char* sun_java_launcher() { return _sun_java_launcher; } | |
465 // Was VM created by a Java launcher? | |
466 static bool created_by_java_launcher(); | |
2302
da091bb67459
7022037: Pause when exiting if debugger is attached on windows
sla
parents:
1972
diff
changeset
|
467 // Was VM created by the gamma Java launcher? |
da091bb67459
7022037: Pause when exiting if debugger is attached on windows
sla
parents:
1972
diff
changeset
|
468 static bool created_by_gamma_launcher(); |
0 | 469 // -Dsun.java.launcher.pid |
470 static int sun_java_launcher_pid() { return _sun_java_launcher_pid; } | |
471 | |
472 // -Xloggc:<file>, if not specified will be NULL | |
473 static const char* gc_log_filename() { return _gc_log_filename; } | |
474 | |
475 // -Xprof/-Xaprof | |
476 static bool has_profile() { return _has_profile; } | |
477 static bool has_alloc_profile() { return _has_alloc_profile; } | |
478 | |
1064 | 479 // -Xms, -Xmx |
0 | 480 static uintx min_heap_size() { return _min_heap_size; } |
481 static void set_min_heap_size(uintx v) { _min_heap_size = v; } | |
482 | |
483 // -Xrun | |
484 static AgentLibrary* libraries() { return _libraryList.first(); } | |
485 static bool init_libraries_at_startup() { return !_libraryList.is_empty(); } | |
486 static void convert_library_to_agent(AgentLibrary* lib) | |
487 { _libraryList.remove(lib); | |
488 _agentList.add(lib); } | |
489 | |
490 // -agentlib -agentpath | |
491 static AgentLibrary* agents() { return _agentList.first(); } | |
492 static bool init_agents_at_startup() { return !_agentList.is_empty(); } | |
493 | |
494 // abort, exit, vfprintf hooks | |
495 static abort_hook_t abort_hook() { return _abort_hook; } | |
496 static exit_hook_t exit_hook() { return _exit_hook; } | |
497 static vfprintf_hook_t vfprintf_hook() { return _vfprintf_hook; } | |
498 | |
499 static bool GetCheckCompileOnly () { return CheckCompileOnly; } | |
500 | |
501 static const char* GetSharedArchivePath() { return SharedArchivePath; } | |
502 | |
503 static bool CompileMethod(char* className, char* methodName) { | |
504 return | |
505 methodExists( | |
506 className, methodName, | |
507 CompileOnlyClassesNum, CompileOnlyClasses, CompileOnlyAllMethods, | |
508 CompileOnlyMethodsNum, CompileOnlyMethods, CompileOnlyAllClasses | |
509 ); | |
510 } | |
511 | |
512 // Java launcher properties | |
513 static void process_sun_java_launcher_properties(JavaVMInitArgs* args); | |
514 | |
515 // System properties | |
516 static void init_system_properties(); | |
517 | |
1864
dfb38ea7da17
6988363: Rebrand vm vendor property settings (jdk7 only)
zgu
parents:
1783
diff
changeset
|
518 // Update/Initialize System properties after JDK version number is known |
dfb38ea7da17
6988363: Rebrand vm vendor property settings (jdk7 only)
zgu
parents:
1783
diff
changeset
|
519 static void init_version_specific_system_properties(); |
dfb38ea7da17
6988363: Rebrand vm vendor property settings (jdk7 only)
zgu
parents:
1783
diff
changeset
|
520 |
691 | 521 // Property List manipulation |
0 | 522 static void PropertyList_add(SystemProperty** plist, SystemProperty *element); |
523 static void PropertyList_add(SystemProperty** plist, const char* k, char* v); | |
691 | 524 static void PropertyList_unique_add(SystemProperty** plist, const char* k, char* v) { |
525 PropertyList_unique_add(plist, k, v, false); | |
526 } | |
527 static void PropertyList_unique_add(SystemProperty** plist, const char* k, char* v, jboolean append); | |
0 | 528 static const char* PropertyList_get_value(SystemProperty* plist, const char* key); |
529 static int PropertyList_count(SystemProperty* pl); | |
530 static const char* PropertyList_get_key_at(SystemProperty* pl,int index); | |
531 static char* PropertyList_get_value_at(SystemProperty* pl,int index); | |
532 | |
533 // Miscellaneous System property value getter and setters. | |
534 static void set_dll_dir(char *value) { _sun_boot_library_path->set_value(value); } | |
535 static void set_java_home(char *value) { _java_home->set_value(value); } | |
536 static void set_library_path(char *value) { _java_library_path->set_value(value); } | |
537 static void set_ext_dirs(char *value) { _java_ext_dirs->set_value(value); } | |
538 static void set_endorsed_dirs(char *value) { _java_endorsed_dirs->set_value(value); } | |
539 static void set_sysclasspath(char *value) { _sun_boot_class_path->set_value(value); } | |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
540 #ifdef GRAAL |
3546
4aa80ca3dbec
Separate compiler bootstrappath from application bootstrappath.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
541 static void set_compilerclasspath(char *value) { _compiler_class_path->set_value(value); } |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
542 #endif |
0 | 543 static void append_sysclasspath(const char *value) { _sun_boot_class_path->append_value(value); } |
544 static void set_meta_index_path(char* meta_index_path, char* meta_index_dir) { | |
545 _meta_index_path = meta_index_path; | |
546 _meta_index_dir = meta_index_dir; | |
547 } | |
548 | |
549 static char *get_java_home() { return _java_home->value(); } | |
550 static char *get_dll_dir() { return _sun_boot_library_path->value(); } | |
551 static char *get_endorsed_dir() { return _java_endorsed_dirs->value(); } | |
552 static char *get_sysclasspath() { return _sun_boot_class_path->value(); } | |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
553 #ifdef GRAAL |
3546
4aa80ca3dbec
Separate compiler bootstrappath from application bootstrappath.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2891
diff
changeset
|
554 static char *get_compilerclasspath() { return _compiler_class_path->value(); } |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
3546
diff
changeset
|
555 #endif |
0 | 556 static char* get_meta_index_path() { return _meta_index_path; } |
557 static char* get_meta_index_dir() { return _meta_index_dir; } | |
558 | |
559 // Operation modi | |
560 static Mode mode() { return _mode; } | |
561 | |
562 // Utility: copies src into buf, replacing "%%" with "%" and "%p" with pid. | |
563 static bool copy_expand_pid(const char* src, size_t srclen, char* buf, size_t buflen); | |
564 | |
565 #ifdef KERNEL | |
566 // For java kernel vm, return property string for kernel properties. | |
567 static char *get_kernel_properties(); | |
568 #endif // KERNEL | |
569 }; | |
1972 | 570 |
571 #endif // SHARE_VM_RUNTIME_ARGUMENTS_HPP |