Skip to content

Commit a89eade

Browse files
authored
Merge pull request #1972 from SAP/pr-jdk-25+24
Merge to tag jdk-25+24
2 parents 6f7f3b7 + b685ea5 commit a89eade

File tree

806 files changed

+38265
-23643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

806 files changed

+38265
-23643
lines changed

make/CompileInterimLangtools.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ define SetupInterimModule
9999
EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
100100
$(TOPDIR)/src/$1/share/classes/javax/tools/ToolProvider.java \
101101
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/Main.java \
102+
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryClassLoader.java \
102103
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryContext.java \
103104
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/MemoryModuleFinder.java \
104105
$(TOPDIR)/src/$1/share/classes/com/sun/tools/javac/launcher/SourceLauncher.java \

make/Docs.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ JAVADOC_DISABLED_DOCLINT_PACKAGES := org.w3c.* javax.smartcardio
9898
JAVADOC_OPTIONS := -use -keywords -notimestamp \
9999
-serialwarn -encoding utf-8 -docencoding utf-8 -breakiterator \
100100
-splitIndex --system none -javafx --expand-requires transitive \
101-
--override-methods=summary --syntax-highlight
101+
--override-methods=summary
102102

103103
# The reference options must stay stable to allow for comparisons across the
104104
# development cycle.

make/GenerateLinkOptData.gmk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,13 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
7676
$(call LogInfo, Generating $(patsubst $(OUTPUTDIR)/%, %, $(JLI_TRACE_FILE)))
7777
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -XX:DumpLoadedClassList=$@.raw \
7878
$(CLASSLIST_FILE_VM_OPTS) \
79+
-Xlog:aot=off \
7980
-Xlog:cds=off \
8081
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
8182
build.tools.classlist.HelloClasslist $(LOG_DEBUG)
8283
$(GREP) -v HelloClasslist $@.raw > $@.interim
8384
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java -Xshare:dump \
85+
-Xlog:aot=off \
8486
-Xlog:cds=off \
8587
-XX:SharedClassListFile=$@.interim -XX:SharedArchiveFile=$@.jsa \
8688
-Xmx128M -Xms128M $(LOG_INFO)
@@ -89,6 +91,7 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
8991
-Djava.lang.invoke.MethodHandle.TRACE_RESOLVE=true \
9092
$(CLASSLIST_FILE_VM_OPTS) \
9193
--module-path $(SUPPORT_OUTPUTDIR)/classlist.jar \
94+
-Xlog:aot=off \
9295
-Xlog:cds=off \
9396
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
9497
build.tools.classlist.HelloClasslist \
@@ -103,6 +106,7 @@ $(CLASSLIST_FILE): $(INTERIM_IMAGE_DIR)/bin/java$(EXECUTABLE_SUFFIX) $(CLASSLIST
103106
$(GREP) -v HelloClasslist $@.raw.2 > $@.raw.3
104107
$(GREP) -v @cp $@.raw.3 > $@.raw.4
105108
$(FIXPATH) $(INTERIM_IMAGE_DIR)/bin/java \
109+
-Xlog:aot=off \
106110
-Xlog:cds=off \
107111
-cp $(SUPPORT_OUTPUTDIR)/classlist.jar \
108112
build.tools.classlist.SortClasslist $@.raw.4 > $@

make/Images.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ define CreateCDSArchive
163163
endif
164164

165165
ifeq ($(DEBUG_CDS_ARCHIVE), true)
166-
$1_$2_CDS_DUMP_FLAGS += -Xlog:cds+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0
166+
$1_$2_CDS_DUMP_FLAGS += -Xlog:aot+map*=trace:file=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE).cdsmap:none:filesize=0
167167
endif
168168

169169
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jdk, \

make/RunTests.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,15 +754,15 @@ define SetupAOTBody
754754
cd $$($1_AOT_JDK_OUTPUT_DIR); \
755755
$(JAR) --extract --file $(TEST_IMAGE_DIR)/setup_aot/TestSetupAOT.jar; \
756756
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java $$($1_VM_OPTIONS) \
757-
-Xlog:class+load,cds,cds+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error \
757+
-Xlog:class+load,aot,aot+class=debug:file=$$($1_AOT_JDK_CONF).log -Xlog:cds*=error -Xlog:aot*=error \
758758
-XX:AOTMode=record -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) \
759759
TestSetupAOT $$($1_AOT_JDK_OUTPUT_DIR) > $$($1_AOT_JDK_LOG) \
760760
))
761761

