8179618: Fixes for range of OptoLoopAlignment and Inlining flags
authorgoetz
Fri, 28 Apr 2017 14:34:24 +0200
changeset 46486 314aa24e62d6
parent 46485 f10c8f2b4651
child 46487 f8e5223d1501
8179618: Fixes for range of OptoLoopAlignment and Inlining flags Summary: OptoLoopAlignment must be multiple of NOP size. Inlining flags must not exceed WarmCallInfo::MAX_VALUE(). Reviewed-by: kvn, stuefe
hotspot/src/share/vm/opto/c2_globals.hpp
hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp
--- a/hotspot/src/share/vm/opto/c2_globals.hpp	Mon May 22 09:07:16 2017 -0700
+++ b/hotspot/src/share/vm/opto/c2_globals.hpp	Fri Apr 28 14:34:24 2017 +0200
@@ -420,37 +420,38 @@
   develop(bool, InlineWarmCalls, false,                                     \
           "Use a heat-based priority queue to govern inlining")             \
                                                                             \
+  /* Max values must not exceed WarmCallInfo::MAX_VALUE(). */               \
   develop(intx, HotCallCountThreshold, 999999,                              \
           "large numbers of calls (per method invocation) force hotness")   \
-          range(0, max_intx)                                                \
+          range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))      \
                                                                             \
   develop(intx, HotCallProfitThreshold, 999999,                             \
           "highly profitable inlining opportunities force hotness")         \
-          range(0, max_intx)                                                \
+          range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))      \
                                                                             \
   develop(intx, HotCallTrivialWork, -1,                                     \
           "trivial execution time (no larger than this) forces hotness")    \
-          range(-1, max_intx)                                               \
+          range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))     \
                                                                             \
   develop(intx, HotCallTrivialSize, -1,                                     \
           "trivial methods (no larger than this) force calls to be hot")    \
-          range(-1, max_intx)                                               \
+          range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))     \
                                                                             \
   develop(intx, WarmCallMinCount, -1,                                       \
           "number of calls (per method invocation) to enable inlining")     \
-          range(-1, max_intx)                                               \
+          range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))     \
                                                                             \
   develop(intx, WarmCallMinProfit, -1,                                      \
           "number of calls (per method invocation) to enable inlining")     \
-          range(-1, max_intx)                                               \
+          range(-1, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))     \
                                                                             \
   develop(intx, WarmCallMaxWork, 999999,                                    \
           "execution time of the largest inlinable method")                 \
-          range(0, max_intx)                                                \
+          range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))      \
                                                                             \
   develop(intx, WarmCallMaxSize, 999999,                                    \
           "size of the largest inlinable method")                           \
-          range(0, max_intx)                                                \
+          range(0, ((intx)MIN2((int64_t)max_intx,(int64_t)(+1.0e10))))      \
                                                                             \
   product(intx, MaxNodeLimit, 80000,                                        \
           "Maximum number of nodes")                                        \
--- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Mon May 22 09:07:16 2017 -0700
+++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsCompiler.cpp	Fri Apr 28 14:34:24 2017 +0200
@@ -276,14 +276,15 @@
     return Flag::VIOLATES_CONSTRAINT;
   }
 
-#ifdef SPARC
+  // Relevant on ppc, s390, sparc. Will be optimized where
+  // addr_unit() == 1.
   if (OptoLoopAlignment % relocInfo::addr_unit() != 0) {
     CommandLineError::print(verbose,
                             "OptoLoopAlignment (" INTX_FORMAT ") must be "
-                            "multiple of NOP size\n");
+                            "multiple of NOP size (%d)\n",
+                            value, relocInfo::addr_unit());
     return Flag::VIOLATES_CONSTRAINT;
   }
-#endif
 
   return Flag::SUCCESS;
 }