Skip to content

Commit fbd73f5

Browse files
authored
Merge jdk-26+13 into rivos/main (#243)
2 parents 0d35aec + 81f9899 commit fbd73f5

File tree

248 files changed

+6206
-2800
lines changed

Some content is hidden

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

248 files changed

+6206
-2800
lines changed

make/autoconf/flags-other.m4

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -115,7 +115,11 @@ AC_DEFUN([FLAGS_SETUP_ASFLAGS],
115115
# Force preprocessor to run, just to make sure
116116
BASIC_ASFLAGS="-x assembler-with-cpp"
117117
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
118-
BASIC_ASFLAGS="-nologo -c"
118+
if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
119+
BASIC_ASFLAGS="-nologo"
120+
else
121+
BASIC_ASFLAGS="-nologo -c"
122+
fi
119123
fi
120124
AC_SUBST(BASIC_ASFLAGS)
121125

make/autoconf/toolchain.m4

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_DETECT_TOOLCHAIN_CORE],
655655
if test "x$TOOLCHAIN_TYPE" != xmicrosoft; then
656656
AS="$CC -c"
657657
else
658-
if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
659-
# On 64 bit windows, the assembler is "ml64.exe"
658+
if test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
659+
# On Windows aarch64, the assembler is "armasm64.exe"
660+
UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, armasm64)
661+
elif test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then
662+
# On Windows x64, the assembler is "ml64.exe"
660663
UTIL_LOOKUP_TOOLCHAIN_PROGS(AS, ml64)
661664
else
662665
# otherwise, the assembler is "ml.exe"

make/common/native/CompileFile.gmk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ define CreateCompiledNativeFileBody
155155
endif
156156
$1_FLAGS := $$($1_FLAGS) -DASSEMBLY_SRC_FILE='"$$($1_REL_ASM_SRC)"' \
157157
-include $(TOPDIR)/make/data/autoheaders/assemblyprefix.h
158+
else ifeq ($(TOOLCHAIN_TYPE), microsoft)
159+
ifeq ($(OPENJDK_TARGET_CPU), aarch64)
160+
$1_NON_ASM_EXTENSION_FLAG :=
161+
else
162+
$1_NON_ASM_EXTENSION_FLAG := "-Ta"
163+
endif
158164
endif
159165
else ifneq ($$(filter %.cpp %.cc %.mm, $$($1_FILENAME)), )
160166
# Compile as a C++ or Objective-C++ file
@@ -236,7 +242,7 @@ define CreateCompiledNativeFileBody
236242
# For assembler calls just create empty dependency lists
237243
$$(call ExecuteWithLog, $$@, $$(call MakeCommandRelative, \
238244
$$($1_COMPILER) $$($1_FLAGS) \
239-
$(CC_OUT_OPTION)$$($1_OBJ) -Ta $$($1_SRC_FILE))) \
245+
$(CC_OUT_OPTION)$$($1_OBJ) $$($1_NON_ASM_EXTENSION_FLAG) $$($1_SRC_FILE))) \
240246
| $(TR) -d '\r' | $(GREP) -v -e "Assembling:" || test "$$$$?" = "1" ; \
241247
$(ECHO) > $$($1_DEPS_FILE) ; \
242248
$(ECHO) > $$($1_DEPS_TARGETS_FILE)

make/jdk/src/classes/build/tools/cldrconverter/Bundle.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ static enum Type {
7979
"NumberElements/nan",
8080
"NumberElements/currencyDecimal",
8181
"NumberElements/currencyGroup",
82+
"NumberElements/lenientMinusSigns",
8283
};
8384

8485
private static final String[] TIME_PATTERN_KEYS = {

make/jdk/src/classes/build/tools/cldrconverter/LDMLParseHandler.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,26 @@ public void startElement(String uri, String localName, String qName, Attributes
844844
});
845845
break;
846846