762762
$$(call LogWarn, AOT: Generate AOT cache $$($1_AOT_JDK_CACHE) with flags: $$($1_VM_OPTIONS))
763763
$$(call ExecuteWithLog, $$($1_AOT_JDK_OUTPUT_DIR), ( \
764764
$$(FIXPATH) $(JDK_UNDER_TEST)/bin/java \
765-
$$($1_VM_OPTIONS) -Xlog:cds,cds+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error \
765+
$$($1_VM_OPTIONS) -Xlog:aot,aot+class=debug:file=$$($1_AOT_JDK_CACHE).log -Xlog:cds*=error -Xlog:aot*=error \
766766
-XX:ExtraSharedClassListFile=$(JDK_UNDER_TEST)/lib/classlist \
767767
-XX:AOTMode=create -XX:AOTConfiguration=$$($1_AOT_JDK_CONF) -XX:AOTCache=$$($1_AOT_JDK_CACHE) \
768768
))

make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,18 @@ public void createSymbols(String ctDescriptionFileExtra, String ctDescriptionFil
304304
"Ljdk/internal/ValueBased;";
305305
private static final String VALUE_BASED_ANNOTATION_INTERNAL =
306306
"Ljdk/internal/ValueBased+Annotation;";
307+
private static final String REQUIRES_IDENTITY_ANNOTATION =
308+
"Ljdk/internal/RequiresIdentity;";
309+
private static final String REQUIRES_IDENTITY_ANNOTATION_INTERNAL =
310+
"Ljdk/internal/RequiresIdentity+Annotation;";
307311
public static final Set<String> HARDCODED_ANNOTATIONS = new HashSet<>(
308312
List.of("Ljdk/Profile+Annotation;",
309313
"Lsun/Proprietary+Annotation;",
310314
PREVIEW_FEATURE_ANNOTATION_OLD,
311315
PREVIEW_FEATURE_ANNOTATION_NEW,
312316
VALUE_BASED_ANNOTATION,
313-
RESTRICTED_ANNOTATION));
317+
RESTRICTED_ANNOTATION,
318+
REQUIRES_IDENTITY_ANNOTATION));
314319

