< prev index next >

src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/relocInfo.hpp"
  27 #include "compiler/compilerDefinitions.hpp"

  28 #include "oops/metadata.hpp"
  29 #include "runtime/os.hpp"
  30 #include "interpreter/invocationCounter.hpp"
  31 #include "runtime/arguments.hpp"
  32 #include "runtime/flags/jvmFlag.hpp"
  33 #include "runtime/flags/jvmFlagConstraintsCompiler.hpp"
  34 #include "runtime/globals.hpp"
  35 #include "runtime/globals_extension.hpp"
  36 #include "utilities/powerOfTwo.hpp"
  37 
  38 JVMFlag::Error AliasLevelConstraintFunc(intx value, bool verbose) {
  39   if ((value <= 1) && (Arguments::mode() == Arguments::_comp || Arguments::mode() == Arguments::_mixed)) {
  40     JVMFlag::printError(verbose,
  41                         "AliasLevel (" INTX_FORMAT ") is not "
  42                         "compatible with -Xcomp or -Xmixed\n",
  43                         value);
  44     return JVMFlag::VIOLATES_CONSTRAINT;
  45   } else {
  46     return JVMFlag::SUCCESS;
  47   }


 359                         "NodeLimitFudgeFactor must be between 2%% and 40%% "
 360                         "of MaxNodeLimit (" INTX_FORMAT ")\n",
 361                         MaxNodeLimit);
 362     return JVMFlag::VIOLATES_CONSTRAINT;
 363   }
 364 
 365   return JVMFlag::SUCCESS;
 366 }
 367 #endif // COMPILER2
 368 
 369 JVMFlag::Error RTMTotalCountIncrRateConstraintFunc(int value, bool verbose) {
 370 #if INCLUDE_RTM_OPT
 371   if (UseRTMLocking && !is_power_of_2(RTMTotalCountIncrRate)) {
 372     JVMFlag::printError(verbose,
 373                         "RTMTotalCountIncrRate (%d) must be "
 374                         "a power of 2, resetting it to 64\n",
 375                         RTMTotalCountIncrRate);
 376     FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
 377   }
 378 #endif
























 379 
 380   return JVMFlag::SUCCESS;
 381 }


   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "code/relocInfo.hpp"
  27 #include "compiler/compilerDefinitions.hpp"
  28 #include "compiler/compilerDirectives.hpp"
  29 #include "oops/metadata.hpp"
  30 #include "runtime/os.hpp"
  31 #include "interpreter/invocationCounter.hpp"
  32 #include "runtime/arguments.hpp"
  33 #include "runtime/flags/jvmFlag.hpp"
  34 #include "runtime/flags/jvmFlagConstraintsCompiler.hpp"
  35 #include "runtime/globals.hpp"
  36 #include "runtime/globals_extension.hpp"
  37 #include "utilities/powerOfTwo.hpp"
  38 
  39 JVMFlag::Error AliasLevelConstraintFunc(intx value, bool verbose) {
  40   if ((value <= 1) && (Arguments::mode() == Arguments::_comp || Arguments::mode() == Arguments::_mixed)) {
  41     JVMFlag::printError(verbose,
  42                         "AliasLevel (" INTX_FORMAT ") is not "
  43                         "compatible with -Xcomp or -Xmixed\n",
  44                         value);
  45     return JVMFlag::VIOLATES_CONSTRAINT;
  46   } else {
  47     return JVMFlag::SUCCESS;
  48   }


 360                         "NodeLimitFudgeFactor must be between 2%% and 40%% "
 361                         "of MaxNodeLimit (" INTX_FORMAT ")\n",
 362                         MaxNodeLimit);
 363     return JVMFlag::VIOLATES_CONSTRAINT;
 364   }
 365 
 366   return JVMFlag::SUCCESS;
 367 }
 368 #endif // COMPILER2
 369 
 370 JVMFlag::Error RTMTotalCountIncrRateConstraintFunc(int value, bool verbose) {
 371 #if INCLUDE_RTM_OPT
 372   if (UseRTMLocking && !is_power_of_2(RTMTotalCountIncrRate)) {
 373     JVMFlag::printError(verbose,
 374                         "RTMTotalCountIncrRate (%d) must be "
 375                         "a power of 2, resetting it to 64\n",
 376                         RTMTotalCountIncrRate);
 377     FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
 378   }
 379 #endif
 380 
 381   return JVMFlag::SUCCESS;
 382 }
 383 
 384 JVMFlag::Error DisableIntrinsicConstraintFunc(ccstrlist value, bool verbose) {
 385   ControlIntrinsicValidator validator(value, true/*disabled_all*/);
 386   if (!validator.is_valid()) {
 387     JVMFlag::printError(verbose,
 388                         "An unrecognized intrinsic is detected in DisableIntrinsic: %s\n",
 389                         validator.what());
 390     return JVMFlag::VIOLATES_CONSTRAINT;
 391   }
 392 
 393   return JVMFlag::SUCCESS;
 394 }
 395 
 396 JVMFlag::Error ControlIntrinsicConstraintFunc(ccstrlist value, bool verbose) {
 397   ControlIntrinsicValidator validator(value, false/*disabled_all*/);
 398   if (!validator.is_valid()) {
 399     JVMFlag::printError(verbose,
 400                         "An unrecognized intrinsic is detected in ControlIntrinsic: %s\n",
 401                         validator.what());
 402     return JVMFlag::VIOLATES_CONSTRAINT;
 403   }
 404 
 405   return JVMFlag::SUCCESS;
 406 }
< prev index next >