Skip to content

Commit 8e3688f

Browse files
committed
move the changes in flag constraints specific file
1 parent 55af21f commit 8e3688f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/hotspot/share/code/codeCache.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,9 +1106,6 @@ size_t CodeCache::freelists_length() {
11061106
void icache_init();
11071107

11081108
void CodeCache::initialize() {
1109-
if (!is_power_of_2(CodeCacheSegmentSize)) {
1110-
vm_exit_during_initialization(err_msg("CodeCacheSegmentSize should be a power of 2"));
1111-
}
11121109
assert(CodeCacheSegmentSize >= (uintx)CodeEntryAlignment, "CodeCacheSegmentSize must be large enough to align entry points");
11131110
#ifdef COMPILER2
11141111
assert(CodeCacheSegmentSize >= (uintx)OptoLoopAlignment, "CodeCacheSegmentSize must be large enough to align inner loops");

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ JVMFlag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose)
156156
}
157157

158158
JVMFlag::Error CodeCacheSegmentSizeConstraintFunc(uintx value, bool verbose) {
159+
if (!is_power_of_2(value)) {
160+
JVMFlag::printError(verbose,
161+
"CodeCacheSegmentSize (%zd) must be "
162+
"a power of two\n", CodeCacheSegmentSize);
163+
return JVMFlag::VIOLATES_CONSTRAINT;
164+
}
165+
159166
if (CodeCacheSegmentSize < (uintx)CodeEntryAlignment) {
160167
JVMFlag::printError(verbose,
161168
"CodeCacheSegmentSize (%zu) must be "

0 commit comments

Comments
 (0)