@@ -178,16 +178,13 @@ GrowableArray<CodeHeap*>* CodeCache::_compiled_heaps = new(mtCode) GrowableArray
178
178
GrowableArray<CodeHeap*>* CodeCache::_nmethod_heaps = new (mtCode) GrowableArray<CodeHeap*> (static_cast <int >(CodeBlobType::All), mtCode);
179
179
GrowableArray<CodeHeap*>* CodeCache::_allocable_heaps = new (mtCode) GrowableArray<CodeHeap*> (static_cast <int >(CodeBlobType::All), mtCode);
180
180
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) {
185
183
log_debug (codecache)(" Code heap (%s) size " SIZE_FORMAT " below required minimal size " SIZE_FORMAT,
186
184
codeheap, size, required_size);
187
185
err_msg title (" Not enough space in %s to run VM" , codeheap);
188
186
err_msg message (SIZE_FORMAT " K < " SIZE_FORMAT " K" , size/K, required_size/K);
189
187
vm_exit_during_initialization (title, message);
190
- return false ;
191
188
}
192
189
}
193
190
@@ -226,8 +223,7 @@ void CodeCache::initialize_heaps() {
226
223
}
227
224
228
225
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" );
231
227
}
232
228
233
229
size_t compiler_buffer_size = 0 ;
@@ -252,7 +248,6 @@ void CodeCache::initialize_heaps() {
252
248
}
253
249
254
250
// Compatibility.
255
- // Override Non-NMethod default size if two other segments are set explicitly
256
251
size_t non_nmethod_min_size = min_cache_size + compiler_buffer_size;
257
252
if (!non_nmethod.set && profiled.set && non_profiled.set ) {
258
253
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() {
273
268
274
269
// Validation
275
270
// 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);
281
280
}
282
281
283
282
// 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() {
294
293
message.append (" ReservedCodeCacheSize (" SIZE_FORMAT " K)." , cache_size/K);
295
294
296
295
vm_exit_during_initialization (" Invalid code heap sizes" , message);
297
- return ;
298
296
}
299
297
300
298
// Compatibility. Print warning if using large pages but not able to use the size given
0 commit comments