diff src/share/vm/runtime/globals.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 1c3486050433
children 359f7e70ae7f
line wrap: on
line diff
--- a/src/share/vm/runtime/globals.hpp	Thu Oct 10 18:26:22 2013 +0200
+++ b/src/share/vm/runtime/globals.hpp	Fri Oct 11 10:38:03 2013 +0200
@@ -208,29 +208,50 @@
 typedef const char* ccstr;
 typedef const char* ccstrlist;   // represents string arguments which accumulate
 
-enum FlagValueOrigin {
-  DEFAULT          = 0,
-  COMMAND_LINE     = 1,
-  ENVIRON_VAR      = 2,
-  CONFIG_FILE      = 3,
-  MANAGEMENT       = 4,
-  ERGONOMIC        = 5,
-  ATTACH_ON_DEMAND = 6,
-  INTERNAL         = 99
-};
+struct Flag {
+  enum Flags {
+    // value origin
+    DEFAULT          = 0,
+    COMMAND_LINE     = 1,
+    ENVIRON_VAR      = 2,
+    CONFIG_FILE      = 3,
+    MANAGEMENT       = 4,
+    ERGONOMIC        = 5,
+    ATTACH_ON_DEMAND = 6,
+    INTERNAL         = 7,
+
+    LAST_VALUE_ORIGIN = INTERNAL,
+    VALUE_ORIGIN_BITS = 4,
+    VALUE_ORIGIN_MASK = right_n_bits(VALUE_ORIGIN_BITS),
 
-struct Flag {
-  const char *type;
-  const char *name;
-  void*       addr;
+    // flag kind
+    KIND_PRODUCT            = 1 << 4,
+    KIND_MANAGEABLE         = 1 << 5,
+    KIND_DIAGNOSTIC         = 1 << 6,
+    KIND_EXPERIMENTAL       = 1 << 7,
+    KIND_NOT_PRODUCT        = 1 << 8,
+    KIND_DEVELOP            = 1 << 9,
+    KIND_PLATFORM_DEPENDENT = 1 << 10,
+    KIND_READ_WRITE         = 1 << 11,
+    KIND_C1                 = 1 << 12,
+    KIND_C2                 = 1 << 13,
+    KIND_ARCH               = 1 << 14,
+    KIND_SHARK              = 1 << 15,
+    KIND_LP64_PRODUCT       = 1 << 16,
+    KIND_COMMERCIAL         = 1 << 17,
+    KIND_GRAAL              = 1 << 18,
 
-  NOT_PRODUCT(const char *doc;)
+    KIND_MASK = ~VALUE_ORIGIN_MASK
+  };
 
-  const char *kind;
-  FlagValueOrigin origin;
+  const char* _type;
+  const char* _name;
+  void* _addr;
+  NOT_PRODUCT(const char* _doc;)
+  Flags _flags;
 
   // points to all Flags static array
-  static Flag *flags;
+  static Flag* flags;
 
   // number of flags
   static size_t numFlags;
@@ -238,30 +259,50 @@
   static Flag* find_flag(const char* name, size_t length, bool allow_locked = false);
   static Flag* fuzzy_match(const char* name, size_t length, bool allow_locked = false);
 
-  bool is_bool() const        { return strcmp(type, "bool") == 0; }
-  bool get_bool() const       { return *((bool*) addr); }
-  void set_bool(bool value)   { *((bool*) addr) = value; }
+  void check_writable();
+
+  bool is_bool() const;
+  bool get_bool() const;
+  void set_bool(bool value);
+
+  bool is_intx() const;
+  intx get_intx() const;
+  void set_intx(intx value);
 
-  bool is_intx()  const       { return strcmp(type, "intx")  == 0; }
-  intx get_intx() const       { return *((intx*) addr); }
-  void set_intx(intx value)   { *((intx*) addr) = value; }
+  bool is_uintx() const;
+  uintx get_uintx() const;
+  void set_uintx(uintx value);
 
-  bool is_uintx() const       { return strcmp(type, "uintx") == 0; }
-  uintx get_uintx() const     { return *((uintx*) addr); }
-  void set_uintx(uintx value) { *((uintx*) addr) = value; }
+  bool is_uint64_t() const;
+  uint64_t get_uint64_t() const;
+  void set_uint64_t(uint64_t value);
+
+  bool is_double() const;
+  double get_double() const;
+  void set_double(double value);
 
-  bool is_uint64_t() const          { return strcmp(type, "uint64_t") == 0; }
-  uint64_t get_uint64_t() const     { return *((uint64_t*) addr); }
-  void set_uint64_t(uint64_t value) { *((uint64_t*) addr) = value; }
+  bool is_ccstr() const;
+  bool ccstr_accumulates() const;
+  ccstr get_ccstr() const;
+  void set_ccstr(ccstr value);
+
+  Flags get_origin();
+  void set_origin(Flags origin);
 
-  bool is_double() const        { return strcmp(type, "double") == 0; }
-  double get_double() const     { return *((double*) addr); }
-  void set_double(double value) { *((double*) addr) = value; }
+  bool is_default();
+  bool is_ergonomic();
+  bool is_command_line();
 
-  bool is_ccstr() const          { return strcmp(type, "ccstr") == 0 || strcmp(type, "ccstrlist") == 0; }
-  bool ccstr_accumulates() const { return strcmp(type, "ccstrlist") == 0; }
-  ccstr get_ccstr() const     { return *((ccstr*) addr); }
-  void set_ccstr(ccstr value) { *((ccstr*) addr) = value; }
+  bool is_product() const;
+  bool is_manageable() const;
+  bool is_diagnostic() const;
+  bool is_experimental() const;
+  bool is_notproduct() const;
+  bool is_develop() const;
+  bool is_read_write() const;
+  bool is_commercial() const;
+
+  bool is_constant_in_binary() const;
 
   bool is_unlocker() const;
   bool is_unlocked() const;
@@ -277,6 +318,7 @@
   void get_locked_message_ext(char*, int) const;
 
   void print_on(outputStream* st, bool withComments = false );
+  void print_kind(outputStream* st);
   void print_as_flag(outputStream* st);
 };
 
@@ -324,33 +366,33 @@
  public:
   static bool boolAt(char* name, size_t len, bool* value);
   static bool boolAt(char* name, bool* value)      { return boolAt(name, strlen(name), value); }
-  static bool boolAtPut(char* name, size_t len, bool* value, FlagValueOrigin origin);
-  static bool boolAtPut(char* name, bool* value, FlagValueOrigin origin)   { return boolAtPut(name, strlen(name), value, origin); }
+  static bool boolAtPut(char* name, size_t len, bool* value, Flag::Flags origin);
+  static bool boolAtPut(char* name, bool* value, Flag::Flags origin)   { return boolAtPut(name, strlen(name), value, origin); }
 
   static bool intxAt(char* name, size_t len, intx* value);
   static bool intxAt(char* name, intx* value)      { return intxAt(name, strlen(name), value); }
-  static bool intxAtPut(char* name, size_t len, intx* value, FlagValueOrigin origin);
-  static bool intxAtPut(char* name, intx* value, FlagValueOrigin origin)   { return intxAtPut(name, strlen(name), value, origin); }
+  static bool intxAtPut(char* name, size_t len, intx* value, Flag::Flags origin);
+  static bool intxAtPut(char* name, intx* value, Flag::Flags origin)   { return intxAtPut(name, strlen(name), value, origin); }
 
   static bool uintxAt(char* name, size_t len, uintx* value);
   static bool uintxAt(char* name, uintx* value)    { return uintxAt(name, strlen(name), value); }
-  static bool uintxAtPut(char* name, size_t len, uintx* value, FlagValueOrigin origin);
-  static bool uintxAtPut(char* name, uintx* value, FlagValueOrigin origin) { return uintxAtPut(name, strlen(name), value, origin); }
+  static bool uintxAtPut(char* name, size_t len, uintx* value, Flag::Flags origin);
+  static bool uintxAtPut(char* name, uintx* value, Flag::Flags origin) { return uintxAtPut(name, strlen(name), value, origin); }
 
   static bool uint64_tAt(char* name, size_t len, uint64_t* value);
   static bool uint64_tAt(char* name, uint64_t* value) { return uint64_tAt(name, strlen(name), value); }
-  static bool uint64_tAtPut(char* name, size_t len, uint64_t* value, FlagValueOrigin origin);
-  static bool uint64_tAtPut(char* name, uint64_t* value, FlagValueOrigin origin) { return uint64_tAtPut(name, strlen(name), value, origin); }
+  static bool uint64_tAtPut(char* name, size_t len, uint64_t* value, Flag::Flags origin);
+  static bool uint64_tAtPut(char* name, uint64_t* value, Flag::Flags origin) { return uint64_tAtPut(name, strlen(name), value, origin); }
 
   static bool doubleAt(char* name, size_t len, double* value);
   static bool doubleAt(char* name, double* value)    { return doubleAt(name, strlen(name), value); }
-  static bool doubleAtPut(char* name, size_t len, double* value, FlagValueOrigin origin);
-  static bool doubleAtPut(char* name, double* value, FlagValueOrigin origin) { return doubleAtPut(name, strlen(name), value, origin); }
+  static bool doubleAtPut(char* name, size_t len, double* value, Flag::Flags origin);
+  static bool doubleAtPut(char* name, double* value, Flag::Flags origin) { return doubleAtPut(name, strlen(name), value, origin); }
 
   static bool ccstrAt(char* name, size_t len, ccstr* value);
   static bool ccstrAt(char* name, ccstr* value)    { return ccstrAt(name, strlen(name), value); }
-  static bool ccstrAtPut(char* name, size_t len, ccstr* value, FlagValueOrigin origin);
-  static bool ccstrAtPut(char* name, ccstr* value, FlagValueOrigin origin) { return ccstrAtPut(name, strlen(name), value, origin); }
+  static bool ccstrAtPut(char* name, size_t len, ccstr* value, Flag::Flags origin);
+  static bool ccstrAtPut(char* name, ccstr* value, Flag::Flags origin) { return ccstrAtPut(name, strlen(name), value, origin); }
 
   // Returns false if name is not a command line flag.
   static bool wasSetOnCmdline(const char* name, bool* value);
@@ -457,8 +499,8 @@
             "Use 32-bit object references in 64-bit VM  "                   \
             "lp64_product means flag is always constant in 32 bit VM")      \
                                                                             \
