Skip to content

Commit 85ebcc9

Browse files
Merge in jdk-24+34 (24.2)
PullRequest: labsjdk-ce/148
2 parents e98f5ae + 8318b67 commit 85ebcc9

File tree

135 files changed

+5521
-2040
lines changed

Some content is hidden

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

135 files changed

+5521
-2040
lines changed

make/modules/jdk.incubator.vector/Lib.gmk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2021, 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
@@ -64,7 +64,7 @@ ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, aarch64)+$(INCLUDE_COMPILER2
6464
EXTRA_SRC := libsleef/generated, \
6565
DISABLED_WARNINGS_gcc := unused-function sign-compare tautological-compare ignored-qualifiers, \
6666
DISABLED_WARNINGS_clang := unused-function sign-compare tautological-compare ignored-qualifiers, \
67-
CFLAGS := $(SVE_CFLAGS), \
67+
vector_math_sve.c_CFLAGS := $(SVE_CFLAGS), \
6868
))
6969

7070
TARGETS += $(BUILD_LIBSLEEF)

src/hotspot/share/opto/callGenerator.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,9 @@ JVMState* PredictedCallGenerator::generate(JVMState* jvms) {
933933

934934
// Make the hot call:
935935
JVMState* new_jvms = _if_hit->generate(kit.sync_jvms());
936+
if (kit.failing()) {
937+
return nullptr;
938+
}
936939
if (new_jvms == nullptr) {
937940
// Inline failed, so make a direct call.
938941
assert(_if_hit->is_inline(), "must have been a failed inline");
@@ -1260,6 +1263,9 @@ JVMState* PredicatedIntrinsicGenerator::generate(JVMState* jvms) {
12601263
PreserveJVMState pjvms(&kit);
12611264
// Generate intrinsic code:
12621265
JVMState* new_jvms = _intrinsic->generate(kit.sync_jvms());
1266+
if (kit.failing()) {
1267+
return nullptr;
1268+
}
12631269
if (new_jvms == nullptr) {
12641270
// Intrinsic failed, use normal compilation path for this predicate.
12651271
slow_region->add_req(kit.control());

src/hotspot/share/opto/library_call.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4309,7 +4309,12 @@ Node* LibraryCallKit::generate_array_guard_common(Node* kls, RegionNode* region,
43094309
if (obj != nullptr && is_array_ctrl != nullptr && is_array_ctrl != top()) {
43104310
// Keep track of the fact that 'obj' is an array to prevent
43114311
// array specific accesses from floating above the guard.
4312-
*obj = _gvn.transform(new CastPPNode(is_array_ctrl, *obj, TypeAryPtr::BOTTOM));
4312+
Node* cast = _gvn.transform(new CastPPNode(is_array_ctrl, *obj, TypeAryPtr::BOTTOM));
4313+
// Check for top because in rare cases, the type system can determine that
4314+
// the object can't be an array but the layout helper check is not folded.
4315+
if (!cast->is_top()) {
4316+
*obj = cast;
4317+
}
43134318
}
43144319
return ctrl;
43154320
}

src/hotspot/share/opto/library_call.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ class LibraryCallKit : public GraphKit {
106106
void push_result() {
107107
// Push the result onto the stack.
108108
if (!stopped() && result() != nullptr) {
109+
if (result()->is_top()) {
110+
assert(false, "Can't determine return value.");
111+
C->record_method_not_compilable("Can't determine return value.");
112+
}
109113
BasicType bt = result()->bottom_type()->basic_type();
110114
push_node(bt, result());
111115
}

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

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 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
@@ -30,37 +30,70 @@
3030
import jdk.internal.classfile.impl.AccessFlagsImpl;
3131

3232
/**
33-
* Models the access flags for a class, method, or field. Delivered as a
34-
* {@link ClassElement}, {@link FieldElement}, or {@link MethodElement}
35-
* when traversing the corresponding model type.
33+
* Models the access flags for a class, method, or field. The access flags
34+
* appears exactly once in each class, method, or field; a {@link
35+
* ClassBuilder} and a {@link FieldBuilder} chooses an unspecified default value
36+
* if access flags are not provided, and a {@link MethodBuilder} is always
37+
* created with access flags.
38+
* <p>
39+
* {@code AccessFlags} cannot be created via a factory method directly; it can
40+
* be created with {@code withFlags} methods on the respective builders.
41+
* <p>
42+
* A {@link MethodBuilder} throws an {@link IllegalArgumentException} if it is
43+
* supplied an {@code AccessFlags} object that changes the preexisting
44+
* {@link ClassFile#ACC_STATIC ACC_STATIC} flag of the builder, because the
45+
* access flag change may invalidate previously supplied data to the builder.
3646
*
47+
* @apiNote
48+
* The access flags of classes, methods, and fields are modeled as a standalone
49+
* object to support streaming as elements for {@link ClassFileTransform}.
50+
* Other access flags are not elements of a {@link CompoundElement} and thus not
51+
* modeled by {@code AccessFlags}; they provide their own {@code flagsMask},
52+
* {@code flags}, and {@code has} methods.
53+
*
54+
* @see ClassModel#flags()
55+
* @see FieldModel#flags()
56+
* @see MethodModel#flags()
57+
* @see ClassBuilder#withFlags
58+
* @see FieldBuilder#withFlags
59+
* @see MethodBuilder#withFlags
3760
* @since 24
3861
*/
3962
public sealed interface AccessFlags
4063
extends ClassElement, MethodElement, FieldElement
4164
permits AccessFlagsImpl {
4265

4366
/**
44-
* {@return the access flags, as a bit mask}
67+
* {@return the access flags, as a bit mask} It is in the range of unsigned
68+
* short, {@code [0, 0xFFFF]}.
4569
*/
4670
int flagsMask();
4771

4872
/**
49-
* {@return the access flags}
73+
* {@return the access flags, as a set of flag enums}
74+
*
75+
* @throws IllegalArgumentException if the flags mask has any undefined bit set
76+
* @see #location()
5077
*/
5178
Set<AccessFlag> flags();
5279

5380
/**
54-
* {@return whether the specified flag is present} The specified flag
55-
* should be a valid flag for the classfile location associated with this
56-
* element otherwise false is returned.
81+
* {@return whether the specified flag is set} If the specified flag
82+
* is not available to this {@linkplain #location() location}, returns
83+
* {@code false}.
84+
*
5785
* @param flag the flag to test
86+
* @see #location()
5887
*/
5988
boolean has(AccessFlag flag);
6089

6190
/**
62-
* {@return the classfile location for this element, which is either class,
63-
* method, or field}
91+
* {@return the {@code class} file location for this element, which is
92+
* either class, method, or field}
93+
*
94+
* @see AccessFlag.Location#CLASS
95+
* @see AccessFlag.Location#FIELD
96+
* @see AccessFlag.Location#METHOD
6497
*/
6598
AccessFlag.Location location();
6699
}

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 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
@@ -41,8 +41,9 @@
4141
* type_annotation} structure (JVMS {@jvms 4.7.20}). This model indicates the
4242
* interface of the annotation and a set of element-value pairs.
4343
* <p>
44-
* This model can reconstruct an annotation, given the location of the modeled structure
45-
* in the class file and the definition of the annotation interface.
44+
* This model can reconstruct an annotation, given the location of the modeled
45+
* structure in the {@code class} file and the definition of the annotation
46+
* interface.
4647
* <p>
4748
* Two {@code Annotation} objects should be compared using the {@link
4849
* Object#equals(Object) equals} method.
@@ -54,8 +55,8 @@
5455
* elements with default values (JLS {@jls 9.6.2}), and whether the reconstructed annotation
5556
* is a container annotation for multiple annotations (JLS {@jls 9.7.5}).
5657
*
57-
* @see AnnotationElement
58-
* @see AnnotationValue
58+
* @see java.lang.annotation.Annotation
59+
* @see java.lang.reflect.AnnotatedElement Annotations in core reflection
5960
* @see TypeAnnotation
6061
* @see RuntimeVisibleAnnotationsAttribute
6162
* @see RuntimeInvisibleAnnotationsAttribute
@@ -70,11 +71,15 @@ public sealed interface Annotation
7071
/**
7172
* {@return the constant pool entry holding the {@linkplain Class#descriptorString
7273
* descriptor string} of the annotation interface}
74+
*
75+
* @see java.lang.annotation.Annotation#annotationType()
7376
*/
7477
Utf8Entry className();
7578

7679
/**
7780
* {@return the annotation interface, as a symbolic descriptor}
81+
*
82+
* @see java.lang.annotation.Annotation#annotationType()
7883
*/
7984
default ClassDesc classSymbol() {
8085
return Util.fieldTypeSymbol(className());

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 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
@@ -40,8 +40,8 @@
4040
* {@link Object#equals(Object) equals} method.
4141
*
4242
* @see Annotation
43-
* @see AnnotationValue
44-
*
43+
* @see java.lang.reflect.AnnotatedElement Annotations in core reflection
44+
* @jvms 4.7.16.1 The {@code element_value} structure
4545
* @since 24
4646
*/
4747
public sealed interface AnnotationElement

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2022, 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
@@ -45,6 +45,7 @@
4545
*
4646
* @see Annotation
4747
* @see AnnotationElement
48+
* @see java.lang.reflect.AnnotatedElement Annotations in core reflection
4849
*
4950
* @sealedGraph
5051
* @since 24
@@ -53,7 +54,7 @@ public sealed interface AnnotationValue {
5354

5455
/**
5556
* Models an annotation value of an element-value pair.
56-
* The {@linkplain #tag tag} of this value is {@value TAG_ANNOTATION}.
57+
* The {@linkplain #tag tag} of this value is {@value %c TAG_ANNOTATION}.
5758
*
5859
* @since 24
5960
*/
@@ -65,7 +66,7 @@ sealed interface OfAnnotation extends AnnotationValue
6566

6667
/**
6768
* Models an array value of an element-value pair.
68-
* The {@linkplain #tag tag} of this value is {@value TAG_ARRAY}.
69+
* The {@linkplain #tag tag} of this value is {@value %c TAG_ARRAY}.
6970
*
7071
* @since 24
7172
*/
@@ -121,7 +122,7 @@ sealed interface OfConstant extends AnnotationValue {
121122

122123
/**
123124
* Models a string value of an element-value pair.
124-
* The {@linkplain #tag tag} of this value is {@value TAG_STRING}.
125+
* The {@linkplain #tag tag} of this value is {@value %c TAG_STRING}.
125126
*
126127
* @since 24
127128
*/
@@ -148,7 +149,7 @@ default String resolvedValue() {
148149

149150
/**
150151
* Models a double value of an element-value pair.
151-
* The {@linkplain #tag tag} of this value is {@value TAG_DOUBLE}.
152+
* The {@linkplain #tag tag} of this value is {@value %c TAG_DOUBLE}.
152153
*
153154
* @since 24
154155
*/
@@ -175,7 +176,7 @@ default Double resolvedValue() {
175176

176177
/**
177178
* Models a float value of an element-value pair.
178-
* The {@linkplain #tag tag} of this value is {@value TAG_FLOAT}.
179+
* The {@linkplain #tag tag} of this value is {@value %c TAG_FLOAT}.
179180
*
180181
* @since 24
181182
*/
@@ -202,7 +203,7 @@ default Float resolvedValue() {
202203

203204
/**
204205
* Models a long value of an element-value pair.
205-
* The {@linkplain #tag tag} of this value is {@value TAG_LONG}.
206+
* The {@linkplain #tag tag} of this value is {@value %c TAG_LONG}.
206207
*
207208
* @since 24
208209
*/
@@ -229,7 +230,7 @@ default Long resolvedValue() {
229230

230231
/**
231232
* Models an int value of an element-value pair.
232-
* The {@linkplain #tag tag} of this value is {@value TAG_INT}.
233+
* The {@linkplain #tag tag} of this value is {@value %c TAG_INT}.
233234
*
234235
* @since 24
235236
*/
@@ -256,7 +257,7 @@ default Integer resolvedValue() {
256257

257258
/**
258259
* Models a short value of an element-value pair.
259-
* The {@linkplain #tag tag} of this value is {@value TAG_SHORT}.
260+
* The {@linkplain #tag tag} of this value is {@value %c TAG_SHORT}.
260261
*
261262
* @since 24
262263
*/
@@ -286,7 +287,7 @@ default Short resolvedValue() {
286287

287288
/**
288289
* Models a char value of an element-value pair.
289-
* The {@linkplain #tag tag} of this value is {@value TAG_CHAR}.
290+
* The {@linkplain #tag tag} of this value is {@value %c TAG_CHAR}.
290291
*
291292
* @since 24
292293
*/
@@ -316,7 +317,7 @@ default Character resolvedValue() {
316317

317318
/**
318319
* Models a byte value of an element-value pair.
319-
* The {@linkplain #tag tag} of this value is {@value TAG_BYTE}.
320+
* The {@linkplain #tag tag} of this value is {@value %c TAG_BYTE}.
320321
*
321322
* @since 24
322323
*/
@@ -346,7 +347,7 @@ default Byte resolvedValue() {
346347

347348
/**
348349
* Models a boolean value of an element-value pair.
349-
* The {@linkplain #tag tag} of this value is {@value TAG_BOOLEAN}.
350+
* The {@linkplain #tag tag} of this value is {@value %c TAG_BOOLEAN}.
350351
*
351352
* @since 24
352353
*/
@@ -376,7 +377,7 @@ default Boolean resolvedValue() {
376377

377378
/**
378379
* Models a class value of an element-value pair.
379-
* The {@linkplain #tag tag} of this value is {@value TAG_CLASS}.
380+
* The {@linkplain #tag tag} of this value is {@value %c TAG_CLASS}.
380381
*
381382
* @since 24
382383
*/
@@ -393,7 +394,7 @@ default ClassDesc classSymbol() {
393394

394395
/**
395396
* Models an enum value of an element-value pair.
396-
* The {@linkplain #tag tag} of this value is {@value TAG_ENUM}.
397+
* The {@linkplain #tag tag} of this value is {@value %c TAG_ENUM}.
397398
*
398399
* @since 24
399400
*/

0 commit comments

Comments
 (0)