Skip to content

Commit

Permalink
Merge pull request #1889 from SAP/pr-jdk-24+29
Browse files Browse the repository at this point in the history
Merge to tag jdk-24+29
  • Loading branch information
RealCLanger authored Dec 27, 2024
2 parents ef0d71c + 20b6ad5 commit 5178b7e
Show file tree
Hide file tree
Showing 74 changed files with 4,453 additions and 275 deletions.
6 changes: 5 additions & 1 deletion src/hotspot/share/gc/shared/genArguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ size_t MinNewSize = 0;
size_t MinOldSize = 0;
size_t MaxOldSize = 0;

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

size_t GenAlignment = 0;

Expand Down
12 changes: 9 additions & 3 deletions src/hotspot/share/oops/compressedKlass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,15 @@ class CompressedKlassPointers : public AllStatic {
is_aligned(addr, klass_alignment_in_bytes());
}

// Check that with the given base, shift and range, aarch64 an encode and decode the klass pointer.
static bool check_klass_decode_mode(address base, int shift, const size_t range) NOT_AARCH64({ return true;});
static bool set_klass_decode_mode() NOT_AARCH64({ return true;}); // can be called after initialization
#if defined(AARCH64) && !defined(ZERO)
// Check that with the given base, shift and range, aarch64 code can encode and decode the klass pointer.
static bool check_klass_decode_mode(address base, int shift, const size_t range);
// Called after initialization.
static bool set_klass_decode_mode();
#else
static bool check_klass_decode_mode(address base, int shift, const size_t range) { return true; }
static bool set_klass_decode_mode() { return true; }
#endif
};

