move the changes in flag constraints specific file

This commit is contained in:
Amit Kumar 2025-06-10 08:35:07 +00:00
parent 55af21fdf1
commit 8e3688fd66
2 changed files with 7 additions and 3 deletions

View File

@ -1106,9 +1106,6 @@ size_t CodeCache::freelists_length() {
void icache_init();
void CodeCache::initialize() {
if (!is_power_of_2(CodeCacheSegmentSize)) {
vm_exit_during_initialization(err_msg("CodeCacheSegmentSize should be a power of 2"));
}
assert(CodeCacheSegmentSize >= (uintx)CodeEntryAlignment, "CodeCacheSegmentSize must be large enough to align entry points");
#ifdef COMPILER2
assert(CodeCacheSegmentSize >= (uintx)OptoLoopAlignment, "CodeCacheSegmentSize must be large enough to align inner loops");

View File

@ -156,6 +156,13 @@ JVMFlag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose)
}
JVMFlag::Error CodeCacheSegmentSizeConstraintFunc(uintx value, bool verbose) {
if (!is_power_of_2(value)) {
JVMFlag::printError(verbose,
"CodeCacheSegmentSize (%zd) must be "
"a power of two\n", CodeCacheSegmentSize);
return JVMFlag::VIOLATES_CONSTRAINT;
}
if (CodeCacheSegmentSize < (uintx)CodeEntryAlignment) {
JVMFlag::printError(verbose,
"CodeCacheSegmentSize (%zu) must be "