Skip to content

Commit 616271f

Browse files
authored
Merge pull request #2016 from SAP/pr-jdk-26+7
Merge to tag jdk-26+7
2 parents b7f8767 + 34e7f31 commit 616271f

File tree

500 files changed

+13774
-7097
lines changed

Some content is hidden

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

500 files changed

+13774
-7097
lines changed

make/ToolsJdk.gmk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ TOOL_GENERATECACERTS = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_class
7878
TOOL_GENERATEEXTRAPROPERTIES = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
7979
build.tools.generateextraproperties.GenerateExtraProperties
8080

81+
TOOL_GENERATECASEFOLDING = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
82+
build.tools.generatecharacter.CaseFolding
83+
8184
TOOL_MAKEZIPREPRODUCIBLE = $(JAVA_SMALL) -cp $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes \
8285
build.tools.makezipreproducible.MakeZipReproducible
8386

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
26+
package build.tools.generatecharacter;
27+
28+
import java.io.IOException;
29+
import java.nio.file.Files;
30+
import java.nio.file.Paths;
31+
import java.nio.file.StandardOpenOption;
32+
import java.util.stream.Collectors;
33+
import java.util.stream.Stream;
34+
35+
public class CaseFolding {
36+
37+
public static void main(String[] args) throws Throwable {
38+
if (args.length != 3) {
39+
System.err.println("Usage: java CaseFolding TemplateFile CaseFolding.txt CaseFolding.java");
40+
System.exit(1);
41+
}
42+
var templateFile = Paths.get(args[0]);
43+
var caseFoldingTxt = Paths.get(args[1]);
44+
var genSrcFile = Paths.get(args[2]);
45+
var supportedTypes = "^.*; [CTS]; .*$";
46+
var caseFoldingEntries = Files.lines(caseFoldingTxt)
47+
.filter(line -> !line.startsWith("#") && line.matches(supportedTypes))
48+
.map(line -> {
49+
String[] cols = line.split("; ");
50+
return new String[] {cols[0], cols[1], cols[2]};
51+
})
52+
.filter(cols -> {
53+
// the folding case doesn't map back to the original char.
54+
var cp1 = Integer.parseInt(cols[0], 16);
55+
var cp2 = Integer.parseInt(cols[2], 16);
56+
return Character.toUpperCase(cp2) != cp1 && Character.toLowerCase(cp2) != cp1;
57+
})
58+
.map(cols -> String.format(" entry(0x%s, 0x%s)", cols[0], cols[2]))
59+
.collect(Collectors.joining(",\n", "", ""));
60+
61+
// hack, hack, hack! the logic does not pick 0131. just add manually to support 'I's.
62+
// 0049; T; 0131; # LATIN CAPITAL LETTER I
63+
final String T_0x0131_0x49 = String.format(" entry(0x%04x, 0x%04x),\n", 0x0131, 0x49);
64+
65+
// Generate .java file
66+
Files.write(
67+
genSrcFile,
68+
Files.lines(templateFile)
69+
.map(line -> line.contains("%%%Entries") ? T_0x0131_0x49 + caseFoldingEntries : line)
70+
.collect(Collectors.toList()),
71+
StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING);
72+
}
73+
}

make/modules/java.base/gensrc/GensrcRegex.gmk

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,22 @@ TARGETS += $(GENSRC_INDICCONJUNCTBREAK)
5050

5151
################################################################################
5252

53+
GENSRC_CASEFOLDING := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/jdk/internal/util/regex/CaseFolding.java
54+
55+
CASEFOLDINGTEMP := $(MODULE_SRC)/share/classes/jdk/internal/util/regex/CaseFolding.java.template
56+
CASEFOLDINGTXT := $(MODULE_SRC)/share/data/unicodedata/CaseFolding.txt
57+
58+
$(GENSRC_CASEFOLDING): $(BUILD_TOOLS_JDK) $(CASEFOLDINGTEMP) $(CASEFOLDINGTXT)
59+
$(call LogInfo, Generating $@)
60+
$(call MakeTargetDir)
61+
$(TOOL_GENERATECASEFOLDING) \
62+
$(CASEFOLDINGTEMP) \
63+
$(CASEFOLDINGTXT) \
64+
$(GENSRC_CASEFOLDING)
65+
66+
TARGETS += $(GENSRC_CASEFOLDING)
67+
68+
################################################################################
69+
5370
endif # include guard
5471
include MakeIncludeEnd.gmk

make/test/BuildMicrobenchmark.gmk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
9292
--add-exports java.base/jdk.internal.classfile.impl=ALL-UNNAMED \
9393
--add-exports java.base/jdk.internal.event=ALL-UNNAMED \
9494
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
95+
--add-exports java.base/jdk.internal.jimage=ALL-UNNAMED \
9596
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
9697
--add-exports java.base/jdk.internal.util=ALL-UNNAMED \
9798
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \

