Skip to content

Commit 0a32077

Browse files
shipilevVladimir Kozlov
authored and
Vladimir Kozlov
committedFeb 11, 2025
8349457: [leyden] Workaround Leyden problems with -XX:-TieredCompilation
Reviewed-by: asmehra, iveresov, vlivanov
1 parent ccc8d7a commit 0a32077

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
 

‎src/hotspot/share/cds/heapShared.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@ oop HeapShared::get_archived_object(int permanent_index) {
394394
// table[i] = offset of oop whose permanent index is i.
395395
void CachedCodeDirectoryInternal::dumptime_init_internal() {
396396
const int count = _dumptime_permanent_oop_count;
397+
if (count == 0) {
398+
// Avoid confusing CDS code with zero-sized tables, just return.
399+
log_info(cds)("No permanent oops");
400+
_permanent_oop_count = count;
401+
_permanent_oop_offsets = nullptr;
402+
return;
403+
}
404+
397405
int* table = (int*)CDSAccess::allocate_from_code_cache(count * sizeof(int));
398406
for (int i = 0; i < count; i++) {
399407
table[count] = -1;

‎src/hotspot/share/compiler/compilerDefinitions.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,13 @@ void CompilerConfig::set_compilation_policy_flags() {
334334
}
335335
}
336336

337+
// Current Leyden implementation requires SegmentedCodeCache: the archive-backed code
338+
// cache would be initialized only then. Force SegmentedCodeCache if we are loading/storing
339+
// cached code. TODO: Resolve this in code cache initialization code.
340+
if (!SegmentedCodeCache && (LoadCachedCode || StoreCachedCode)) {
341+
FLAG_SET_ERGO(SegmentedCodeCache, true);
342+
}
343+
337344
if (CompileThresholdScaling < 0) {
338345
vm_exit_during_initialization("Negative value specified for CompileThresholdScaling", nullptr);
339346
}

0 commit comments

Comments
 (0)
Please sign in to comment.