Skip to content

Commit 5fa3e60

Browse files
committed
8377351: [lworld] runtime/clinit/ClassInitBarrier.java crashes with SIGSEGV/EAV with AOT class linking and --enable-preview
Reviewed-by: chagedorn, thartmann
1 parent 5c7f265 commit 5fa3e60

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

src/hotspot/share/code/aotCodeCache.cpp

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,21 +508,32 @@ bool AOTCodeCache::Config::verify(AOTCodeCache* cache) const {
508508
return false;
509509
}
510510

511-
// The following checks do not affect AOT adapters caching
511+
// The following checks do not affect AOT code, but can disable
512+
// AOT stub/adapters caching if they are incompatible with runtime settings
513+
// (adapters too as they access oops when buffering scalarized value objects).
512514

513515
if (((_flags & compressedOops) != 0) != UseCompressedOops) {
514-
log_debug(aot, codecache, init)("AOT Code Cache disabled: it was created with UseCompressedOops = %s", UseCompressedOops ? "false" : "true");
516+
log_debug(aot, codecache, init)("AOT Stub/Adapter Cache disabled: it was created with UseCompressedOops = %s", UseCompressedOops ? "false" : "true");
515517
AOTStubCaching = false;
518+
if (InlineTypePassFieldsAsArgs) {
519+
AOTAdapterCaching = false;
520+
}
516521
}
517522
if (_compressedOopShift != (uint)CompressedOops::shift()) {
518-
log_debug(aot, codecache, init)("AOT Code Cache disabled: it was created with different CompressedOops::shift(): %d vs current %d", _compressedOopShift, CompressedOops::shift());
523+
log_debug(aot, codecache, init)("AOT Stub/Adapter Cache disabled: it was created with different CompressedOops::shift(): %d vs current %d", _compressedOopShift, CompressedOops::shift());
519524
AOTStubCaching = false;
525+
if (InlineTypePassFieldsAsArgs) {
526+
AOTAdapterCaching = false;
527+
}
520528
}
521529

522-
// This should be the last check as it only disables AOTStubCaching
530+
// This should be the last check as it only disables AOTStub/AdapterCaching
523531
if ((_compressedOopBase == nullptr || CompressedOops::base() == nullptr) && (_compressedOopBase != CompressedOops::base())) {
524-
log_debug(aot, codecache, init)("AOTStubCaching is disabled: incompatible CompressedOops::base(): %p vs current %p", _compressedOopBase, CompressedOops::base());
532+
log_debug(aot, codecache, init)("AOT Stub/Adapter Cache disabled: incompatible CompressedOops::base(): %p vs current %p", _compressedOopBase, CompressedOops::base());
525533
AOTStubCaching = false;
534+
if (InlineTypePassFieldsAsArgs) {
535+
AOTAdapterCaching = false;
536+
}
526537
}
527538

528539
if (!verify_cpu_features(cache)) {

test/hotspot/jtreg/runtime/cds/appcds/aotCode/AOTCodeCompressedOopsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ public void checkExecution(OutputAnalyzer out, RunMode runMode) throws Exception
202202
throw new RuntimeException("Failed to find CompressedOops settings");
203203
}
204204
if (aotCacheShift != currentShift) {
205-
out.shouldContain("AOT Code Cache disabled: it was created with different CompressedOops::shift()");
205+
out.shouldContain("AOT Stub/Adapter Cache disabled: it was created with different CompressedOops::shift()");
206206
} else if ((aotCacheBase == 0 || currentBase == 0) && (aotCacheBase != currentBase)) {
207-
out.shouldContain("AOTStubCaching is disabled: incompatible CompressedOops::base()");
207+
out.shouldContain("AOT Stub/Adapter Cache disabled: incompatible CompressedOops::base()");
208208
} else {
209209
out.shouldMatch("Read \\d+ entries table at offset \\d+ from AOT Code Cache");
210210
}

0 commit comments

Comments
 (0)