Skip to content

Commit d70aa71

Browse files
committed
one another cleanup round
1 parent 29e7804 commit d70aa71

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/hotspot/share/code/codeCache.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -178,16 +178,13 @@ GrowableArray<CodeHeap*>* CodeCache::_compiled_heaps = new(mtCode) GrowableArray
178178
GrowableArray<CodeHeap*>* CodeCache::_nmethod_heaps = new(mtCode) GrowableArray<CodeHeap*> (static_cast<int>(CodeBlobType::All), mtCode);
179179
GrowableArray<CodeHeap*>* CodeCache::_allocable_heaps = new(mtCode) GrowableArray<CodeHeap*> (static_cast<int>(CodeBlobType::All), mtCode);
180180

181-
static bool check_min_size(const char *codeheap, size_t size, size_t required_size) {
182-
if (size >= required_size) {
183-
return true;
184-
} else {
181+
static void check_min_size(const char *codeheap, size_t size, size_t required_size) {
182+
if (size < required_size) {
185183
log_debug(codecache)("Code heap (%s) size " SIZE_FORMAT " below required minimal size " SIZE_FORMAT,
186184
codeheap, size, required_size);
187185
err_msg title("Not enough space in %s to run VM", codeheap);
188186
err_msg message(SIZE_FORMAT "K < " SIZE_FORMAT "K", size/K, required_size/K);
189187
vm_exit_during_initialization(title, message);
190-
return false;
191188
}
192189
}
193190

@@ -226,8 +223,7 @@ void CodeCache::initialize_heaps() {
226223
}
227224

228225
if (!heap_available(CodeBlobType::MethodNonProfiled)) {
229-
// MethodNonProfiled heap is always available for segmented code heap
230-
ShouldNotReachHere();
226+
assert(false, "MethodNonProfiled heap is always available for segmented code heap");
231227
}
232228

233229
size_t compiler_buffer_size = 0;
@@ -252,7 +248,6 @@ void CodeCache::initialize_heaps() {
252248
}
253249

254250
// Compatibility.
255-
// Override Non-NMethod default size if two other segments are set explicitly
256251
size_t non_nmethod_min_size = min_cache_size + compiler_buffer_size;
257252
if (!non_nmethod.set && profiled.set && non_profiled.set) {
258253
set_size_of_unset_code_heap(&non_nmethod, cache_size, profiled.size + non_profiled.size, non_nmethod_min_size);
@@ -273,11 +268,15 @@ void CodeCache::initialize_heaps() {
273268

274269
// Validation
275270
// Check minimal required sizes
276-
if (!check_min_size("non-nmethod code heap", non_nmethod.size, non_nmethod_min_size) ||
277-
(profiled.enabled && !check_min_size("profiled code heap", profiled.size, min_size)) ||
278-
(non_profiled.enabled && !check_min_size("non-profiled code heap", non_profiled.size, min_size)) ||
279-
(cache_size_set && !check_min_size("reserved code cache", cache_size, min_cache_size))) {
280-
return;
271+
check_min_size("non-nmethod code heap", non_nmethod.size, non_nmethod_min_size);
272+
if (profiled.enabled) {
273+
check_min_size("profiled code heap", profiled.size, min_size);
274+
}
275+
if (non_profiled.enabled) {
276+
check_min_size("non-profiled code heap", non_profiled.size, min_size);
277+
}
278+
if (cache_size_set) {
279+
check_min_size("reserved code cache", cache_size, min_cache_size);
281280
}
282281

283282
// ReservedCodeCacheSize was set explicitly, so report an error and abort if it doesn't match the segment sizes
@@ -294,7 +293,6 @@ void CodeCache::initialize_heaps() {
294293
message.append("ReservedCodeCacheSize (" SIZE_FORMAT "K).", cache_size/K);
295294

296295
vm_exit_during_initialization("Invalid code heap sizes", message);
297-
return;
298296
}
299297

300298
// Compatibility. Print warning if using large pages but not able to use the size given

0 commit comments

Comments
 (0)