comparison src/share/vm/runtime/arguments.hpp @ 18058:54bc75c144b0

Merge
author asaha
date Thu, 29 May 2014 13:14:25 -0700
parents 78bbf4d43a14
children 52b4284cb496 99dbb9cd9521
comparison
equal deleted inserted replaced
18055:1fa005fb28f5 18058:54bc75c144b0
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;
368 static jint parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p); 369 static jint parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p);
369 static jint parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p); 370 static jint parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p);
370 static jint parse_vm_init_args(const JavaVMInitArgs* args); 371 static jint parse_vm_init_args(const JavaVMInitArgs* args);
371 static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin); 372 static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin);
372 static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required); 373 static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required);
373 static bool is_bad_option(const JavaVMOption* option, jboolean ignore, 374 static bool is_bad_option(const JavaVMOption* option, jboolean ignore, const char* option_type);
374 const char* option_type); 375
375 static bool is_bad_option(const JavaVMOption* option, jboolean ignore) { 376 static bool is_bad_option(const JavaVMOption* option, jboolean ignore) {
376 return is_bad_option(option, ignore, NULL); 377 return is_bad_option(option, ignore, NULL);
377 } 378 }
379
380 static bool is_percentage(uintx val) {
381 return val <= 100;
382 }
383
378 static bool verify_interval(uintx val, uintx min, 384 static bool verify_interval(uintx val, uintx min,
379 uintx max, const char* name); 385 uintx max, const char* name);
380 static bool verify_min_value(intx val, intx min, const char* name); 386 static bool verify_min_value(intx val, intx min, const char* name);
381 static bool verify_percentage(uintx value, const char* name); 387 static bool verify_percentage(uintx value, const char* name);
382 static void describe_range_error(ArgsRange errcode); 388 static void describe_range_error(ArgsRange errcode);
438 static jint parse(const JavaVMInitArgs* args); 444 static jint parse(const JavaVMInitArgs* args);
439 // Apply ergonomics 445 // Apply ergonomics
440 static jint apply_ergo(); 446 static jint apply_ergo();
441 // Adjusts the arguments after the OS have adjusted the arguments 447 // Adjusts the arguments after the OS have adjusted the arguments
442 static jint adjust_after_os(); 448 static jint adjust_after_os();
449
450 // Verifies that the given value will fit as a MinHeapFreeRatio. If not, an error
451 // message is returned in the provided buffer.
452 static bool verify_MinHeapFreeRatio(FormatBuffer<80>& err_msg, uintx min_heap_free_ratio);
453
454 // Verifies that the given value will fit as a MaxHeapFreeRatio. If not, an error
455 // message is returned in the provided buffer.
456 static bool verify_MaxHeapFreeRatio(FormatBuffer<80>& err_msg, uintx max_heap_free_ratio);
457
443 // Check for consistency in the selection of the garbage collector. 458 // Check for consistency in the selection of the garbage collector.
444 static bool check_gc_consistency(); 459 static bool check_gc_consistency();
445 static void check_deprecated_gcs(); 460 static void check_deprecated_gcs();
446 static void check_deprecated_gc_flags(); 461 static void check_deprecated_gc_flags();
447 // Check consistecy or otherwise of VM argument settings 462 // Check consistecy or otherwise of VM argument settings