847+
// Lenient parsing
848+
case "parseLenients":
849+
if ("lenient".equals(attributes.getValue("level"))) {
850+
pushKeyContainer(qName, attributes, attributes.getValue("scope"));
851+
} else {
852+
pushIgnoredContainer(qName);
853+
}
854+
break;
855+
856+
case "parseLenient":
857+
// Use only the lenient minus sign for now
858+
if (currentContainer instanceof KeyContainer kc
859+
&& kc.getKey().equals("number")
860+
&& attributes.getValue("sample").equals("-")) {
861+
pushStringEntry(qName, attributes, currentNumberingSystem + "NumberElements/lenientMinusSigns");
862+
} else {
863+
pushIgnoredContainer(qName);
864+
}
865+
break;
866+
847867
default:
848868
// treat anything else as a container
849869
pushContainer(qName, attributes);
@@ -1150,6 +1170,14 @@ public void endElement(String uri, String localName, String qName) throws SAXExc
11501170
currentStyle = "";
11511171
putIfEntry();
11521172
break;
1173+
case "parseLenient":
1174+
if (currentContainer instanceof StringEntry se) {
1175+
// Convert to a simple concatenation of lenient minuses
1176+
// e.g. "[\--﹣ ‐‑ ‒ – −⁻₋ ➖]" -> "--﹣‐‑‒–−⁻₋➖" for the root locale
1177+
put(se.getKey(), se.getValue().replaceAll("[\\[\\]\\\\ ]", ""));
1178+
}
1179+
break;
1180+
11531181
default:
11541182
putIfEntry();
11551183
}

make/src/classes/build/tools/jfr/GenerateJfrFiles.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,8 +922,10 @@ private static void printEvent(Printer out, TypeElement event, boolean empty) {
922922
}
923923
out.write(" using JfrEvent<Event" + event.name
924924
+ ">::commit; // else commit() is hidden by overloaded versions in this class");
925-
printConstructor2(out, event, empty);
926-
printCommitMethod(out, event, empty);
925+
if (!event.fields.isEmpty()) {
926+
printConstructor2(out, event, empty);
927+
printCommitMethod(out, event, empty);
928+
}
927929
if (!empty) {
928930
printVerify(out, event.fields);
929931
}

src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ void ShenandoahBarrierSetAssembler::satb_write_barrier_pre(MacroAssembler* masm,
172172

173173
if (expand_call) {
174174
assert(pre_val != c_rarg1, "smashed arg");
175-
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, thread);
175+
__ super_call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_barrier_pre), pre_val);
176176
} else {
177-
__ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, thread);
177+
__ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_barrier_pre), pre_val);
178178
}
179179

180180
__ pop(saved, sp);
@@ -753,7 +753,7 @@ void ShenandoahBarrierSetAssembler::generate_c1_pre_barrier_runtime_stub(StubAss
753753
__ bind(runtime);
754754
__ push_call_clobbered_registers();
755755
__ load_parameter(0, pre_val);
756-
__ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_field_pre), pre_val, thread);
756+
__ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_barrier_pre), pre_val);
757757
__ pop_call_clobbered_registers();
758758
__ bind(done);
759759

