diff src/share/vm/runtime/arguments.hpp @ 12355:cefad50507d8

Merge with hs25-b53
author Gilles Duboscq <duboscq@ssw.jku.at>
date Fri, 11 Oct 2013 10:38:03 +0200
parents 58fc8e2b7b6d 72b7e96c1922
children 4dba97fb1a6f
line wrap: on
line diff
--- a/src/share/vm/runtime/arguments.hpp	Thu Oct 10 18:26:22 2013 +0200
+++ b/src/share/vm/runtime/arguments.hpp	Fri Oct 11 10:38:03 2013 +0200
@@ -118,11 +118,21 @@
 // For use by -agentlib, -agentpath and -Xrun
 class AgentLibrary : public CHeapObj<mtInternal> {
   friend class AgentLibraryList;
+public:
+  // Is this library valid or not. Don't rely on os_lib == NULL as statically
+  // linked lib could have handle of RTLD_DEFAULT which == 0 on some platforms
+  enum AgentState {
+    agent_invalid = 0,
+    agent_valid   = 1
+  };
+
  private:
   char*           _name;
   char*           _options;
   void*           _os_lib;
   bool            _is_absolute_path;
+  bool            _is_static_lib;
+  AgentState      _state;
   AgentLibrary*   _next;
 
  public:
@@ -133,6 +143,11 @@
   void* os_lib() const                      { return _os_lib; }
   void set_os_lib(void* os_lib)             { _os_lib = os_lib; }
   AgentLibrary* next() const                { return _next; }
+  bool is_static_lib() const                { return _is_static_lib; }
+  void set_static_lib(bool is_static_lib)   { _is_static_lib = is_static_lib; }
+  bool valid()                              { return (_state == agent_valid); }
+  void set_valid()                          { _state = agent_valid; }
+  void set_invalid()                        { _state = agent_invalid; }
 
   // Constructor
   AgentLibrary(const char* name, const char* options, bool is_absolute_path, void* os_lib) {
@@ -147,6 +162,8 @@
     _is_absolute_path = is_absolute_path;
     _os_lib = os_lib;
     _next = NULL;
+    _state = agent_invalid;
+    _is_static_lib = false;
   }
 };
 
@@ -268,6 +285,9 @@
   // Option flags
   static bool   _has_profile;
   static const char*  _gc_log_filename;
+  // Value of the conservative maximum heap alignment needed
+  static size_t  _conservative_max_heap_alignment;
+
   static uintx  _min_heap_size;
 
   // -Xrun arguments
@@ -281,6 +301,8 @@
     { _agentList.add(new AgentLibrary(name, options, absolute_path, NULL)); }
 
   // Late-binding agents not started via arguments
+  static void add_loaded_agent(AgentLibrary *agentLib)
+    { _agentList.add(agentLib); }
   static void add_loaded_agent(const char* name, char* options, bool absolute_path, void* os_lib)
     { _agentList.add(new AgentLibrary(name, options, absolute_path, os_lib)); }
 
@@ -313,6 +335,7 @@
   // Garbage-First (UseG1GC)
   static void set_g1_gc_flags();
   // GC ergonomics
+  static void set_conservative_max_heap_alignment();
   static void set_use_compressed_oops();
   static void set_use_compressed_klass_ptrs();
   static void set_ergonomics_flags();
@@ -320,8 +343,6 @@
   // limits the given memory size by the maximum amount of memory this process is
   // currently allowed to allocate or reserve.
   static julong limit_by_allocatable_memory(julong size);
-  // Setup HeapBaseMinAddress
-  static void set_heap_base_min_address();
   // Setup heap size
   static void set_heap_size();
   // Based on automatic selection criteria, should the
@@ -344,15 +365,15 @@
 
   // Argument parsing
   static void do_pd_flag_adjustments();
-  static bool parse_argument(const char* arg, FlagValueOrigin origin);
-  static bool process_argument(const char* arg, jboolean ignore_unrecognized, FlagValueOrigin origin);
+  static bool parse_argument(const char* arg, Flag::Flags origin);
+  static bool process_argument(const char* arg, jboolean ignore_unrecognized, Flag::Flags origin);
   static void process_java_launcher_argument(const char*, void*);
   static void process_java_compiler_argument(char* arg);
   static jint parse_options_environment_variable(const char* name, SysClassPath* scp_p, bool* scp_assembly_required_p);
   static jint parse_java_tool_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p);
   static jint parse_java_options_environment_variable(SysClassPath* scp_p, bool* scp_assembly_required_p);
   static jint parse_vm_init_args(const JavaVMInitArgs* args);
-  static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, FlagValueOrigin origin);
+  static jint parse_each_vm_init_arg(const JavaVMInitArgs* args, SysClassPath* scp_p, bool* scp_assembly_required_p, Flag::Flags origin);
   static jint finalize_vm_init_args(SysClassPath* scp_p, bool scp_assembly_required);
   static bool is_bad_option(const JavaVMOption* option, jboolean ignore,
     const char* option_type);
@@ -421,8 +442,10 @@
   static char*  SharedArchivePath;
 
  public:
-  // Parses the arguments
+  // Parses the arguments, first phase
   static jint parse(const JavaVMInitArgs* args);
+  // Apply ergonomics
+  static jint apply_ergo();
   // Adjusts the arguments after the OS have adjusted the arguments
   static jint adjust_after_os();
   // Check for consistency in the selection of the garbage collector.
@@ -436,6 +459,10 @@
   // Used by os_solaris
   static bool process_settings_file(const char* file_name, bool should_exist, jboolean ignore_unrecognized);
 
+  static size_t conservative_max_heap_alignment() { return _conservative_max_heap_alignment; }
+  // Return the maximum size a heap with compressed oops can take
+  static size_t max_heap_for_compressed_oops();
+
   // return a char* array containing all options
   static char** jvm_flags_array()          { return _jvm_flags_array; }
   static char** jvm_args_array()           { return _jvm_args_array; }