-  lp64_product(bool, UseCompressedKlassPointers, false,                     \
-            "Use 32-bit klass pointers in 64-bit VM  "                      \
+  lp64_product(bool, UseCompressedClassPointers, false,                     \
+            "Use 32-bit class pointers in 64-bit VM  "                      \
             "lp64_product means flag is always constant in 32 bit VM")      \
                                                                             \
   notproduct(bool, CheckCompressedOops, true,                               \
@@ -666,7 +708,7 @@
   develop(bool, TraceCallFixup, false,                                      \
           "traces all call fixups")                                         \
                                                                             \
-  product(bool, DeoptimizeALot, false,                                      \
+  develop(bool, DeoptimizeALot, false,                                      \
           "deoptimize at every exit from the runtime system")               \
                                                                             \
   notproduct(ccstrlist, DeoptimizeOnlyAt, "",                               \
@@ -894,7 +936,7 @@
           "stay alive at the expense of JVM performance")                   \
                                                                             \
   diagnostic(bool, LogCompilation, false,                                   \
-          "Log compilation activity in detail to hotspot.log or LogFile")   \
+          "Log compilation activity in detail to LogFile")                  \
                                                                             \
   product(bool, PrintCompilation, false,                                    \
           "Print compilations")                                             \
@@ -928,9 +970,6 @@
   diagnostic(ccstr, PrintAssemblyOptions, NULL,                             \
           "Options string passed to disassembler.so")                       \
                                                                             \
-  product(bool, PrintNMethodStatistics, false,                              \
-          "Print a summary statistic for the generated nmethods")           \
-                                                                            \
   diagnostic(bool, PrintNMethods, false,                                    \
           "Print assembly code for nmethods when generated")                \
                                                                             \
@@ -1256,7 +1295,7 @@
   develop(bool, TraceClassInitialization, false,                            \
           "Trace class initialization")                                     \
                                                                             \
-  product(bool, TraceExceptions, false,                                     \
+  develop(bool, TraceExceptions, false,                                     \
           "Trace exceptions")                                               \
                                                                             \
   develop(bool, TraceICs, false,                                            \
@@ -1950,6 +1989,9 @@
   notproduct(bool, ExecuteInternalVMTests, false,                           \
           "Enable execution of internal VM tests.")                         \
                                                                             \
+  notproduct(bool, VerboseInternalVMTests, false,                           \
+          "Turn on logging for internal VM tests.")                         \
+                                                                            \
   product_pd(bool, UseTLAB, "Use thread-local object allocation")           \
                                                                             \
   product_pd(bool, ResizeTLAB,                                              \
@@ -2512,16 +2554,17 @@
          "Print all VM flags with default values and descriptions and exit")\
                                                                             \
   diagnostic(bool, SerializeVMOutput, true,                                 \
-         "Use a mutex to serialize output to tty and hotspot.log")          \
+         "Use a mutex to serialize output to tty and LogFile")              \
                                                                             \
   diagnostic(bool, DisplayVMOutput, true,                                   \
          "Display all VM output on the tty, independently of LogVMOutput")  \
                                                                             \
-  diagnostic(bool, LogVMOutput, trueInDebug,                                \
-         "Save VM output to hotspot.log, or to LogFile")                    \
+  diagnostic(bool, LogVMOutput, false,                                      \
+         "Save VM output to LogFile")                                       \
                                                                             \
   diagnostic(ccstr, LogFile, NULL,                                          \
-         "If LogVMOutput is on, save VM output to this file [hotspot.log]") \
+         "If LogVMOutput or LogCompilation is on, save VM output to "       \
+         "this file [default: ./hotspot_pid%p.log] (%p replaced with pid)") \
                                                                             \
   product(ccstr, ErrorFile, NULL,                                           \
          "If an error occurs, save the error data to this file "            \
@@ -2539,6 +2582,9 @@
   product(bool, PrintStringTableStatistics, false,                          \
           "print statistics about the StringTable and SymbolTable")         \
                                                                             \
+  diagnostic(bool, VerifyStringTableAtExit, false,                          \
+          "verify StringTable contents at exit")                            \
+                                                                            \
   notproduct(bool, PrintSymbolTableSizeHistogram, false,                    \
           "print histogram of the symbol table")                            \
                                                                             \
@@ -2843,6 +2889,10 @@
   product(intx, NmethodSweepCheckInterval, 5,                               \
           "Compilers wake up every n seconds to possibly sweep nmethods")   \
                                                                             \
+  product(intx, NmethodSweepActivity, 10,                                   \
+          "Removes cold nmethods from code cache if > 0. Higher values "    \
+          "result in more aggressive sweeping")                             \
+                                                                            \
   notproduct(bool, LogSweeper, false,                                       \
             "Keep a ring buffer of sweeper activity")                       \
                                                                             \
@@ -3059,9 +3109,9 @@
   product(uintx, MaxMetaspaceSize, max_uintx,                               \
           "Maximum size of Metaspaces (in bytes)")                          \
                                                                             \
-  product(uintx, ClassMetaspaceSize, 1*G,                                   \
-          "Maximum size of InstanceKlass area in Metaspace used for "       \
-          "UseCompressedKlassPointers")                                     \
+  product(uintx, CompressedClassSpaceSize, 1*G,                             \
+          "Maximum size of class area in Metaspace when compressed "        \
+          "class pointers are used")                                        \
                                                                             \
   product(uintx, MinHeapFreeRatio,    40,                                   \
           "Min percentage of heap free after GC to avoid expansion")        \
@@ -3217,15 +3267,6 @@
   product(bool, UseCodeCacheFlushing, true,                                 \
           "Attempt to clean the code cache before shutting off compiler")   \
                                                                             \
-  product(intx,  MinCodeCacheFlushingInterval, 30,                          \
-          "Min number of seconds between code cache cleaning sessions")     \
-                                                                            \
-  product(uintx,  CodeCacheFlushingMinimumFreeSpace, 1500*K,                \
-          "When less than X space left, start code cache cleaning")         \
-                                                                            \
-  product(uintx, CodeCacheFlushingFraction, 2,                              \
-          "Fraction of the code cache that is flushed when full")           \
-                                                                            \
   /* interpreter debugging */                                               \
   develop(intx, BinarySwitchThreshold, 5,                                   \
           "Minimal number of lookupswitch entries for rewriting to binary " \
@@ -3367,10 +3408,10 @@
           "ConcurrentMarkSweep thread runs at critical scheduling priority")\
                                                                             \
   /* compiler debugging */                                                  \
-  develop(intx, CompileTheWorldStartAt, 1,                                  \
+  notproduct(intx, CompileTheWorldStartAt,     1,                           \
           "First class to consider when using +CompileTheWorld")            \
                                                                             \
-  develop(intx, CompileTheWorldStopAt, max_jint,                            \
+  notproduct(intx, CompileTheWorldStopAt, max_jint,                         \
           "Last class to consider when using +CompileTheWorld")             \
                                                                             \
   develop(intx, NewCodeParameter,      0,                                   \
@@ -3534,6 +3575,8 @@
           "Temporary flag for transition to AbstractMethodError wrapped "   \
           "in InvocationTargetException. See 6531596")                      \
                                                                             \
+  develop(bool, VerifyLambdaBytecodes, false,                               \
+          "Force verification of jdk 8 lambda metafactory bytecodes.")      \
                                                                             \
   develop(intx, FastSuperclassLimit, 8,                                     \
           "Depth of hardwired instanceof accelerator array")                \
@@ -3667,6 +3710,9 @@
   experimental(bool, TrustFinalNonStaticFields, false,                      \
           "trust final non-static declarations for constant folding")       \
                                                                             \
+  experimental(bool, FoldStableValues, false,                               \
+          "Private flag to control optimizations for stable variables")     \
+                                                                            \
   develop(bool, TraceInvokeDynamic, false,                                  \
           "trace internal invoke dynamic operations")                       \
                                                                             \
@@ -3705,15 +3751,9 @@
   develop(bool, TraceDefaultMethods, false,                                 \
           "Trace the default method processing steps")                      \
                                                                             \
-  develop(bool, ParseAllGenericSignatures, false,                           \
-          "Parse all generic signatures while classloading")                \
-                                                                            \
   develop(bool, VerifyGenericSignatures, false,                             \
           "Abort VM on erroneous or inconsistent generic signatures")       \
                                                                             \
-  product(bool, ParseGenericDefaults, false,                                \
-          "Parse generic signatures for default method handling")           \
-                                                                            \
   product(bool, UseVMInterruptibleIO, false,                                \
           "(Unstable, Solaris-specific) Thread interrupt before or with "   \
           "EINTR for I/O operations results in OS_INTRPT. The default value"\
@@ -3753,20 +3793,20 @@
  */
 
 // Interface macros
-#define DECLARE_PRODUCT_FLAG(type, name, value, doc)    extern "C" type name;
-#define DECLARE_PD_PRODUCT_FLAG(type, name, doc)        extern "C" type name;
-#define DECLARE_DIAGNOSTIC_FLAG(type, name, value, doc) extern "C" type name;
+#define DECLARE_PRODUCT_FLAG(type, name, value, doc)      extern "C" type name;
+#define DECLARE_PD_PRODUCT_FLAG(type, name, doc)          extern "C" type name;
+#define DECLARE_DIAGNOSTIC_FLAG(type, name, value, doc)   extern "C" type name;
 #define DECLARE_EXPERIMENTAL_FLAG(type, name, value, doc) extern "C" type name;
-#define DECLARE_MANAGEABLE_FLAG(type, name, value, doc) extern "C" type name;
-#define DECLARE_PRODUCT_RW_FLAG(type, name, value, doc) extern "C" type name;
+#define DECLARE_MANAGEABLE_FLAG(type, name, value, doc)   extern "C" type name;
+#define DECLARE_PRODUCT_RW_FLAG(type, name, value, doc)   extern "C" type name;
 #ifdef PRODUCT
-#define DECLARE_DEVELOPER_FLAG(type, name, value, doc)  const type name = value;
-#define DECLARE_PD_DEVELOPER_FLAG(type, name, doc)      const type name = pd_##name;
-#define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc)
+#define DECLARE_DEVELOPER_FLAG(type, name, value, doc)    extern "C" type CONST_##name; const type name = value;
+#define DECLARE_PD_DEVELOPER_FLAG(type, name, doc)        extern "C" type CONST_##name; const type name = pd_##name;
+#define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc)   extern "C" type CONST_##name;
 #else
-#define DECLARE_DEVELOPER_FLAG(type, name, value, doc)  extern "C" type name;
-#define DECLARE_PD_DEVELOPER_FLAG(type, name, doc)      extern "C" type name;
-#define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc)  extern "C" type name;
+#define DECLARE_DEVELOPER_FLAG(type, name, value, doc)    extern "C" type name;
+#define DECLARE_PD_DEVELOPER_FLAG(type, name, doc)        extern "C" type name;
+#define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc)   extern "C" type name;
 #endif
 // Special LP64 flags, product only needed for now.
 #ifdef _LP64
@@ -3776,23 +3816,23 @@
 #endif // _LP64
 
 // Implementation macros
-#define MATERIALIZE_PRODUCT_FLAG(type, name, value, doc)   type name = value;
-#define MATERIALIZE_PD_PRODUCT_FLAG(type, name, doc)       type name = pd_##name;
-#define MATERIALIZE_DIAGNOSTIC_FLAG(type, name, value, doc) type name = value;
+#define MATERIALIZE_PRODUCT_FLAG(type, name, value, doc)      type name = value;
+#define MATERIALIZE_PD_PRODUCT_FLAG(type, name, doc)          type name = pd_##name;
+#define MATERIALIZE_DIAGNOSTIC_FLAG(type, name, value, doc)   type name = value;
 #define MATERIALIZE_EXPERIMENTAL_FLAG(type, name, value, doc) type name = value;
-#define MATERIALIZE_MANAGEABLE_FLAG(type, name, value, doc) type name = value;
-#define MATERIALIZE_PRODUCT_RW_FLAG(type, name, value, doc) type name = value;
+#define MATERIALIZE_MANAGEABLE_FLAG(type, name, value, doc)   type name = value;
+#define MATERIALIZE_PRODUCT_RW_FLAG(type, name, value, doc)   type name = value;
 #ifdef PRODUCT
-#define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc) /* flag name is constant */
-#define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc)     /* flag name is constant */
-#define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc)
+#define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc)    type CONST_##name = value;
+#define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc)        type CONST_##name = pd_##name;
+#define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc)   type CONST_##name = value;
 #else
-#define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc) type name = value;
-#define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc)     type name = pd_##name;
-#define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc) type name = value;
+#define MATERIALIZE_DEVELOPER_FLAG(type, name, value, doc)    type name = value;
+#define MATERIALIZE_PD_DEVELOPER_FLAG(type, name, doc)        type name = pd_##name;
+#define MATERIALIZE_NOTPRODUCT_FLAG(type, name, value, doc)   type name = value;
 #endif
 #ifdef _LP64
-#define MATERIALIZE_LP64_PRODUCT_FLAG(type, name, value, doc)   type name = value;
+#define MATERIALIZE_LP64_PRODUCT_FLAG(type, name, value, doc) type name = value;
 #else
 #define MATERIALIZE_LP64_PRODUCT_FLAG(type, name, value, doc) /* flag is constant */
 #endif // _LP64