--- old/src/share/vm/runtime/globals.hpp 2015-07-15 00:07:01.052868199 -0700 +++ new/src/share/vm/runtime/globals.hpp 2015-07-15 00:07:00.948868196 -0700 @@ -450,7 +450,6 @@ class CommandLineFlags { - static bool _finished_initializing; public: static Flag::Error boolAt(const char* name, size_t len, bool* value, bool allow_locked = false, bool return_flag = false); static Flag::Error boolAt(const char* name, bool* value, bool allow_locked = false, bool return_flag = false) { return boolAt(name, strlen(name), value, allow_locked, return_flag); } @@ -506,11 +505,11 @@ // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges static void printFlags(outputStream* out, bool withComments, bool printRanges = false); - // Returns true if all flags have their final values set (ready for ranges and constraint check) - static bool finishedInitializing() { return _finished_initializing; } + // Check the final values of all flags for ranges and all flags for 'AfterParse' constraints + static bool check_ranges_and_constraints_of_after_parse(); - // Check the final values of all flags for ranges and constraints - static bool check_all_ranges_and_constraints(); + // Check the final values of all flags for 'AfterMemoryInit' constraints + static bool check_constraints_of_after_memory_init(); static void verify() PRODUCT_RETURN; }; @@ -640,7 +639,7 @@ lp64_product(intx, ObjectAlignmentInBytes, 8, \ "Default object alignment in bytes, 8 is minimum") \ range(8, 256) \ - constraint(ObjectAlignmentInBytesConstraintFunc) \ + constraint(ObjectAlignmentInBytesConstraintFunc,Anytime) \ \ product(bool, AssumeMP, false, \ "Instruct the VM to assume multiple processors are available") \ @@ -1394,7 +1393,7 @@ product(intx, ContendedPaddingWidth, 128, \ "How many bytes to pad the fields/classes marked @Contended with")\ range(0, 8192) \ - constraint(ContendedPaddingWidthConstraintFunc) \ + constraint(ContendedPaddingWidthConstraintFunc,Anytime) \ \ product(bool, EnableContended, true, \ "Enable @Contended annotation support") \ @@ -1595,6 +1594,7 @@ \ product(size_t, YoungPLABSize, 4096, \ "Size of young gen promotion LAB's (in HeapWords)") \ + constraint(YoungPLABSizeConstraintFunc,AfterMemoryInit) \ \ product(size_t, OldPLABSize, 1024, \ "Size of old gen promotion LAB's (in HeapWords), or Number \ @@ -1733,7 +1733,7 @@ "Minimum size of CMS gen promotion LAB caches per worker " \ "per block size") \ range(1, max_uintx) \ - constraint(CMSOldPLABMinConstraintFunc) \ + constraint(CMSOldPLABMinConstraintFunc,AfterParse) \ \ product(uintx, CMSOldPLABNumRefills, 4, \ "Nominal number of refills of CMS gen promotion LAB cache " \ @@ -1929,13 +1929,13 @@ "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \ "ratio") \ range(1, max_uintx) \ - constraint(CMSPrecleanDenominatorConstraintFunc) \ + constraint(CMSPrecleanDenominatorConstraintFunc,AfterParse) \ \ product(uintx, CMSPrecleanNumerator, 2, \ "CMSPrecleanNumerator:CMSPrecleanDenominator yields convergence " \ "ratio") \ range(0, max_uintx-1) \ - constraint(CMSPrecleanNumeratorConstraintFunc) \ + constraint(CMSPrecleanNumeratorConstraintFunc,AfterParse) \ \ product(bool, CMSPrecleanRefLists1, true, \ "Preclean ref lists during (initial) preclean phase") \ @@ -3356,14 +3356,14 @@ " For most GCs this applies to the old generation. In G1 and" \ " ParallelGC it applies to the whole heap.") \ range(0, 100) \ - constraint(MinHeapFreeRatioConstraintFunc) \ + constraint(MinHeapFreeRatioConstraintFunc,AfterParse) \ \ manageable(uintx, MaxHeapFreeRatio, 70, \ "The maximum percentage of heap free after GC to avoid shrinking."\ " For most GCs this applies to the old generation. In G1 and" \ " ParallelGC it applies to the whole heap.") \ range(0, 100) \ - constraint(MaxHeapFreeRatioConstraintFunc) \ + constraint(MaxHeapFreeRatioConstraintFunc,AfterParse) \ \ product(intx, SoftRefLRUPolicyMSPerMB, 1000, \ "Number of milliseconds per MB of free space in the heap") \ @@ -3378,13 +3378,13 @@ "The maximum percentage of Metaspace free after GC to avoid " \ "shrinking") \ range(0, 100) \ - constraint(MaxMetaspaceFreeRatioConstraintFunc) \ + constraint(MaxMetaspaceFreeRatioConstraintFunc,AfterParse) \ \ product(uintx, MinMetaspaceFreeRatio, 40, \ "The minimum percentage of Metaspace free after GC to avoid " \ "expansion") \ range(0, 99) \ - constraint(MinMetaspaceFreeRatioConstraintFunc) \ + constraint(MinMetaspaceFreeRatioConstraintFunc,AfterParse) \ \ product(size_t, MaxMetaspaceExpansion, ScaleForWordSize(4*M), \ "The maximum expansion of Metaspace without full GC (in bytes)") \ @@ -3402,12 +3402,12 @@ product(uintx, MaxTenuringThreshold, 15, \ "Maximum value for tenuring threshold") \ range(0, markOopDesc::max_age + 1) \ - constraint(MaxTenuringThresholdConstraintFunc) \ + constraint(MaxTenuringThresholdConstraintFunc,AfterParse) \ \ product(uintx, InitialTenuringThreshold, 7, \ "Initial value for tenuring threshold") \ range(0, markOopDesc::max_age + 1) \ - constraint(InitialTenuringThresholdConstraintFunc) \ + constraint(InitialTenuringThresholdConstraintFunc,AfterParse) \ \ product(uintx, TargetSurvivorRatio, 50, \ "Desired percentage of survivor space used after scavenge") \ @@ -4091,7 +4091,7 @@ \ experimental(intx, SurvivorAlignmentInBytes, 0, \ "Default survivor space alignment in bytes") \ - constraint(SurvivorAlignmentInBytesConstraintFunc) \ + constraint(SurvivorAlignmentInBytesConstraintFunc,AfterParse) \ \ product(bool , AllowNonVirtualCalls, false, \ "Obey the ACC_SUPER flag and allow invokenonvirtual calls") \ @@ -4191,7 +4191,7 @@ // Only materialize src code for range checking when required, ignore otherwise #define IGNORE_RANGE(a, b) // Only materialize src code for contraint checking when required, ignore otherwise -#define IGNORE_CONSTRAINT(func) +#define IGNORE_CONSTRAINT(func,type) RUNTIME_FLAGS(DECLARE_DEVELOPER_FLAG, \ DECLARE_PD_DEVELOPER_FLAG, \