Skip to content

Commit 1ad8aea

Browse files
Merge in jdk-24+29 (24.2)
PullRequest: labsjdk-ce/138
2 parents d5ad830 + 9edf515 commit 1ad8aea

File tree

73 files changed

+4449
-271
lines changed

Some content is hidden

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

73 files changed

+4449
-271
lines changed

src/hotspot/share/gc/shared/genArguments.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ size_t MinNewSize = 0;
3737
size_t MinOldSize = 0;
3838
size_t MaxOldSize = 0;
3939

40-
size_t OldSize = 0;
40+
// If InitialHeapSize or MinHeapSize is not set on cmdline, this variable,
41+
// together with NewSize, is used to derive them.
42+
// Using the same value when it was a configurable flag to avoid breakage.
43+
// See more in JDK-8346005
44+
size_t OldSize = ScaleForWordSize(4*M);
4145

4246
size_t GenAlignment = 0;
4347

src/hotspot/share/oops/compressedKlass.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,15 @@ class CompressedKlassPointers : public AllStatic {
258258
is_aligned(addr, klass_alignment_in_bytes());
259259
}
260260

261-
// Check that with the given base, shift and range, aarch64 an encode and decode the klass pointer.
262-
static bool check_klass_decode_mode(address base, int shift, const size_t range) NOT_AARCH64({ return true;});
263-
static bool set_klass_decode_mode() NOT_AARCH64({ return true;}); // can be called after initialization
261+
#if defined(AARCH64) && !defined(ZERO)
262+
// Check that with the given base, shift and range, aarch64 code can encode and decode the klass pointer.
263+
static bool check_klass_decode_mode(address base, int shift, const size_t range);
264+
// Called after initialization.
265+
static bool set_klass_decode_mode();
266+
#else
267+
static bool check_klass_decode_mode(address base, int shift, const size_t range) { return true; }
268+
static bool set_klass_decode_mode() { return true; }
269+
#endif
264270
};
265271

266272
#endif // SHARE_OOPS_COMPRESSEDKLASS_HPP