315320
private void stripNonExistentAnnotations(LoadDescriptions data) {
316321
Set<String> allClasses = data.classes.name2Class.keySet();
@@ -1021,6 +1026,12 @@ private Annotation createAnnotation(AnnotationDescription desc) {
10211026
annotationType = VALUE_BASED_ANNOTATION_INTERNAL;
10221027
}
10231028

1029+
if (REQUIRES_IDENTITY_ANNOTATION.equals(annotationType)) {
1030+
//the non-public RequiresIdentity annotation will not be available in ct.sym,
1031+
//replace with purely synthetic javac-internal annotation:
1032+
annotationType = REQUIRES_IDENTITY_ANNOTATION_INTERNAL;
1033+
}
1034+
10241035
if (RESTRICTED_ANNOTATION.equals(annotationType)) {
10251036
//the non-public Restricted annotation will not be available in ct.sym,
10261037
//replace with purely synthetic javac-internal annotation:
@@ -2202,6 +2213,7 @@ private boolean readAttribute(FeatureDescription feature, Attribute<?> attr) {
22022213
chd.permittedSubclasses = a.permittedSubclasses().stream().map(ClassEntry::asInternalName).collect(Collectors.toList());
22032214
}
22042215
case ModuleMainClassAttribute a -> ((ModuleHeaderDescription) feature).moduleMainClass = a.mainClass().asInternalName();
2216+
case RuntimeVisibleTypeAnnotationsAttribute a -> {/* do nothing for now */}
22052217
default -> throw new IllegalArgumentException("Unhandled attribute: " + attr.attributeName()); // Do nothing
22062218
}
22072219

make/modules/jdk.jdwp.agent/Lib.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
8484
DISABLED_WARNINGS_clang_threadControl.c := unused-but-set-variable \
8585
unused-variable, \
8686
DISABLED_WARNINGS_clang_utf_util.c := unused-but-set-variable, \
87+
DISABLED_WARNINGS_microsoft_debugInit.c := 5287, \
8788
LDFLAGS := $(ICONV_LDFLAGS), \
8889
EXTRA_HEADER_DIRS := \
8990
include \

src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,20 @@ address C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register
107107
assert(is_power_of_2(unroll_factor), "can't use this value to calculate the jump target PC");
108108
andr(tmp2, cnt, unroll_factor - 1);
109109
adr(tmp1, BR_BASE);
110-
sub(tmp1, tmp1, tmp2, ext::sxtw, 3);
110+
// For Cortex-A53 offset is 4 because 2 nops are generated.
111+
sub(tmp1, tmp1, tmp2, ext::sxtw, VM_Version::supports_a53mac() ? 4 : 3);
111112
movw(tmp2, 0x1f);
112113
br(tmp1);
113114

114115
bind(LOOP);
115116
for (size_t i = 0; i < unroll_factor; ++i) {
116117
load(tmp1, Address(post(ary, type2aelembytes(eltype))), eltype);
117118
maddw(result, result, tmp2, tmp1);
119+
// maddw generates an extra nop for Cortex-A53 (see maddw definition in macroAssembler).
120+
// Generate 2nd nop to have 4 instructions per iteration.
121+
if (VM_Version::supports_a53mac()) {
122+
nop();
123+
}
118124
}
119125
bind(BR_BASE);
120126
subsw(cnt, cnt, unroll_factor);

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5340,7 +5340,41 @@ bool MacroAssembler::set_klass_decode_mode(address base, int shift, const size_t
53405340
return _klass_decode_mode != KlassDecodeNone;
53415341
}
53425342

5343+
static Register pick_different_tmp(Register dst, Register src) {
5344+
auto tmps = RegSet::of(r0, r1, r2) - RegSet::of(src, dst);
5345+
return *tmps.begin();
5346+
}
5347+
5348+
void MacroAssembler::encode_klass_not_null_for_aot(Register dst, Register src) {
5349+
// we have to load the klass base from the AOT constants area but
5350+
// not the shift because it is not allowed to change
5351+
int shift = CompressedKlassPointers::shift();
5352+
assert(shift >= 0 && shift <= CompressedKlassPointers::max_shift(), "unexpected compressed klass shift!");
5353+
if (dst != src) {
5354+
// we can load the base into dst, subtract it formthe src and shift down
5355+
lea(dst, ExternalAddress(CompressedKlassPointers::base_addr()));
5356+
ldr(dst, dst);
5357+
sub(dst, src, dst);
5358+
lsr(dst, dst, shift);
5359+
} else {
5360+
// we need an extra register in order to load the coop base
5361+
Register tmp = pick_different_tmp(dst, src);
5362+
RegSet regs = RegSet::of(tmp);
5363+
push(regs, sp);
5364+
lea(tmp, ExternalAddress(CompressedKlassPointers::base_addr()));
5365+
ldr(tmp, tmp);
5366+
sub(dst, src, tmp);
5367+
lsr(dst, dst, shift);
5368+
pop(regs, sp);
5369+
}
5370+
}
5371+
53435372
void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
5373+
if (AOTCodeCache::is_on_for_dump()) {
5374+
encode_klass_not_null_for_aot(dst, src);
5375+
return;
5376+
}
5377+
53445378
switch (klass_decode_mode()) {
53455379
case KlassDecodeZero:
53465380
if (CompressedKlassPointers::shift() != 0) {
@@ -5377,9 +5411,36 @@ void MacroAssembler::encode_klass_not_null(Register r) {
53775411
encode_klass_not_null(r, r);
53785412
}
53795413

5414+
void MacroAssembler::decode_klass_not_null_for_aot(Register dst, Register src) {
5415+
// we have to load the klass base from the AOT constants area but
5416+
// not the shift because it is not allowed to change
5417+
int shift = CompressedKlassPointers::shift();
5418+
assert(shift >= 0 && shift <= CompressedKlassPointers::max_shift(), "unexpected compressed klass shift!");
5419+
if (dst != src) {
5420+
// we can load the base into dst then add the offset with a suitable shift
5421+
lea(dst, ExternalAddress(CompressedKlassPointers::base_addr()));
5422+
ldr(dst, dst);
5423+
add(dst, dst, src, LSL, shift);
5424+
} else {
5425+
// we need an extra register in order to load the coop base
5426+
Register tmp = pick_different_tmp(dst, src);
5427+
RegSet regs = RegSet::of(tmp);
5428+
push(regs, sp);
5429+
lea(tmp, ExternalAddress(CompressedKlassPointers::base_addr()));
5430+
ldr(tmp, tmp);
5431+
add(dst, tmp, src, LSL, shift);
5432+
pop(regs, sp);
5433+
}
5434+
}
5435+
53805436
void MacroAssembler::decode_klass_not_null(Register dst, Register src) {
53815437
assert (UseCompressedClassPointers, "should only be used for compressed headers");
53825438

5439+
if (AOTCodeCache::is_on_for_dump()) {
5440+
decode_klass_not_null_for_aot(dst, src);
5441+
return;
5442+
}
5443+
53835444
switch (klass_decode_mode()) {
53845445
case KlassDecodeZero:
53855446
if (CompressedKlassPointers::shift() != 0) {
@@ -6654,7 +6715,7 @@ void MacroAssembler::get_thread(Register dst) {
66546715
protect_return_address();
66556716
push(saved_regs, sp);
66566717

6657-
mov(lr, CAST_FROM_FN_PTR(address, JavaThread::aarch64_get_thread_helper));
6718+
mov(lr, ExternalAddress(CAST_FROM_FN_PTR(address, JavaThread::aarch64_get_thread_helper)));
66586719
blr(lr);
66596720
if (dst != c_rarg0) {
66606721
mov(dst, c_rarg0);

src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,8 @@ class MacroAssembler: public Assembler {
935935

936936
void set_narrow_oop(Register dst, jobject obj);
937937

938+
void decode_klass_not_null_for_aot(Register dst, Register src);
939+
void encode_klass_not_null_for_aot(Register dst, Register src);
938940
void encode_klass_not_null(Register r);
939941
void decode_klass_not_null(Register r);
940942
void encode_klass_not_null(Register dst, Register src);

src/hotspot/cpu/aarch64/runtime_aarch64.cpp

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#ifdef COMPILER2
2727
#include "asm/macroAssembler.hpp"
2828
#include "asm/macroAssembler.inline.hpp"
29+
#include "code/aotCodeCache.hpp"
2930
#include "code/vmreg.hpp"
3031
#include "interpreter/interpreter.hpp"
3132
#include "opto/runtime.hpp"
@@ -60,10 +61,15 @@ class SimpleRuntimeFrame {
6061

6162
//------------------------------generate_uncommon_trap_blob--------------------
6263
UncommonTrapBlob* OptoRuntime::generate_uncommon_trap_blob() {
64+
const char* name = OptoRuntime::stub_name(OptoStubId::uncommon_trap_id);
65+
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::C2Blob, (uint)OptoStubId::uncommon_trap_id, name);
66+
if (blob != nullptr) {
67+
return blob->as_uncommon_trap_blob();
68+
}
69+
6370
// Allocate space for the code
6471
ResourceMark rm;
6572
// Setup code generation tools
66-
const char* name = OptoRuntime::stub_name(OptoStubId::uncommon_trap_id);
6773
CodeBuffer buffer(name, 2048, 1024);
6874
if (buffer.blob() == nullptr) {
6975
return nullptr;
@@ -246,8 +252,10 @@ UncommonTrapBlob* OptoRuntime::generate_uncommon_trap_blob() {
246252
// Make sure all code is generated
247253
masm->flush();
248254

249-
return UncommonTrapBlob::create(&buffer, oop_maps,
250-
SimpleRuntimeFrame::framesize >> 1);
255+
UncommonTrapBlob *ut_blob = UncommonTrapBlob::create(&buffer, oop_maps,
256+
SimpleRuntimeFrame::framesize >> 1);
257+
AOTCodeCache::store_code_blob(*ut_blob, AOTCodeEntry::C2Blob, (uint)OptoStubId::uncommon_trap_id, name);
258+
return ut_blob;
251259
}
252260

253261
//------------------------------generate_exception_blob---------------------------
@@ -283,10 +291,15 @@ ExceptionBlob* OptoRuntime::generate_exception_blob() {
283291

284292
assert(SimpleRuntimeFrame::framesize % 4 == 0, "sp not 16-byte aligned");
285293

294+
const char* name = OptoRuntime::stub_name(OptoStubId::exception_id);
295+
CodeBlob* blob = AOTCodeCache::load_code_blob(AOTCodeEntry::C2Blob, (uint)OptoStubId::exception_id, name);
296+
if (blob != nullptr) {
297+
return blob->as_exception_blob();
298+
}
299+
286300
// Allocate space for the code
287301
ResourceMark rm;
288302
// Setup code generation tools
289-
const char* name = OptoRuntime::stub_name(OptoStubId::exception_id);
290303
CodeBuffer buffer(name, 2048, 1024);
291304
if (buffer.blob() == nullptr) {
292305
return nullptr;
@@ -384,7 +397,9 @@ ExceptionBlob* OptoRuntime::generate_exception_blob() {
384397
masm->flush();
385398

386399
// Set exception blob
387-
return ExceptionBlob::create(&buffer, oop_maps, SimpleRuntimeFrame::framesize >> 1);
400+
ExceptionBlob* ex_blob = ExceptionBlob::create(&buffer, oop_maps, SimpleRuntimeFrame::framesize >> 1);
401+
AOTCodeCache::store_code_blob(*ex_blob, AOTCodeEntry::C2Blob, (uint)OptoStubId::exception_id, name);
402+
return ex_blob;
388403
}
389404
#endif // COMPILER2
390405

0 commit comments

Comments
 (0)