< prev index next >

src/share/vm/runtime/globals.hpp

Print this page




 187 define_pd_global(intx, InlineUnsafeOps,              true);
 188 define_pd_global(intx, InitialCodeCacheSize,         160*K);
 189 define_pd_global(intx, ReservedCodeCacheSize,        32*M);
 190 define_pd_global(intx, CodeCacheExpansionSize,       32*K);
 191 define_pd_global(intx, CodeCacheMinBlockLength,      1);
 192 define_pd_global(intx, CodeCacheMinimumUseSpace,     200*K);
 193 define_pd_global(uintx,MetaspaceSize,    ScaleForWordSize(4*M));
 194 define_pd_global(bool, NeverActAsServerClassMachine, true);
 195 define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
 196 #define CI_COMPILER_COUNT 0
 197 #else
 198 
 199 #ifdef COMPILER2
 200 #define CI_COMPILER_COUNT 2
 201 #else
 202 #define CI_COMPILER_COUNT 1
 203 #endif // COMPILER2
 204 
 205 #endif // no compilers
 206 




 207 // string type aliases used only in this file
 208 typedef const char* ccstr;
 209 typedef const char* ccstrlist;   // represents string arguments which accumulate
 210 
 211 struct Flag {
 212   enum Flags {
 213     // value origin
 214     DEFAULT          = 0,
 215     COMMAND_LINE     = 1,
 216     ENVIRON_VAR      = 2,
 217     CONFIG_FILE      = 3,
 218     MANAGEMENT       = 4,
 219     ERGONOMIC        = 5,
 220     ATTACH_ON_DEMAND = 6,
 221     INTERNAL         = 7,
 222 
 223     LAST_VALUE_ORIGIN = INTERNAL,
 224     VALUE_ORIGIN_BITS = 4,
 225     VALUE_ORIGIN_MASK = right_n_bits(VALUE_ORIGIN_BITS),
 226 


 348 class UIntFlagSetting {
 349   uintx val;
 350   uintx* flag;
 351  public:
 352   UIntFlagSetting(uintx& fl, uintx newValue) { flag = &fl; val = fl; fl = newValue; }
 353   ~UIntFlagSetting()                         { *flag = val; }
 354 };
 355 
 356 
 357 class DoubleFlagSetting {
 358   double val;
 359   double* flag;
 360  public:
 361   DoubleFlagSetting(double& fl, double newValue) { flag = &fl; val = fl; fl = newValue; }
 362   ~DoubleFlagSetting()                           { *flag = val; }
 363 };
 364 
 365 
 366 class CommandLineFlags {
 367  public:
 368   static bool boolAt(const char* name, size_t len, bool* value);
 369   static bool boolAt(const char* name, bool* value)      { return boolAt(name, strlen(name), value); }
 370   static bool boolAtPut(const char* name, size_t len, bool* value, Flag::Flags origin);
 371   static bool boolAtPut(const char* name, bool* value, Flag::Flags origin)   { return boolAtPut(name, strlen(name), value, origin); }
 372 
 373   static bool intxAt(const char* name, size_t len, intx* value);
 374   static bool intxAt(const char* name, intx* value)      { return intxAt(name, strlen(name), value); }
 375   static bool intxAtPut(const char* name, size_t len, intx* value, Flag::Flags origin);
 376   static bool intxAtPut(const char* name, intx* value, Flag::Flags origin)   { return intxAtPut(name, strlen(name), value, origin); }
 377 
 378   static bool uintxAt(const char* name, size_t len, uintx* value);
 379   static bool uintxAt(const char* name, uintx* value)    { return uintxAt(name, strlen(name), value); }
 380   static bool uintxAtPut(const char* name, size_t len, uintx* value, Flag::Flags origin);
 381   static bool uintxAtPut(const char* name, uintx* value, Flag::Flags origin) { return uintxAtPut(name, strlen(name), value, origin); }
 382 
 383   static bool uint64_tAt(const char* name, size_t len, uint64_t* value);
 384   static bool uint64_tAt(const char* name, uint64_t* value) { return uint64_tAt(name, strlen(name), value); }
 385   static bool uint64_tAtPut(const char* name, size_t len, uint64_t* value, Flag::Flags origin);
 386   static bool uint64_tAtPut(const char* name, uint64_t* value, Flag::Flags origin) { return uint64_tAtPut(name, strlen(name), value, origin); }
 387 
 388   static bool doubleAt(const char* name, size_t len, double* value);
 389   static bool doubleAt(const char* name, double* value)    { return doubleAt(name, strlen(name), value); }
 390   static bool doubleAtPut(const char* name, size_t len, double* value, Flag::Flags origin);
 391   static bool doubleAtPut(const char* name, double* value, Flag::Flags origin) { return doubleAtPut(name, strlen(name), value, origin); }
 392 
 393   static bool ccstrAt(const char* name, size_t len, ccstr* value);
 394   static bool ccstrAt(const char* name, ccstr* value)    { return ccstrAt(name, strlen(name), value); }
 395   // Contract:  Flag will make private copy of the incoming value.
 396   // Outgoing value is always malloc-ed, and caller MUST call free.
 397   static bool ccstrAtPut(const char* name, size_t len, ccstr* value, Flag::Flags origin);
 398   static bool ccstrAtPut(const char* name, ccstr* value, Flag::Flags origin) { return ccstrAtPut(name, strlen(name), value, origin); }
 399 
 400   // Returns false if name is not a command line flag.
 401   static bool wasSetOnCmdline(const char* name, bool* value);
 402   static void printSetFlags(outputStream* out);
 403 
 404   static void printFlags(outputStream* out, bool withComments);
 405 
 406   static void verify() PRODUCT_RETURN;
 407 };
 408 
 409 // use this for flags that are true by default in the debug version but
 410 // false in the optimized version, and vice versa
 411 #ifdef ASSERT
 412 #define trueInDebug  true
 413 #define falseInDebug false
 414 #else


3965           "Obey the ACC_SUPER flag and allow invokenonvirtual calls")       \
3966                                                                             \
3967   product(ccstr, DumpLoadedClassList, NULL,                                 \
3968           "Dump the names all loaded classes, that could be stored into "   \
3969           "the CDS archive, in the specified file")                         \
3970                                                                             \
3971   product(ccstr, SharedClassListFile, NULL,                                 \
3972           "Override the default CDS class list")                            \
3973                                                                             \
3974   diagnostic(ccstr, SharedArchiveFile, NULL,                                \
3975           "Override the default location of the CDS archive file")          \
3976                                                                             \
3977   product(ccstr, ExtraSharedClassListFile, NULL,                            \
3978           "Extra classlist for building the CDS archive file")              \
3979                                                                             \
3980   experimental(uintx, ArrayAllocatorMallocLimit,                            \
3981           SOLARIS_ONLY(64*K) NOT_SOLARIS(max_uintx),                        \
3982           "Allocation less than this value will be allocated "              \
3983           "using malloc. Larger allocations will use mmap.")                \
3984                                                                             \




3985   product(bool, EnableTracing, false,                                       \
3986           "Enable event-based tracing")                                     \

3987                                                                             \
3988   product(bool, UseLockedTracing, false,                                    \
3989           "Use locked-tracing when doing event-based tracing")              \

3990                                                                             \
3991   product_pd(bool, PreserveFramePointer,                                    \
3992              "Use the FP register for holding the frame pointer "           \
3993              "and not as a general purpose register.")














3994 
3995 /*
3996  *  Macros for factoring of globals
3997  */
3998 
3999 // Interface macros
4000 #define DECLARE_PRODUCT_FLAG(type, name, value, doc)      extern "C" type name;
4001 #define DECLARE_PD_PRODUCT_FLAG(type, name, doc)          extern "C" type name;
4002 #define DECLARE_DIAGNOSTIC_FLAG(type, name, value, doc)   extern "C" type name;
4003 #define DECLARE_EXPERIMENTAL_FLAG(type, name, value, doc) extern "C" type name;
4004 #define DECLARE_MANAGEABLE_FLAG(type, name, value, doc)   extern "C" type name;
4005 #define DECLARE_PRODUCT_RW_FLAG(type, name, value, doc)   extern "C" type name;
4006 #ifdef PRODUCT
4007 #define DECLARE_DEVELOPER_FLAG(type, name, value, doc)    extern "C" type CONST_##name; const type name = value;
4008 #define DECLARE_PD_DEVELOPER_FLAG(type, name, doc)        extern "C" type CONST_##name; const type name = pd_##name;
4009 #define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc)   extern "C" type CONST_##name;
4010 #else
4011 #define DECLARE_DEVELOPER_FLAG(type, name, value, doc)    extern "C" type name;
4012 #define DECLARE_PD_DEVELOPER_FLAG(type, name, doc)        extern "C" type name;
4013 #define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc)   extern "C" type name;




 187 define_pd_global(intx, InlineUnsafeOps,              true);
 188 define_pd_global(intx, InitialCodeCacheSize,         160*K);
 189 define_pd_global(intx, ReservedCodeCacheSize,        32*M);
 190 define_pd_global(intx, CodeCacheExpansionSize,       32*K);
 191 define_pd_global(intx, CodeCacheMinBlockLength,      1);
 192 define_pd_global(intx, CodeCacheMinimumUseSpace,     200*K);
 193 define_pd_global(uintx,MetaspaceSize,    ScaleForWordSize(4*M));
 194 define_pd_global(bool, NeverActAsServerClassMachine, true);
 195 define_pd_global(uint64_t,MaxRAM,                    1ULL*G);
 196 #define CI_COMPILER_COUNT 0
 197 #else
 198 
 199 #ifdef COMPILER2
 200 #define CI_COMPILER_COUNT 2
 201 #else
 202 #define CI_COMPILER_COUNT 1
 203 #endif // COMPILER2
 204 
 205 #endif // no compilers
 206 
 207 #if !INCLUDE_JFR
 208 #define LogJFR false
 209 #endif
 210 
 211 // string type aliases used only in this file
 212 typedef const char* ccstr;
 213 typedef const char* ccstrlist;   // represents string arguments which accumulate
 214 
 215 struct Flag {
 216   enum Flags {
 217     // value origin
 218     DEFAULT          = 0,
 219     COMMAND_LINE     = 1,
 220     ENVIRON_VAR      = 2,
 221     CONFIG_FILE      = 3,
 222     MANAGEMENT       = 4,
 223     ERGONOMIC        = 5,
 224     ATTACH_ON_DEMAND = 6,
 225     INTERNAL         = 7,
 226 
 227     LAST_VALUE_ORIGIN = INTERNAL,
 228     VALUE_ORIGIN_BITS = 4,
 229     VALUE_ORIGIN_MASK = right_n_bits(VALUE_ORIGIN_BITS),
 230 


 352 class UIntFlagSetting {
 353   uintx val;
 354   uintx* flag;
 355  public:
 356   UIntFlagSetting(uintx& fl, uintx newValue) { flag = &fl; val = fl; fl = newValue; }
 357   ~UIntFlagSetting()                         { *flag = val; }
 358 };
 359 
 360 
 361 class DoubleFlagSetting {
 362   double val;
 363   double* flag;
 364  public:
 365   DoubleFlagSetting(double& fl, double newValue) { flag = &fl; val = fl; fl = newValue; }
 366   ~DoubleFlagSetting()                           { *flag = val; }
 367 };
 368 
 369 
 370 class CommandLineFlags {
 371  public:
 372   static bool boolAt(const char* name, size_t len, bool* value, bool allow_locked = false, bool return_flag = false);
 373   static bool boolAt(const char* name, bool* value, bool allow_locked = false, bool return_flag = false)   { return boolAt(name, strlen(name), value, allow_locked, return_flag); }
 374   static bool boolAtPut(const char* name, size_t len, bool* value, Flag::Flags origin);
 375   static bool boolAtPut(const char* name, bool* value, Flag::Flags origin)   { return boolAtPut(name, strlen(name), value, origin); }
 376 
 377   static bool intxAt(const char* name, size_t len, intx* value, bool allow_locked = false, bool return_flag = false);
 378   static bool intxAt(const char* name, intx* value, bool allow_locked = false, bool return_flag = false)      { return intxAt(name, strlen(name), value, allow_locked, return_flag); }
 379   static bool intxAtPut(const char* name, size_t len, intx* value, Flag::Flags origin);
 380   static bool intxAtPut(const char* name, intx* value, Flag::Flags origin)   { return intxAtPut(name, strlen(name), value, origin); }
 381 
 382   static bool uintxAt(const char* name, size_t len, uintx* value, bool allow_locked = false, bool return_flag = false);
 383   static bool uintxAt(const char* name, uintx* value, bool allow_locked = false, bool return_flag = false)    { return uintxAt(name, strlen(name), value, allow_locked, return_flag); }
 384   static bool uintxAtPut(const char* name, size_t len, uintx* value, Flag::Flags origin);
 385   static bool uintxAtPut(const char* name, uintx* value, Flag::Flags origin) { return uintxAtPut(name, strlen(name), value, origin); }
 386 
 387   static bool uint64_tAt(const char* name, size_t len, uint64_t* value, bool allow_locked = false, bool return_flag = false);
 388   static bool uint64_tAt(const char* name, uint64_t* value, bool allow_locked = false, bool return_flag = false) { return uint64_tAt(name, strlen(name), value, allow_locked, return_flag); }
 389   static bool uint64_tAtPut(const char* name, size_t len, uint64_t* value, Flag::Flags origin);
 390   static bool uint64_tAtPut(const char* name, uint64_t* value, Flag::Flags origin) { return uint64_tAtPut(name, strlen(name), value, origin); }
 391 
 392   static bool doubleAt(const char* name, size_t len, double* value, bool allow_locked = false, bool return_flag = false);
 393   static bool doubleAt(const char* name, double* value, bool allow_locked = false, bool return_flag = false)    { return doubleAt(name, strlen(name), value, allow_locked, return_flag); }
 394   static bool doubleAtPut(const char* name, size_t len, double* value, Flag::Flags origin);
 395   static bool doubleAtPut(const char* name, double* value, Flag::Flags origin) { return doubleAtPut(name, strlen(name), value, origin); }
 396 
 397   static bool ccstrAt(const char* name, size_t len, ccstr* value, bool allow_locked = false, bool return_flag = false);
 398   static bool ccstrAt(const char* name, ccstr* value, bool allow_locked = false, bool return_flag = false)    { return ccstrAt(name, strlen(name), value, allow_locked, return_flag); }
 399   // Contract:  Flag will make private copy of the incoming value.
 400   // Outgoing value is always malloc-ed, and caller MUST call free.
 401   static bool ccstrAtPut(const char* name, size_t len, ccstr* value, Flag::Flags origin);
 402   static bool ccstrAtPut(const char* name, ccstr* value, Flag::Flags origin) { return ccstrAtPut(name, strlen(name), value, origin); }
 403 
 404   // Returns false if name is not a command line flag.
 405   static bool wasSetOnCmdline(const char* name, bool* value);
 406   static void printSetFlags(outputStream* out);
 407 
 408   static void printFlags(outputStream* out, bool withComments);
 409 
 410   static void verify() PRODUCT_RETURN;
 411 };
 412 
 413 // use this for flags that are true by default in the debug version but
 414 // false in the optimized version, and vice versa
 415 #ifdef ASSERT
 416 #define trueInDebug  true
 417 #define falseInDebug false
 418 #else


3969           "Obey the ACC_SUPER flag and allow invokenonvirtual calls")       \
3970                                                                             \
3971   product(ccstr, DumpLoadedClassList, NULL,                                 \
3972           "Dump the names all loaded classes, that could be stored into "   \
3973           "the CDS archive, in the specified file")                         \
3974                                                                             \
3975   product(ccstr, SharedClassListFile, NULL,                                 \
3976           "Override the default CDS class list")                            \
3977                                                                             \
3978   diagnostic(ccstr, SharedArchiveFile, NULL,                                \
3979           "Override the default location of the CDS archive file")          \
3980                                                                             \
3981   product(ccstr, ExtraSharedClassListFile, NULL,                            \
3982           "Extra classlist for building the CDS archive file")              \
3983                                                                             \
3984   experimental(uintx, ArrayAllocatorMallocLimit,                            \
3985           SOLARIS_ONLY(64*K) NOT_SOLARIS(max_uintx),                        \
3986           "Allocation less than this value will be allocated "              \
3987           "using malloc. Larger allocations will use mmap.")                \
3988                                                                             \
3989   product_pd(bool, PreserveFramePointer,                                    \
3990              "Use the FP register for holding the frame pointer "           \
3991              "and not as a general purpose register.")                      \
3992                                                                             \
3993   product(bool, EnableTracing, false,                                       \
3994           "Enable event-based tracing"                                      \
3995           "Deprecated: use FlightRecorder instead")                         \
3996                                                                             \
3997   product(bool, UseLockedTracing, false,                                    \
3998           "Use locked-tracing when doing event-based tracing"               \
3999           "Deprecated: use FlightRecorder instead")                         \
4000                                                                             \
4001   JFR_ONLY(product(bool, FlightRecorder, false,                             \
4002           "Enable Flight Recorder"))                                        \
4003                                                                             \
4004   JFR_ONLY(product(ccstr, FlightRecorderOptions, NULL,                      \
4005           "Flight Recorder options"))                                       \
4006                                                                             \
4007   JFR_ONLY(product(ccstr, StartFlightRecording, NULL,                       \
4008           "Start flight recording with options"))                           \
4009                                                                             \
4010   JFR_ONLY(product(bool, UnlockCommercialFeatures, false,                   \
4011           "This flag is ignored. Left for compatibility"))                  \
4012                                                                             \
4013   experimental(bool, UseFastUnorderedTimeStamps, false,                     \
4014           "Use platform unstable time where supported for timestamps only") \
4015                                                                             \
4016   JFR_ONLY(product(bool, LogJFR, false,                                     \
4017           "Enable JFR logging (consider +Verbose)"))                        \
4018 
4019 /*
4020  *  Macros for factoring of globals
4021  */
4022 
4023 // Interface macros
4024 #define DECLARE_PRODUCT_FLAG(type, name, value, doc)      extern "C" type name;
4025 #define DECLARE_PD_PRODUCT_FLAG(type, name, doc)          extern "C" type name;
4026 #define DECLARE_DIAGNOSTIC_FLAG(type, name, value, doc)   extern "C" type name;
4027 #define DECLARE_EXPERIMENTAL_FLAG(type, name, value, doc) extern "C" type name;
4028 #define DECLARE_MANAGEABLE_FLAG(type, name, value, doc)   extern "C" type name;
4029 #define DECLARE_PRODUCT_RW_FLAG(type, name, value, doc)   extern "C" type name;
4030 #ifdef PRODUCT
4031 #define DECLARE_DEVELOPER_FLAG(type, name, value, doc)    extern "C" type CONST_##name; const type name = value;
4032 #define DECLARE_PD_DEVELOPER_FLAG(type, name, doc)        extern "C" type CONST_##name; const type name = pd_##name;
4033 #define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc)   extern "C" type CONST_##name;
4034 #else
4035 #define DECLARE_DEVELOPER_FLAG(type, name, value, doc)    extern "C" type name;
4036 #define DECLARE_PD_DEVELOPER_FLAG(type, name, doc)        extern "C" type name;
4037 #define DECLARE_NOTPRODUCT_FLAG(type, name, value, doc)   extern "C" type name;


< prev index next >