src/hotspot/share/opto/vectorIntrinsics.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1637,8 +1637,9 @@ bool LibraryCallKit::inline_vector_reduction() {
16371637
int opc = VectorSupport::vop2ideal(opr->get_con(), elem_bt);
16381638
int sopc = ReductionNode::opcode(opc, elem_bt);
16391639

1640+
// Ensure reduction operation for lanewise operation
16401641
// When using mask, mask use type needs to be VecMaskUseLoad.
1641-
if (!arch_supports_vector(sopc, num_elem, elem_bt, is_masked_op ? VecMaskUseLoad : VecMaskNotUsed)) {
1642+
if (sopc == opc || !arch_supports_vector(sopc, num_elem, elem_bt, is_masked_op ? VecMaskUseLoad : VecMaskNotUsed)) {
16421643
log_if_needed(" ** not supported: arity=1 op=%d/reduce vlen=%d etype=%s is_masked_op=%d",
16431644
sopc, num_elem, type2name(elem_bt), is_masked_op ? 1 : 0);
16441645
return false;

src/java.base/share/classes/java/lang/classfile/CompoundElement.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import java.util.stream.Stream;
3535
import java.util.stream.StreamSupport;
3636

37+
import jdk.internal.classfile.components.ClassPrinter;
38+
3739
/**
3840
* A {@link ClassFileElement} that has complex structure defined in terms of
3941
* other classfile elements, such as a method, field, method body, or entire
@@ -92,4 +94,14 @@ public void accept(E e) {
9294
return Collections.unmodifiableList(list);
9395
}
9496

97+
/**
98+
* {@return a text representation of the compound element and its contents for debugging purposes}
99+
*
100+
* The format, structure and exact contents of the returned string are not specified and may change at any time in the future.
101+
*/
102+
default String toDebugString() {
103+
StringBuilder text = new StringBuilder();
104+
ClassPrinter.toYaml(this, ClassPrinter.Verbosity.TRACE_ALL, text::append);
105+
return text.toString();
106+
}
95107
}

src/java.base/share/classes/java/net/Socket.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -569,9 +569,8 @@ void setConnected() {
569569
/**
570570
* Connects this socket to the server.
571571
*
572-
* <p> If the endpoint is an unresolved {@link InetSocketAddress}, or the
573-
* connection cannot be established, then the socket is closed, and an
574-
* {@link IOException} is thrown.
572+
* <p> If the connection cannot be established, then the socket is closed,
573+
* and an {@link IOException} is thrown.
575574
*
576575
* <p> This method is {@linkplain Thread#interrupt() interruptible} in the
577576
* following circumstances:
@@ -591,8 +590,8 @@ void setConnected() {
591590
* @param endpoint the {@code SocketAddress}
592591
* @throws IOException if an error occurs during the connection, the socket
593592
* is already connected or the socket is closed
594-
* @throws UnknownHostException if the endpoint is an unresolved
595-
* {@link InetSocketAddress}
593+
* @throws UnknownHostException if the connection could not be established
594+
* because the endpoint is an unresolved {@link InetSocketAddress}
596595
* @throws java.nio.channels.IllegalBlockingModeException
597596
* if this socket has an associated channel,
598597
* and the channel is in non-blocking mode
@@ -609,9 +608,8 @@ public void connect(SocketAddress endpoint) throws IOException {
609608
* A timeout of zero is interpreted as an infinite timeout. The connection
610609
* will then block until established or an error occurs.
611610
*
612-
* <p> If the endpoint is an unresolved {@link InetSocketAddress}, the
613-
* connection cannot be established, or the timeout expires before the
614-
* connection is established, then the socket is closed, and an
611+
* <p> If the connection cannot be established, or the timeout expires
612+
* before the connection is established, then the socket is closed, and an
615613
* {@link IOException} is thrown.
616614
*
617615
* <p> This method is {@linkplain Thread#interrupt() interruptible} in the
@@ -634,8 +632,8 @@ public void connect(SocketAddress endpoint) throws IOException {
634632
* @throws IOException if an error occurs during the connection, the socket
635633
* is already connected or the socket is closed
636634
* @throws SocketTimeoutException if timeout expires before connecting
637-
* @throws UnknownHostException if the endpoint is an unresolved
638-
* {@link InetSocketAddress}
635+
* @throws UnknownHostException if the connection could not be established
636+
* because the endpoint is an unresolved {@link InetSocketAddress}
639637
* @throws java.nio.channels.IllegalBlockingModeException
640638
* if this socket has an associated channel,
641639
* and the channel is in non-blocking mode
@@ -660,12 +658,6 @@ public void connect(SocketAddress endpoint, int timeout) throws IOException {
660658
if (!(endpoint instanceof InetSocketAddress epoint))
661659
throw new IllegalArgumentException("Unsupported address type");
662660

663-
if (epoint.isUnresolved()) {
664-
var uhe = new UnknownHostException(epoint.getHostName());
665-
closeSuppressingExceptions(uhe);
666-
throw uhe;
667-
}
668-
669661
InetAddress addr = epoint.getAddress();
670662
checkAddress(addr, "connect");
671663

src/java.base/share/classes/java/util/ResourceBundle.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3654,8 +3654,7 @@ private static String toPackageName(String bundleName) {
36543654

36553655
}
36563656

3657-
private static final boolean TRACE_ON = Boolean.getBoolean(
3658-
System.getProperty("resource.bundle.debug", "false"));
3657+
private static final boolean TRACE_ON = Boolean.getBoolean("resource.bundle.debug");
36593658

36603659
private static void trace(String format, Object... params) {
36613660
if (TRACE_ON)

src/java.base/share/classes/module-info.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@
155155
exports jdk.internal.javac to
156156
java.compiler,
157157
java.desktop, // for ScopedValue
158-
java.se, // for ParticipatesInPreview
159158
jdk.compiler,
160159
jdk.incubator.vector, // participates in preview features
161160
jdk.jartool, // participates in preview features

src/java.desktop/share/classes/javax/print/attribute/standard/PresentationDirection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2024, 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
@@ -43,7 +43,7 @@
4343
* <p>
4444
* <b>IPP Compatibility:</b> This attribute is not an IPP 1.1 attribute; it is
4545
* an attribute in the Production Printing Extension
46-
* (<a href="ftp://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf">
46+
* (<a href="https://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf">
4747
* PDF</a>) of IPP 1.1. The category name returned by {@code getName()} is the
4848
* IPP attribute name. The enumeration's integer value is the IPP enum value.
4949
* The {@code toString()} method returns the IPP string representation of the

src/java.se/share/classes/module-info.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
* questions.
2424
*/
2525

26-
import jdk.internal.javac.ParticipatesInPreview;
27-
2826
/**
2927
* Defines the API of the Java SE Platform.
3028
*
@@ -40,7 +38,6 @@
4038
* @moduleGraph
4139
* @since 9
4240
*/
43-
@ParticipatesInPreview
4441
module java.se {
4542
requires transitive java.base;
4643
requires transitive java.compiler;

src/java.sql/share/classes/java/sql/SQLPermission.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* A {@code SQLPermission} object contains
3333
* a name (also referred to as a "target name") but no actions
3434
* list; there is either a named permission or there is not.
35-
* The target name is the name of the permission (see below). The
35+
* The target name is the name of the permission. The
3636
* naming convention follows the hierarchical property naming convention.
3737
* In addition, an asterisk
3838
* may appear at the end of the name, following a ".", or by itself, to

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Directive.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static int value(Set<RequiresFlag> s) {
7676

7777
@Override
7878
public String toString() {
79-
return String.format("ACC_%s (0x%04x", name(), value);
79+
return String.format("ACC_%s (0x%04x)", name(), value);
8080
}
8181
}
8282

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Preview.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ public boolean participatesInPreview(Symtab syms, ModuleSymbol m) {
150150
// s participates in the preview API
151151
return syms.java_base.exports.stream()
152152
.filter(ed -> ed.packge.fullname == names.jdk_internal_javac)
153-
.anyMatch(ed -> ed.modules.contains(m));
153+
.anyMatch(ed -> ed.modules.contains(m)) ||
154+
//the specification lists the java.se module as participating in preview:
155+
m.name == names.java_se;
154156
}
155157

156158
/**

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2587,17 +2587,22 @@ public void visitApply(JCMethodInvocation tree) {
25872587
chk.checkRefType(qualifier.pos(),
25882588
attribExpr(qualifier, localEnv,
25892589
encl));
2590-
} else if (methName == names._super) {
2591-
// qualifier omitted; check for existence
2592-
// of an appropriate implicit qualifier.
2593-
checkNewInnerClass(tree.meth.pos(), localEnv, site, true);
25942590
}
25952591
} else if (tree.meth.hasTag(SELECT)) {
25962592
log.error(tree.meth.pos(),
25972593
Errors.IllegalQualNotIcls(site.tsym));
25982594
attribExpr(((JCFieldAccess) tree.meth).selected, localEnv, site);
25992595
}
26002596

2597+
if (tree.meth.hasTag(IDENT)) {
2598+
// non-qualified super(...) call; check whether explicit constructor
2599+
// invocation is well-formed. If the super class is an inner class,
2600+
// make sure that an appropriate implicit qualifier exists. If the super
2601+
// class is a local class, make sure that the current class is defined
2602+
// in the same context as the local class.
2603+
checkNewInnerClass(tree.meth.pos(), localEnv, site, true);
2604+
}
2605+
26012606
// if we're calling a java.lang.Enum constructor,
26022607
// prefix the implicit String and int parameters
26032608
if (site.tsym == syms.enumSym)
@@ -3065,7 +3070,7 @@ public void report(DiagnosticPosition _unused, JCDiagnostic details) {
30653070
}
30663071

30673072
void checkNewInnerClass(DiagnosticPosition pos, Env<AttrContext> env, Type type, boolean isSuper) {
3068-
boolean isLocal = type.tsym.owner.kind == MTH;
3073+
boolean isLocal = type.tsym.owner.kind == VAR || type.tsym.owner.kind == MTH;
30693074
if ((type.tsym.flags() & (INTERFACE | ENUM | RECORD)) != 0 ||
30703075
(!isLocal && !type.tsym.isInner()) ||
30713076
(isSuper && env.enclClass.sym.isAnonymous())) {

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3834,7 +3834,7 @@ Symbol findSelfContaining(DiagnosticPosition pos,
38343834
*/
38353835
Symbol findLocalClassOwner(Env<AttrContext> env, TypeSymbol c) {
38363836
Symbol owner = c.owner;
3837-
Assert.check(owner.kind == MTH);
3837+
Assert.check(owner.kind == MTH || owner.kind == VAR);
38383838
Env<AttrContext> env1 = env;
38393839
boolean staticOnly = false;
38403840
while (env1.outer != null) {
@@ -3846,7 +3846,9 @@ Symbol findLocalClassOwner(Env<AttrContext> env, TypeSymbol c) {
38463846
if (isStatic(env1)) staticOnly = true;
38473847
env1 = env1.outer;
38483848
}
3849-
return methodNotFound;
3849+
return owner.kind == MTH ?
3850+
methodNotFound :
3851+
varNotFound;
38503852
}
38513853

38523854
/**

src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3770,7 +3770,7 @@ compiler.misc.cant.resolve.modules=\
37703770
cannot resolve modules
37713771

37723772
compiler.misc.bad.requires.flag=\
3773-
bad requires flag: {0}
3773+
invalid flag for "requires java.base": {0}
37743774

37753775
# 0: string
37763776
compiler.err.invalid.module.specifier=\

src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ public static Names instance(Context context) {
127127

128128
// module names
129129
public final Name java_base;
130+
public final Name java_se;
130131
public final Name jdk_unsupported;
131132

132133
// attribute names
@@ -315,6 +316,7 @@ public Names(Context context) {
315316

316317
// module names
317318
java_base = fromString("java.base");
319+
java_se = fromString("java.se");
318320
jdk_unsupported = fromString("jdk.unsupported");
319321

320322
// attribute names

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,6 +2869,10 @@ private static ReductionOperation<ByteVector, VectorMask<Byte>> reductionOperati
28692869
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (byte) Math.min(a, b)));
28702870
case VECTOR_OP_MAX: return (v, m) ->
28712871
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (byte) Math.max(a, b)));
2872+
case VECTOR_OP_UMIN: return (v, m) ->
2873+
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (byte) VectorMath.minUnsigned(a, b)));
2874+
case VECTOR_OP_UMAX: return (v, m) ->
2875+
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (byte) VectorMath.maxUnsigned(a, b)));
28722876
case VECTOR_OP_AND: return (v, m) ->
28732877
toBits(v.rOp((byte)-1, m, (i, a, b) -> (byte)(a & b)));
28742878
case VECTOR_OP_OR: return (v, m) ->

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/IntVector.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2854,6 +2854,10 @@ private static ReductionOperation<IntVector, VectorMask<Integer>> reductionOpera
28542854
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (int) Math.min(a, b)));
28552855
case VECTOR_OP_MAX: return (v, m) ->
28562856
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (int) Math.max(a, b)));
2857+
case VECTOR_OP_UMIN: return (v, m) ->
2858+
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (int) VectorMath.minUnsigned(a, b)));
2859+
case VECTOR_OP_UMAX: return (v, m) ->
2860+
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (int) VectorMath.maxUnsigned(a, b)));
28572861
case VECTOR_OP_AND: return (v, m) ->
28582862
toBits(v.rOp((int)-1, m, (i, a, b) -> (int)(a & b)));
28592863
case VECTOR_OP_OR: return (v, m) ->

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/LongVector.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,6 +2720,10 @@ private static ReductionOperation<LongVector, VectorMask<Long>> reductionOperati
27202720
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (long) Math.min(a, b)));
27212721
case VECTOR_OP_MAX: return (v, m) ->
27222722
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (long) Math.max(a, b)));
2723+
case VECTOR_OP_UMIN: return (v, m) ->
2724+
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (long) VectorMath.minUnsigned(a, b)));
2725+
case VECTOR_OP_UMAX: return (v, m) ->
2726+
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (long) VectorMath.maxUnsigned(a, b)));
27232727
case VECTOR_OP_AND: return (v, m) ->
27242728
toBits(v.rOp((long)-1, m, (i, a, b) -> (long)(a & b)));
27252729
case VECTOR_OP_OR: return (v, m) ->

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ShortVector.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,6 +2870,10 @@ private static ReductionOperation<ShortVector, VectorMask<Short>> reductionOpera
28702870
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (short) Math.min(a, b)));
28712871
case VECTOR_OP_MAX: return (v, m) ->
28722872
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (short) Math.max(a, b)));
2873+
case VECTOR_OP_UMIN: return (v, m) ->
2874+
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (short) VectorMath.minUnsigned(a, b)));
2875+
case VECTOR_OP_UMAX: return (v, m) ->
2876+
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (short) VectorMath.maxUnsigned(a, b)));
28732877
case VECTOR_OP_AND: return (v, m) ->
28742878
toBits(v.rOp((short)-1, m, (i, a, b) -> (short)(a & b)));
28752879
case VECTOR_OP_OR: return (v, m) ->

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3375,6 +3375,12 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
33753375
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> ($type$) Math.min(a, b)));
33763376
case VECTOR_OP_MAX: return (v, m) ->
33773377
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> ($type$) Math.max(a, b)));
3378+
#if[!FP]
3379+
case VECTOR_OP_UMIN: return (v, m) ->
3380+
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> ($type$) VectorMath.minUnsigned(a, b)));
3381+
case VECTOR_OP_UMAX: return (v, m) ->
3382+
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> ($type$) VectorMath.maxUnsigned(a, b)));
3383+
#end[!FP]
33783384
#if[BITWISE]
33793385
case VECTOR_OP_AND: return (v, m) ->
33803386
toBits(v.rOp(($type$)-1, m, (i, a, b) -> ($type$)(a & b)));

0 commit comments

Comments
 (0)