#endif // SHARE_OOPS_COMPRESSEDKLASS_HPP
3 changes: 2 additions & 1 deletion src/hotspot/share/opto/vectorIntrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1637,8 +1637,9 @@ bool LibraryCallKit::inline_vector_reduction() {
int opc = VectorSupport::vop2ideal(opr->get_con(), elem_bt);
int sopc = ReductionNode::opcode(opc, elem_bt);

// Ensure reduction operation for lanewise operation
// When using mask, mask use type needs to be VecMaskUseLoad.
if (!arch_supports_vector(sopc, num_elem, elem_bt, is_masked_op ? VecMaskUseLoad : VecMaskNotUsed)) {
if (sopc == opc || !arch_supports_vector(sopc, num_elem, elem_bt, is_masked_op ? VecMaskUseLoad : VecMaskNotUsed)) {
log_if_needed(" ** not supported: arity=1 op=%d/reduce vlen=%d etype=%s is_masked_op=%d",
sopc, num_elem, type2name(elem_bt), is_masked_op ? 1 : 0);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

import jdk.internal.classfile.components.ClassPrinter;

/**
* A {@link ClassFileElement} that has complex structure defined in terms of
* other classfile elements, such as a method, field, method body, or entire
Expand Down Expand Up @@ -92,4 +94,14 @@ public void accept(E e) {
return Collections.unmodifiableList(list);
}

/**
* {@return a text representation of the compound element and its contents for debugging purposes}
*
* The format, structure and exact contents of the returned string are not specified and may change at any time in the future.
*/
default String toDebugString() {
StringBuilder text = new StringBuilder();
ClassPrinter.toYaml(this, ClassPrinter.Verbosity.TRACE_ALL, text::append);
return text.toString();
}
}
24 changes: 8 additions & 16 deletions src/java.base/share/classes/java/net/Socket.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,8 @@ void setConnected() {
/**
* Connects this socket to the server.
*
* <p> If the endpoint is an unresolved {@link InetSocketAddress}, or the
* connection cannot be established, then the socket is closed, and an
* {@link IOException} is thrown.
* <p> If the connection cannot be established, then the socket is closed,
* and an {@link IOException} is thrown.
*
* <p> This method is {@linkplain Thread#interrupt() interruptible} in the
* following circumstances:
Expand All @@ -591,8 +590,8 @@ void setConnected() {
* @param endpoint the {@code SocketAddress}
* @throws IOException if an error occurs during the connection, the socket
* is already connected or the socket is closed
* @throws UnknownHostException if the endpoint is an unresolved
* {@link InetSocketAddress}
* @throws UnknownHostException if the connection could not be established
* because the endpoint is an unresolved {@link InetSocketAddress}
* @throws java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel,
* and the channel is in non-blocking mode
Expand All @@ -609,9 +608,8 @@ public void connect(SocketAddress endpoint) throws IOException {
* A timeout of zero is interpreted as an infinite timeout. The connection
* will then block until established or an error occurs.
*
* <p> If the endpoint is an unresolved {@link InetSocketAddress}, the
* connection cannot be established, or the timeout expires before the
* connection is established, then the socket is closed, and an
* <p> If the connection cannot be established, or the timeout expires
* before the connection is established, then the socket is closed, and an
* {@link IOException} is thrown.
*
* <p> This method is {@linkplain Thread#interrupt() interruptible} in the
Expand All @@ -634,8 +632,8 @@ public void connect(SocketAddress endpoint) throws IOException {
* @throws IOException if an error occurs during the connection, the socket
* is already connected or the socket is closed
* @throws SocketTimeoutException if timeout expires before connecting
* @throws UnknownHostException if the endpoint is an unresolved
* {@link InetSocketAddress}
* @throws UnknownHostException if the connection could not be established
* because the endpoint is an unresolved {@link InetSocketAddress}
* @throws java.nio.channels.IllegalBlockingModeException
* if this socket has an associated channel,
* and the channel is in non-blocking mode
Expand All @@ -660,12 +658,6 @@ public void connect(SocketAddress endpoint, int timeout) throws IOException {
if (!(endpoint instanceof InetSocketAddress epoint))
throw new IllegalArgumentException("Unsupported address type");

if (epoint.isUnresolved()) {
var uhe = new UnknownHostException(epoint.getHostName());
closeSuppressingExceptions(uhe);
throw uhe;
}

InetAddress addr = epoint.getAddress();
checkAddress(addr, "connect");

Expand Down
3 changes: 1 addition & 2 deletions src/java.base/share/classes/java/util/ResourceBundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -3654,8 +3654,7 @@ private static String toPackageName(String bundleName) {

}

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

private static void trace(String format, Object... params) {
if (TRACE_ON)
Expand Down
1 change: 0 additions & 1 deletion src/java.base/share/classes/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@
exports jdk.internal.javac to
java.compiler,
java.desktop, // for ScopedValue
java.se, // for ParticipatesInPreview
jdk.compiler,
jdk.incubator.vector, // participates in preview features
jdk.jartool, // participates in preview features
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -43,7 +43,7 @@
* <p>
* <b>IPP Compatibility:</b> This attribute is not an IPP 1.1 attribute; it is
* an attribute in the Production Printing Extension
* (<a href="ftp://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf">
* (<a href="https://ftp.pwg.org/pub/pwg/standards/temp_archive/pwg5100.3.pdf">
* PDF</a>) of IPP 1.1. The category name returned by {@code getName()} is the
* IPP attribute name. The enumeration's integer value is the IPP enum value.
* The {@code toString()} method returns the IPP string representation of the
Expand Down
3 changes: 0 additions & 3 deletions src/java.se/share/classes/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* questions.
*/

import jdk.internal.javac.ParticipatesInPreview;

/**
* Defines the API of the Java SE Platform.
*
Expand All @@ -40,7 +38,6 @@
* @moduleGraph
* @since 9
*/
@ParticipatesInPreview
module java.se {
requires transitive java.base;
requires transitive java.compiler;
Expand Down
2 changes: 1 addition & 1 deletion src/java.sql/share/classes/java/sql/SQLPermission.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* A {@code SQLPermission} object contains
* a name (also referred to as a "target name") but no actions
* list; there is either a named permission or there is not.
* The target name is the name of the permission (see below). The
* The target name is the name of the permission. The
* naming convention follows the hierarchical property naming convention.
* In addition, an asterisk
* may appear at the end of the name, following a ".", or by itself, to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static int value(Set<RequiresFlag> s) {

@Override
public String toString() {
return String.format("ACC_%s (0x%04x", name(), value);
return String.format("ACC_%s (0x%04x)", name(), value);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ public boolean participatesInPreview(Symtab syms, ModuleSymbol m) {
// s participates in the preview API
return syms.java_base.exports.stream()
.filter(ed -> ed.packge.fullname == names.jdk_internal_javac)
.anyMatch(ed -> ed.modules.contains(m));
.anyMatch(ed -> ed.modules.contains(m)) ||
//the specification lists the java.se module as participating in preview:
m.name == names.java_se;
}

/**
Expand Down
15 changes: 10 additions & 5 deletions src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java
Original file line number Diff line number Diff line change
Expand Up @@ -2587,17 +2587,22 @@ public void visitApply(JCMethodInvocation tree) {
chk.checkRefType(qualifier.pos(),
attribExpr(qualifier, localEnv,
encl));
} else if (methName == names._super) {
// qualifier omitted; check for existence
// of an appropriate implicit qualifier.
checkNewInnerClass(tree.meth.pos(), localEnv, site, true);
}
} else if (tree.meth.hasTag(SELECT)) {
log.error(tree.meth.pos(),
Errors.IllegalQualNotIcls(site.tsym));
attribExpr(((JCFieldAccess) tree.meth).selected, localEnv, site);
}

if (tree.meth.hasTag(IDENT)) {
// non-qualified super(...) call; check whether explicit constructor
// invocation is well-formed. If the super class is an inner class,
// make sure that an appropriate implicit qualifier exists. If the super
// class is a local class, make sure that the current class is defined
// in the same context as the local class.
checkNewInnerClass(tree.meth.pos(), localEnv, site, true);
}

// if we're calling a java.lang.Enum constructor,
// prefix the implicit String and int parameters
if (site.tsym == syms.enumSym)
Expand Down Expand Up @@ -3065,7 +3070,7 @@ public void report(DiagnosticPosition _unused, JCDiagnostic details) {
}

void checkNewInnerClass(DiagnosticPosition pos, Env<AttrContext> env, Type type, boolean isSuper) {
boolean isLocal = type.tsym.owner.kind == MTH;
boolean isLocal = type.tsym.owner.kind == VAR || type.tsym.owner.kind == MTH;
if ((type.tsym.flags() & (INTERFACE | ENUM | RECORD)) != 0 ||
(!isLocal && !type.tsym.isInner()) ||
(isSuper && env.enclClass.sym.isAnonymous())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3834,7 +3834,7 @@ Symbol findSelfContaining(DiagnosticPosition pos,
*/
Symbol findLocalClassOwner(Env<AttrContext> env, TypeSymbol c) {
Symbol owner = c.owner;
Assert.check(owner.kind == MTH);
Assert.check(owner.kind == MTH || owner.kind == VAR);
Env<AttrContext> env1 = env;
boolean staticOnly = false;
while (env1.outer != null) {
Expand All @@ -3846,7 +3846,9 @@ Symbol findLocalClassOwner(Env<AttrContext> env, TypeSymbol c) {
if (isStatic(env1)) staticOnly = true;
env1 = env1.outer;
}
return methodNotFound;
return owner.kind == MTH ?
methodNotFound :
varNotFound;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3770,7 +3770,7 @@ compiler.misc.cant.resolve.modules=\
cannot resolve modules

compiler.misc.bad.requires.flag=\
bad requires flag: {0}
invalid flag for "requires java.base": {0}

# 0: string
compiler.err.invalid.module.specifier=\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ public static Names instance(Context context) {

// module names
public final Name java_base;
public final Name java_se;
public final Name jdk_unsupported;

// attribute names
Expand Down Expand Up @@ -315,6 +316,7 @@ public Names(Context context) {

// module names
java_base = fromString("java.base");
java_se = fromString("java.se");
jdk_unsupported = fromString("jdk.unsupported");

// attribute names
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2869,6 +2869,10 @@ private static ReductionOperation<ByteVector, VectorMask<Byte>> reductionOperati
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (byte) Math.min(a, b)));
case VECTOR_OP_MAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (byte) Math.max(a, b)));
case VECTOR_OP_UMIN: return (v, m) ->
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (byte) VectorMath.minUnsigned(a, b)));
case VECTOR_OP_UMAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (byte) VectorMath.maxUnsigned(a, b)));
case VECTOR_OP_AND: return (v, m) ->
toBits(v.rOp((byte)-1, m, (i, a, b) -> (byte)(a & b)));
case VECTOR_OP_OR: return (v, m) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2854,6 +2854,10 @@ private static ReductionOperation<IntVector, VectorMask<Integer>> reductionOpera
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (int) Math.min(a, b)));
case VECTOR_OP_MAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (int) Math.max(a, b)));
case VECTOR_OP_UMIN: return (v, m) ->
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (int) VectorMath.minUnsigned(a, b)));
case VECTOR_OP_UMAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (int) VectorMath.maxUnsigned(a, b)));
case VECTOR_OP_AND: return (v, m) ->
toBits(v.rOp((int)-1, m, (i, a, b) -> (int)(a & b)));
case VECTOR_OP_OR: return (v, m) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2720,6 +2720,10 @@ private static ReductionOperation<LongVector, VectorMask<Long>> reductionOperati
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (long) Math.min(a, b)));
case VECTOR_OP_MAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (long) Math.max(a, b)));
case VECTOR_OP_UMIN: return (v, m) ->
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (long) VectorMath.minUnsigned(a, b)));
case VECTOR_OP_UMAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (long) VectorMath.maxUnsigned(a, b)));
case VECTOR_OP_AND: return (v, m) ->
toBits(v.rOp((long)-1, m, (i, a, b) -> (long)(a & b)));
case VECTOR_OP_OR: return (v, m) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2870,6 +2870,10 @@ private static ReductionOperation<ShortVector, VectorMask<Short>> reductionOpera
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (short) Math.min(a, b)));
case VECTOR_OP_MAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (short) Math.max(a, b)));
case VECTOR_OP_UMIN: return (v, m) ->
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> (short) VectorMath.minUnsigned(a, b)));
case VECTOR_OP_UMAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> (short) VectorMath.maxUnsigned(a, b)));
case VECTOR_OP_AND: return (v, m) ->
toBits(v.rOp((short)-1, m, (i, a, b) -> (short)(a & b)));
case VECTOR_OP_OR: return (v, m) ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3375,6 +3375,12 @@ public abstract class $abstractvectortype$ extends AbstractVector<$Boxtype$> {
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> ($type$) Math.min(a, b)));
case VECTOR_OP_MAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> ($type$) Math.max(a, b)));
#if[!FP]
case VECTOR_OP_UMIN: return (v, m) ->
toBits(v.rOp(MAX_OR_INF, m, (i, a, b) -> ($type$) VectorMath.minUnsigned(a, b)));
case VECTOR_OP_UMAX: return (v, m) ->
toBits(v.rOp(MIN_OR_INF, m, (i, a, b) -> ($type$) VectorMath.maxUnsigned(a, b)));
#end[!FP]
#if[BITWISE]
case VECTOR_OP_AND: return (v, m) ->
toBits(v.rOp(($type$)-1, m, (i, a, b) -> ($type$)(a & b)));
Expand Down
Loading

0 comments on commit 5178b7e

Please sign in to comment.