src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,13 +2426,7 @@ void LIR_Assembler::emit_lock(LIR_OpLock* op) {
24262426
Register hdr = op->hdr_opr()->as_pointer_register();
24272427
Register lock = op->lock_opr()->as_pointer_register();
24282428

2429-
if (LockingMode == LM_MONITOR) {
2430-
if (op->info() != nullptr) {
2431-
add_debug_info_for_null_check_here(op->info());
2432-
__ null_check(obj);
2433-
}
2434-
__ b(*op->stub()->entry());
2435-
} else if (op->code() == lir_lock) {
2429+
if (op->code() == lir_lock) {
24362430
assert(BasicLock::displaced_header_offset_in_bytes() == 0, "lock_reg must point to the displaced header");
24372431
int null_check_offset = __ lock_object(hdr, obj, lock, *op->stub()->entry());
24382432
if (op->info() != nullptr) {

src/hotspot/cpu/arm/c1_MacroAssembler_arm.cpp

Lines changed: 13 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,16 @@ void C1_MacroAssembler::allocate_array(Register obj, Register len,
177177
}
178178

179179
int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Label& slow_case) {
180-
Label done, fast_lock, fast_lock_done;
181180
int null_check_offset = 0;
182181

183182
const Register tmp2 = Rtemp; // Rtemp should be free at c1 LIR level
184183
assert_different_registers(hdr, obj, disp_hdr, tmp2);
185184

186185
assert(BasicObjectLock::lock_offset() == 0, "adjust this code");
187-
const ByteSize obj_offset = BasicObjectLock::obj_offset();
188-
const int mark_offset = BasicLock::displaced_header_offset_in_bytes();
186+
assert(oopDesc::mark_offset_in_bytes() == 0, "Required by atomic instructions");
189187

190188
// save object being locked into the BasicObjectLock
191-
str(obj, Address(disp_hdr, obj_offset));
189+
str(obj, Address(disp_hdr, BasicObjectLock::obj_offset()));
192190

193191
null_check_offset = offset();
194192

@@ -199,95 +197,29 @@ int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr
199197
b(slow_case, ne);
200198
}
201199

202-
assert(oopDesc::mark_offset_in_bytes() == 0, "Required by atomic instructions");
203-
204-
if (LockingMode == LM_LIGHTWEIGHT) {
205-
206-
Register t1 = disp_hdr; // Needs saving, probably
207-
Register t2 = hdr; // blow
208-
Register t3 = Rtemp; // blow
209-
210-
lightweight_lock(obj /* obj */, t1, t2, t3, 1 /* savemask - save t1 */, slow_case);
211-
// Success: fall through
212-
213-
} else if (LockingMode == LM_LEGACY) {
214-
215-
// On MP platforms the next load could return a 'stale' value if the memory location has been modified by another thread.
216-
// That would be acceptable as ether CAS or slow case path is taken in that case.
217-
218-
// Must be the first instruction here, because implicit null check relies on it
219-
ldr(hdr, Address(obj, oopDesc::mark_offset_in_bytes()));
220-
221-
tst(hdr, markWord::unlocked_value);
222-
b(fast_lock, ne);
223-
224-
// Check for recursive locking
225-
// See comments in InterpreterMacroAssembler::lock_object for
226-
// explanations on the fast recursive locking check.
227-
// -1- test low 2 bits
228-
movs(tmp2, AsmOperand(hdr, lsl, 30));
229-
// -2- test (hdr - SP) if the low two bits are 0
230-
sub(tmp2, hdr, SP, eq);
231-
movs(tmp2, AsmOperand(tmp2, lsr, exact_log2(os::vm_page_size())), eq);
232-
// If still 'eq' then recursive locking OK
233-
// set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8267042)
234-
str(tmp2, Address(disp_hdr, mark_offset));
235-
b(fast_lock_done, eq);
236-
// else need slow case
237-
b(slow_case);
238-
239-
240-
bind(fast_lock);
241-
// Save previous object header in BasicLock structure and update the header
242-
str(hdr, Address(disp_hdr, mark_offset));
243-
244-
cas_for_lock_acquire(hdr, disp_hdr, obj, tmp2, slow_case);
245-
246-
bind(fast_lock_done);
247-
}
248-
bind(done);
200+
Register t1 = disp_hdr; // Needs saving, probably
201+
Register t2 = hdr; // blow
202+
Register t3 = Rtemp; // blow
249203

204+
lightweight_lock(obj, t1, t2, t3, 1 /* savemask - save t1 */, slow_case);
205+
// Success: fall through
250206
return null_check_offset;
251207
}
252208

253209
void C1_MacroAssembler::unlock_object(Register hdr, Register obj, Register disp_hdr, Label& slow_case) {
254210
assert_different_registers(hdr, obj, disp_hdr, Rtemp);
255-
Register tmp2 = Rtemp;
256211

257212
assert(BasicObjectLock::lock_offset() == 0, "adjust this code");
258-
const ByteSize obj_offset = BasicObjectLock::obj_offset();
259-
const int mark_offset = BasicLock::displaced_header_offset_in_bytes();
260-
261-
Label done;
262-
263213
assert(oopDesc::mark_offset_in_bytes() == 0, "Required by atomic instructions");
264214

265-
if (LockingMode == LM_LIGHTWEIGHT) {
215+
ldr(obj, Address(disp_hdr, BasicObjectLock::obj_offset()));
266216

267-
ldr(obj, Address(disp_hdr, obj_offset));
217+
Register t1 = disp_hdr; // Needs saving, probably
218+
Register t2 = hdr; // blow
219+
Register t3 = Rtemp; // blow
268220

269-
Register t1 = disp_hdr; // Needs saving, probably
270-
Register t2 = hdr; // blow
271-
Register t3 = Rtemp; // blow
272-
273-
lightweight_unlock(obj /* object */, t1, t2, t3, 1 /* savemask (save t1) */,
274-
slow_case);
275-
// Success: Fall through
276-
277-
} else if (LockingMode == LM_LEGACY) {
278-
279-
// Load displaced header and object from the lock
280-
ldr(hdr, Address(disp_hdr, mark_offset));
281-
// If hdr is null, we've got recursive locking and there's nothing more to do
282-
cbz(hdr, done);
283-
284-
// load object
285-
ldr(obj, Address(disp_hdr, obj_offset));
286-
287-
// Restore the object header
288-
cas_for_lock_release(disp_hdr, hdr, obj, tmp2, slow_case);
289-
}
290-
bind(done);
221+
lightweight_unlock(obj, t1, t2, t3, 1 /* savemask - save t1 */, slow_case);
222+
// Success: fall through
291223
}
292224

293225
#ifndef PRODUCT

src/hotspot/cpu/arm/c2_MacroAssembler_arm.cpp

Lines changed: 8 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void C2_MacroAssembler::fast_lock(Register Roop, Register Rbox, Register Rscratc
8181
assert(VM_Version::supports_ldrex(), "unsupported, yet?");
8282
assert_different_registers(Roop, Rbox, Rscratch, Rscratch2);
8383

84-
Label fast_lock, done;
84+
Label done;
8585

8686
if (DiagnoseSyncOnValueBasedClasses != 0) {
8787
load_klass(Rscratch, Roop);
@@ -90,43 +90,10 @@ void C2_MacroAssembler::fast_lock(Register Roop, Register Rbox, Register Rscratc
9090
b(done, ne);
9191
}
9292

93-
if (LockingMode == LM_LIGHTWEIGHT) {
94-
95-
lightweight_lock(Roop /* obj */, Rbox /* t1 */, Rscratch /* t2 */, Rscratch2 /* t3 */,
96-
1 /* savemask (save t1) */, done);
97-
98-
// Success: set Z
99-
cmp(Roop, Roop);
100-
101-
} else if (LockingMode == LM_LEGACY) {
102-
103-
Register Rmark = Rscratch2;
104-
105-
ldr(Rmark, Address(Roop, oopDesc::mark_offset_in_bytes()));
106-
tst(Rmark, markWord::unlocked_value);
107-
b(fast_lock, ne);
108-
109-
// Check for recursive lock
110-
// See comments in InterpreterMacroAssembler::lock_object for
111-
// explanations on the fast recursive locking check.
112-
// -1- test low 2 bits
113-
movs(Rscratch, AsmOperand(Rmark, lsl, 30));
114-
// -2- test (hdr - SP) if the low two bits are 0
115-
sub(Rscratch, Rmark, SP, eq);
116-
movs(Rscratch, AsmOperand(Rscratch, lsr, exact_log2(os::vm_page_size())), eq);
117-
// If still 'eq' then recursive locking OK
118-
// set to zero if recursive lock, set to non zero otherwise (see discussion in JDK-8153107)
119-
str(Rscratch, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()));
120-
b(done);
121-
122-
bind(fast_lock);
123-
str(Rmark, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()));
124-
125-
bool allow_fallthrough_on_failure = true;
126-
bool one_shot = true;
127-
cas_for_lock_acquire(Rmark, Rbox, Roop, Rscratch, done, allow_fallthrough_on_failure, one_shot);
128-
}
93+
lightweight_lock(Roop /* obj */, Rbox /* t1 */, Rscratch /* t2 */, Rscratch2 /* t3 */,
94+
1 /* savemask (save t1) */, done);
12995

96+
cmp(Roop, Roop); // Success: set Z
13097
bind(done);
13198

13299
// At this point flags are set as follows:
@@ -140,29 +107,12 @@ void C2_MacroAssembler::fast_unlock(Register Roop, Register Rbox, Register Rscra
140107

141108
Label done;
142109

143-
if (LockingMode == LM_LIGHTWEIGHT) {
144-
145-
lightweight_unlock(Roop /* obj */, Rbox /* t1 */, Rscratch /* t2 */, Rscratch2 /* t3 */,
146-
1 /* savemask (save t1) */, done);
147-
148-
cmp(Roop, Roop); // Success: Set Z
149-
// Fall through
150-
151-
} else if (LockingMode == LM_LEGACY) {
152-
153-
Register Rmark = Rscratch2;
110+
lightweight_unlock(Roop /* obj */, Rbox /* t1 */, Rscratch /* t2 */, Rscratch2 /* t3 */,
111+
1 /* savemask (save t1) */, done);
154112

155-
// Find the lock address and load the displaced header from the stack.
156-
ldr(Rmark, Address(Rbox, BasicLock::displaced_header_offset_in_bytes()));
157-
// If hdr is null, we've got recursive locking and there's nothing more to do
158-
cmp(Rmark, 0);
159-
b(done, eq);
113+
cmp(Roop, Roop); // Success: Set Z
114+
// Fall through
160115

161-
// Restore the object header
162-
bool allow_fallthrough_on_failure = true;
163-
bool one_shot = true;
164-
cas_for_lock_release(Rbox, Rmark, Roop, Rscratch, done, allow_fallthrough_on_failure, one_shot);
165-
}
166116
bind(done);
167117

168118
// At this point flags are set as follows:

0 commit comments

Comments
 (0)