comparison src/share/vm/runtime/arguments.hpp @ 18041:52b4284cb496

Merge with jdk8u20-b26
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 16:02:50 +0200
parents 289a017dd9e2 78bbf4d43a14
children 7848fc12602b
comparison
equal deleted inserted replaced
17606:45d7b2c7029d 18041:52b4284cb496
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 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 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
25 #ifndef SHARE_VM_RUNTIME_ARGUMENTS_HPP 25 #ifndef SHARE_VM_RUNTIME_ARGUMENTS_HPP
26 #define SHARE_VM_RUNTIME_ARGUMENTS_HPP 26 #define SHARE_VM_RUNTIME_ARGUMENTS_HPP
27 27
28 #include "runtime/java.hpp" 28 #include "runtime/java.hpp"
29 #include "runtime/perfData.hpp" 29 #include "runtime/perfData.hpp"
30 #include "utilities/debug.hpp"
30 #include "utilities/top.hpp" 31 #include "utilities/top.hpp"
31 32
32 // Arguments parses the command line and recognizes options 33 // Arguments parses the command line and recognizes options
33 34
34 // Invocation API hook typedefs (these should really be defined in jni.hpp) 35 // Invocation API hook typedefs (these should really be defined in jni.hpp)
35 extern "C" { 36 extern "C" {
36 typedef void (JNICALL *abort_hook_t)(void); 37 typedef void (JNICALL *abort_hook_t)(void);
37 typedef void (JNICALL *exit_hook_t)(jint code); 38 typedef void (JNICALL *exit_hook_t)(jint code);
38 typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args); 39 typedef jint (JNICALL *vfprintf_hook_t)(FILE *fp, const char *format, va_list args) ATTRIBUTE_PRINTF(2, 0);
39 } 40 }
40 41
41 // Forward declarations 42 // Forward declarations
42 43
43 class SysClassPath; 44 class SysClassPath;
373 static jint parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p); 374 static jint parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p);
374 static jint parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p); 375 static jint parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p);
375 static jint parse_vm_init_args(const JavaVMInitArgs* args); 376 static jint parse_vm_init_args(const JavaVMInitArgs* args);
376 static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin); 377 static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin);
377 static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required); 378 static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required);
378 static bool is_bad_option(const JavaVMOption* option, jboolean ignore, 379 static bool is_bad_option(const JavaVMOption* option, jboolean ignore, const char* option_type);
379 const char* option_type); 380
380 static bool is_bad_option(const JavaVMOption* option, jboolean ignore) { 381 static bool is_bad_option(const JavaVMOption* option, jboolean ignore) {
381 return is_bad_option(option, ignore, NULL); 382 return is_bad_option(option, ignore, NULL);
382 } 383 }
384
385 static bool is_percentage(uintx val) {
386 return val <= 100;
387 }
388
383 static bool verify_interval(uintx val, uintx min, 389 static bool verify_interval(uintx val, uintx min,
384 uintx max, const char* name); 390 uintx max, const char* name);
385 static bool verify_min_value(intx val, intx min, const char* name); 391 static bool verify_min_value(intx val, intx min, const char* name);
386 static bool verify_percentage(uintx value, const char* name); 392 static bool verify_percentage(uintx value, const char* name);
387 static void describe_range_error(ArgsRange errcode); 393 static void describe_range_error(ArgsRange errcode);
446 static jint parse(const JavaVMInitArgs* args); 452 static jint parse(const JavaVMInitArgs* args);
447 // Apply ergonomics 453 // Apply ergonomics
448 static jint apply_ergo(); 454 static jint apply_ergo();
449 // Adjusts the arguments after the OS have adjusted the arguments 455 // Adjusts the arguments after the OS have adjusted the arguments
450 static jint adjust_after_os(); 456 static jint adjust_after_os();
457
458 // Verifies that the given value will fit as a MinHeapFreeRatio. If not, an error
459 // message is returned in the provided buffer.
460 static bool verify_MinHeapFreeRatio(FormatBuffer<80>& err_msg, uintx min_heap_free_ratio);
461
462 // Verifies that the given value will fit as a MaxHeapFreeRatio. If not, an error
463 // message is returned in the provided buffer.
464 static bool verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio);
465
451 // Check for consistency in the selection of the garbage collector. 466 // Check for consistency in the selection of the garbage collector.
452 static bool check_gc_consistency(); 467 static bool check_gc_consistency();
453 static void check_deprecated_gcs(); 468 static void check_deprecated_gcs();
454 static void check_deprecated_gc_flags(); 469 static void check_deprecated_gc_flags();
455 // Check consistecy or otherwise of VM argument settings 470 // Check consistecy or otherwise of VM argument settings