src/demo/share/jfc/J2Ddemo/java2d/RunWindow.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ private static void invokeAndWait(Runnable run) {
362362
/**
363363
* This class contains initial values for instance variables of 'RunWindow' class,
364364
* and its instance is used in creation of 'RunWindow' object. Values parsed from
365-
* certain command line options of the demo or from the demo applet parameters are
365+
* certain command line options of the demo
366366
* set to the fields of this class instance. It is a part of the fix which changed
367367
* static variables for instance variables in certain demo classes.
368368
*

src/demo/share/jfc/J2Ddemo/java2d/Tools.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,6 @@ public void run() {
406406
if (pDialogState) {
407407
printJob.print(aset);
408408
}
409-
} catch (@SuppressWarnings("removal") java.security.AccessControlException ace) {
410-
String errmsg = "Applet access control exception; to allow "
411-
+ "access to printer, set\n"
412-
+ "permission for \"queuePrintJob\" in "
413-
+ "RuntimePermission.";
414-
JOptionPane.showMessageDialog(this, errmsg, "Printer Access Error",
415-
JOptionPane.ERROR_MESSAGE);
416409
} catch (Exception ex) {
417410
Logger.getLogger(Tools.class.getName()).log(Level.SEVERE,
418411
null, ex);

src/demo/share/jfc/SwingSet2/SwingSet2.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ void loadDemos() {
131131
private JEditorPane demoSrcPane = null;
132132

133133

134-
// contentPane cache, saved from the applet or application frame
134+
// contentPane cache, saved from the application frame
135135
Container contentPane = null;
136136

137137

@@ -177,7 +177,7 @@ public SwingSet2(GraphicsConfiguration gc) {
177177

178178

179179
/**
180-
* SwingSet2 Main. Called only if we're an application, not an applet.
180+
* SwingSet2 Main.
181181
*/
182182
public static void main(final String[] args) {
183183
// must run in EDT when constructing the GUI components
@@ -716,8 +716,7 @@ public ButtonGroup getToolBarGroup() {
716716
}
717717

718718
/**
719-
* Returns the content pane whether we're in an applet
720-
* or application
719+
* Returns the content pane
721720
*/
722721
public Container getContentPane() {
723722
if(contentPane == null) {

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6803,6 +6803,7 @@ void MacroAssembler::verify_cross_modify_fence_not_required() {
68036803
#endif
68046804

68056805
void MacroAssembler::spin_wait() {
6806+
block_comment("spin_wait {");
68066807
for (int i = 0; i < VM_Version::spin_wait_desc().inst_count(); ++i) {
68076808
switch (VM_Version::spin_wait_desc().inst()) {
68086809
case SpinWait::NOP:
@@ -6821,6 +6822,7 @@ void MacroAssembler::spin_wait() {
68216822
ShouldNotReachHere();
68226823
}
68236824
}
6825+
block_comment("}");
68246826
}
68256827

68266828
// Stack frame creation/removal

src/hotspot/cpu/arm/arm.ad

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8888,13 +8888,8 @@ instruct TailCalljmpInd(IPRegP jump_target, inline_cache_regP method_ptr) %{
88888888
match(TailCall jump_target method_ptr);
88898889

88908890
ins_cost(CALL_COST);
8891-
format %{ "MOV Rexception_pc, LR\n\t"
8892-
"jump $jump_target \t! $method_ptr holds method" %}
8891+
format %{ "jump $jump_target \t! $method_ptr holds method" %}
88938892
ins_encode %{
8894-
__ mov(Rexception_pc, LR); // this is used only to call
8895-
// StubRoutines::forward_exception_entry()
8896-
// which expects PC of exception in
8897-
// R5. FIXME?
88988893
__ jump($jump_target$$Register);
88998894
%}
89008895
ins_pipe(tail_call);
@@ -8939,8 +8934,10 @@ instruct ForwardExceptionjmp()
89398934
match(ForwardException);
89408935
ins_cost(CALL_COST);
89418936

8942-
format %{ "b forward_exception_stub" %}
8937+
format %{ "MOV Rexception_pc, LR\n\t"
8938+
"b forward_exception_entry" %}
89438939
ins_encode %{
8940+
__ mov(Rexception_pc, LR);
89448941
// OK to trash Rtemp, because Rtemp is used by stub
89458942
__ jump(StubRoutines::forward_exception_entry(), relocInfo::runtime_call_type, Rtemp);
89468943
%}

src/hotspot/cpu/arm/stubDeclarations_arm.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@
3030
do_arch_blob, \
3131
do_arch_entry, \
3232
do_arch_entry_init) \
33-
do_arch_blob(preuniverse, 0) \
33+
do_arch_blob(preuniverse, 500) \
34+
do_stub(preuniverse, atomic_load_long) \
35+
do_arch_entry(Arm, preuniverse, atomic_load_long, \
36+
atomic_load_long_entry, atomic_load_long_entry) \
37+
do_stub(preuniverse, atomic_store_long) \
38+
do_arch_entry(Arm, preuniverse, atomic_store_long, \
39+
atomic_store_long_entry, atomic_store_long_entry) \
3440

3541

3642
#define STUBGEN_INITIAL_BLOBS_ARCH_DO(do_stub, \
@@ -41,12 +47,6 @@
4147
do_stub(initial, idiv_irem) \
4248
do_arch_entry(Arm, initial, idiv_irem, \
4349
idiv_irem_entry, idiv_irem_entry) \
44-
do_stub(initial, atomic_load_long) \
45-
do_arch_entry(Arm, initial, atomic_load_long, \
46-
atomic_load_long_entry, atomic_load_long_entry) \
47-
do_stub(initial, atomic_store_long) \
48-
do_arch_entry(Arm, initial, atomic_store_long, \
49-
atomic_store_long_entry, atomic_store_long_entry) \
5050

5151
#define STUBGEN_CONTINUATION_BLOBS_ARCH_DO(do_stub, \
5252
do_arch_blob, \

0 commit comments

Comments
 (0)