Skip to content

Commit 35b9b61

Browse files
committed
Merge master HEAD into openj9-staging
Signed-off-by: J9 Build <[email protected]>
2 parents d41e8a8 + 4d7a936 commit 35b9b61

File tree

20 files changed

+297
-79
lines changed

20 files changed

+297
-79
lines changed

make/hotspot/lib/CompileJvm.gmk

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2013, 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
@@ -127,9 +127,7 @@ else ifeq ($(call And, $(call isTargetOs, linux) $(call isTargetCpu, aarch64)),
127127
endif
128128
endif
129129

130-
ifeq ($(call isTargetOs, linux macosx windows), true)
131-
JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp
132-
endif
130+
JVM_PRECOMPILED_HEADER := $(TOPDIR)/src/hotspot/share/precompiled/precompiled.hpp
133131

134132
ifeq ($(call isTargetCpu, x86), true)
135133
JVM_EXCLUDE_PATTERNS += x86_64

make/hotspot/lib/JvmOverrideFiles.gmk

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,7 @@ else ifeq ($(call isTargetOs, macosx), true)
118118
endif
119119

120120
else ifeq ($(call isTargetOs, aix), true)
121-
ifeq ($(TOOLCHAIN_TYPE), clang)
122-
BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -fno-inline
123-
else
124-
BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -qnoinline
125-
endif
121+
BUILD_LIBJVM_synchronizer.cpp_CXXFLAGS := -fno-inline
126122
BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE)
127123
# Disable aggressive optimizations for functions in sharedRuntimeTrig.cpp
128124
# and sharedRuntimeTrans.cpp on ppc64.
@@ -146,6 +142,13 @@ else ifeq ($(call isTargetOs, aix), true)
146142
# Disable ELF decoder on AIX (AIX uses XCOFF).
147143
JVM_EXCLUDE_PATTERNS += elf
148144

145+
JVM_PRECOMPILED_HEADER_EXCLUDE := \
146+
sharedRuntimeTrig.cpp \
147+
sharedRuntimeTrans.cpp \
148+
synchronizer.cpp \
149+
$(OPT_SPEED_SRC) \
150+
#
151+
149152
else ifeq ($(call isTargetOs, windows), true)
150153
JVM_PRECOMPILED_HEADER_EXCLUDE := \
151154
bytecodeInterpreter.cpp \

src/java.base/share/classes/java/security/KeyPairGenerator.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,9 @@
6868
* <p>Since no other parameters are specified when you call the above
6969
* algorithm-independent {@code initialize} methods, it is up to the
7070
* provider what to do about the algorithm-specific parameters (if any) to be
71-
* associated with each of the keys.
72-
*
73-
* <p>If the algorithm is the <i>DSA</i> algorithm, and the keysize (modulus
74-
* size) is 512, 768, 1024, or 2048, then the <i>Sun</i> provider uses a set of
75-
* precomputed values for the {@code p}, {@code q}, and
76-
* {@code g} parameters. If the modulus size is not one of the above
77-
* values, the <i>Sun</i> provider creates a new set of parameters. Other
78-
* providers might have precomputed parameter sets for more than just the
79-
* modulus sizes mentioned above. Still others might not have a list of
80-
* precomputed parameters at all and instead always create new parameter sets.
71+
* associated with each of the keys. See the
72+
* {@extLink security_guide_jdk_providers JDK Providers} document for information
73+
* on the default algorithm-specific parameters used by JDK providers.
8174
*
8275
* <li><b>Algorithm-Specific Initialization</b>
8376
* <p>For situations where a set of algorithm-specific parameters already

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,10 @@
3232
import java.io.InputStream;
3333
import java.io.IOException;
3434
import java.io.Serializable;
35-
import java.text.ParseException;
36-
import java.text.SimpleDateFormat;
35+
import java.time.LocalDateTime;
36+
import java.time.ZoneOffset;
37+
import java.time.format.DateTimeFormatter;
38+
import java.time.format.DateTimeParseException;
3739
import java.util.concurrent.ConcurrentHashMap;
3840
import java.util.concurrent.ConcurrentMap;
3941
import java.util.regex.Pattern;
@@ -1156,7 +1158,7 @@ private static Optional<CurrencyProperty> getValidEntry(String ctry,
11561158
&& !isPastCutoverDate(prop.date)) {
11571159
prop = null;
11581160
}
1159-
} catch (ParseException ex) {
1161+
} catch (DateTimeParseException ex) {
11601162
prop = null;
11611163
}
11621164
}
@@ -1196,15 +1198,12 @@ private static boolean containsInconsistentInstances(
11961198
|| prop.fraction != fractionDigit);
11971199
}
11981200

1199-
private static boolean isPastCutoverDate(String s)
1200-
throws ParseException {
1201-
SimpleDateFormat format = new SimpleDateFormat(
1202-
"yyyy-MM-dd'T'HH:mm:ss", Locale.ROOT);
1203-
format.setTimeZone(TimeZone.getTimeZone("UTC"));
1204-
format.setLenient(false);
1205-
long time = format.parse(s.trim()).getTime();
1206-
return System.currentTimeMillis() > time;
1207-
1201+
// cutOver adheres to ISO8601 Local Date Time format (excluding nano secs)
1202+
private static boolean isPastCutoverDate(String cutOver) {
1203+
return System.currentTimeMillis() >
1204+
LocalDateTime.parse(cutOver, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
1205+
.toInstant(ZoneOffset.UTC)
1206+
.toEpochMilli();
12081207
}
12091208

12101209
private static void info(String message, Throwable t) {

src/java.rmi/share/classes/sun/rmi/log/LogInputStream.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,4 @@ public int available() throws IOException {
124124
public void close() {
125125
length = 0;
126126
}
127-
128-
/**
129-
* Closes the stream when garbage is collected.
130-
*/
131-
@SuppressWarnings("removal")
132-
protected void finalize() throws IOException {
133-
close();
134-
}
135127
}

src/jdk.naming.rmi/share/classes/com/sun/jndi/rmi/registry/RegistryContext.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@ public RegistryContext(String host, int port, Hashtable<?, ?> env)
100100
reference = ctx.reference;
101101
}
102102

103-
@SuppressWarnings("removal")
104-
protected void finalize() {
105-
close();
106-
}
107-
108103
public Object lookup(Name name) throws NamingException {
109104
if (name.isEmpty()) {
110105
return (new RegistryContext(this));
@@ -557,11 +552,6 @@ class BindingEnumeration implements NamingEnumeration<Binding> {
557552
nextName = 0;
558553
}
559554

560-
@SuppressWarnings("removal")
561-
protected void finalize() {
562-
ctx.close();
563-
}
564-
565555
public boolean hasMore() {
566556
if (nextName >= names.length) {
567557
ctx.close();
@@ -598,8 +588,7 @@ public Binding nextElement() {
598588
}
599589
}
600590

601-
@SuppressWarnings("deprecation")
602591
public void close () {
603-
finalize();
592+
ctx.close();
604593
}
605594
}

test/hotspot/jtreg/compiler/intrinsics/TestContinuationPinningAndEA.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
/**
2525
* @test
26+
* @requires vm.continuations
2627
* @bug 8347997
2728
* @summary Test that Continuation.pin() and unpin() intrinsics work with EA.
2829
* @modules java.base/jdk.internal.vm

test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/IncompatibleOptions.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 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
@@ -78,10 +78,6 @@
7878
import jdk.test.whitebox.gc.GC;
7979

8080
public class IncompatibleOptions {
81-
static final String COOPS_DUMP_WARNING =
82-
"Cannot dump shared archive when UseCompressedOops or UseCompressedClassPointers is off";
83-
static final String GC_WARNING =
84-
"Archived java heap is not supported";
8581
static final String OBJ_ALIGNMENT_MISMATCH =
8682
"The shared archive file's ObjectAlignmentInBytes of .* does not equal the current ObjectAlignmentInBytes of";
8783
static final String COMPACT_STRING_MISMATCH =

test/jdk/java/net/httpclient/HttpRequestBuilderTest.java

Lines changed: 52 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 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
@@ -25,6 +25,9 @@
2525
import java.net.http.HttpClient;
2626
import java.time.Duration;
2727
import java.util.Arrays;
28+
import java.util.List;
29+
import java.util.Map;
30+
import java.util.Objects;
2831
import java.util.function.BiFunction;
2932
import java.util.function.Function;
3033
import java.util.function.Supplier;
@@ -34,11 +37,12 @@
3437
import static java.net.http.HttpRequest.BodyPublishers.ofString;
3538
import static java.net.http.HttpRequest.BodyPublishers.noBody;
3639

37-
/**
40+
/*
3841
* @test
3942
* @bug 8170064 8276559
40-
* @summary HttpRequest[.Builder] API and behaviour checks
43+
* @summary HttpRequest[.Builder] API and behaviour checks
4144
*/
45+
4246
public class HttpRequestBuilderTest {
4347

4448
static final URI TEST_URI = URI.create("http://www.foo.com/");
@@ -262,13 +266,11 @@ public static void main(String[] args) throws Exception {
262266
// verify that the default HEAD() method implementation in HttpRequest.Builder
263267
// interface works as expected
264268
HttpRequest defaultHeadReq = new NotOverriddenHEADImpl().HEAD().uri(TEST_URI).build();
265-
String actualMethod = defaultHeadReq.method();
266-
if (!actualMethod.equals("HEAD")) {
267-
throw new AssertionError("failed: expected HEAD method but got method: " + actualMethod);
268-
}
269-
if (defaultHeadReq.bodyPublisher().isEmpty()) {
270-
throw new AssertionError("failed: missing bodyPublisher on HEAD request");
271-
}
269+
assertEquals("HEAD", defaultHeadReq.method(), "Method");
270+
assertEquals(false, defaultHeadReq.bodyPublisher().isEmpty(), "Body publisher absence");
271+
272+
verifyCopy();
273+
272274
}
273275

274276
private static boolean shouldFail(Class<? extends Exception> ...exceptions) {
@@ -295,13 +297,7 @@ static void method(String name,
295297
throw new AssertionError("failed: " + name
296298
+ ". Unexpected body processor for GET: "
297299
+ request.bodyPublisher().get());
298-
299-
if (expectedMethod.equals(method)) {
300-
System.out.println("success: " + name);
301-
} else {
302-
throw new AssertionError("failed: " + name
303-
+ ". Expected " + expectedMethod + ", got " + method);
304-
}
300+
assertEquals(expectedMethod, method, "Method");
305301
}
306302

307303
static void test0(String name,
@@ -378,6 +374,45 @@ public static <R,P1, P2> R test2(String name, R receiver, BiFunction<P1, P2, R>
378374
}
379375
}
380376

377+
private static void verifyCopy() {
378+
379+
// Create the request builder
380+
HttpRequest.Builder requestBuilder = HttpRequest
381+
.newBuilder(TEST_URI)
382+
.header("X-Foo", "1")
383+
.method("GET", noBody())
384+
.expectContinue(true)
385+
.timeout(Duration.ofSeconds(0xBEEF))
386+
.version(HttpClient.Version.HTTP_2);
387+
388+
// Create the original and the _copy_ requests
389+
HttpRequest request = requestBuilder.build();
390+
HttpRequest copiedRequest = requestBuilder
391+
.copy()
392+
.header("X-Foo", "2")
393+
.header("X-Bar", "3")
394+
.build();
395+
396+
// Verify copied _references_
397+
assertEquals(request.uri(), copiedRequest.uri(), "URI");
398+
assertEquals(request.method(), copiedRequest.method(), "Method");
399+
assertEquals(request.expectContinue(), copiedRequest.expectContinue(), "Expect continue setting");
400+
assertEquals(request.timeout(), copiedRequest.timeout(), "Timeout");
401+
assertEquals(request.version(), copiedRequest.version(), "Version");
402+
403+
// Verify headers
404+
assertEquals(request.headers().map(), Map.of("X-Foo", List.of("1")), "Request headers");
405+
assertEquals(copiedRequest.headers().map(), Map.of("X-Foo", List.of("1", "2"), "X-Bar", List.of("3")), "Copied request headers");
406+
407+
}
408+
409+
private static void assertEquals(Object expected, Object actual, Object name) {
410+
if (!Objects.equals(expected, actual)) {
411+
String message = String.format("%s mismatch!%nExpected: %s%nActual: %s", name, expected, actual);
412+
throw new AssertionError(message);
413+
}
414+
}
415+
381416
// doesn't override the default HEAD() method
382417
private static final class NotOverriddenHEADImpl implements HttpRequest.Builder {
383418
private final HttpRequest.Builder underlying = HttpRequest.newBuilder();

test/jdk/jdk/jfr/event/gc/detailed/TestShenandoahEvacuationInformationEvent.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class TestShenandoahEvacuationInformationEvent {
4949

5050
public static void main(String[] args) throws Exception {
5151
final long shenandoahHeapRegionSize = 1024 * 1024;
52+
final long shenandoahMaxHeapRegionCount = 64;
5253
Recording recording = new Recording();
5354
recording.enable(EVENT_NAME).withThreshold(Duration.ofMillis(0));
5455
recording.start();
@@ -63,14 +64,14 @@ public static void main(String[] args) throws Exception {
6364
}
6465
System.out.println("Event: " + event);
6566

66-
long setRegions = Events.assertField(event, "cSetRegions").atLeast(0L).getValue();
67+
long cSetRegions = Events.assertField(event, "cSetRegions").atLeast(0L).getValue();
6768
long setUsedAfter = Events.assertField(event, "cSetUsedAfter").atLeast(0L).getValue();
6869
long setUsedBefore = Events.assertField(event, "cSetUsedBefore").atLeast(setUsedAfter).getValue();
69-
long regionsFreed = Events.assertField(event, "regionsFreed").atLeast(0L).getValue();
70+
long freeRegions = Events.assertField(event, "freeRegions").atLeast(0L).getValue();
7071
Events.assertField(event, "collectedOld").atLeast(0L).getValue();
7172
Events.assertField(event, "collectedYoung").atLeast(0L).getValue();
7273

73-
Asserts.assertGreaterThanOrEqual(setRegions, regionsFreed, "setRegions >= regionsFreed");
74+
Asserts.assertGreaterThanOrEqual(shenandoahMaxHeapRegionCount, freeRegions + cSetRegions, "numRegions >= freeRegions + cSetRegions");
7475
Asserts.assertGreaterThanOrEqual(shenandoahHeapRegionSize * setRegions, setUsedAfter, "ShenandoahHeapRegionSize * setRegions >= setUsedAfter");
7576
Asserts.assertGreaterThanOrEqual(shenandoahHeapRegionSize * setRegions, setUsedBefore, "ShenandoahHeapRegionSize * setRegions >= setUsedBefore");
7677

test/jtreg-ext/requires/VMProps.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 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
@@ -452,7 +452,9 @@ protected String vmCDSForCustomLoaders() {
452452
}
453453

454454
/**
455-
* @return true if this VM can write Java heap objects into the CDS archive
455+
* @return true if it's possible for "java -Xshare:dump" to write Java heap objects
456+
* with the current set of jtreg VM options. For example, false will be returned
457+
* if -XX:-UseCompressedClassPointers is specified,
456458
*/
457459
protected String vmCDSCanWriteArchivedJavaHeap() {
458460
return "" + ("true".equals(vmCDS()) && WB.canWriteJavaHeapArchive()

test/micro/org/openjdk/bench/java/lang/foreign/xor/GetArrayCriticalXorOpImpl.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
/*
2+
* Copyright (c) 2023, 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.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
124
package org.openjdk.bench.java.lang.foreign.xor;
225

326
public class GetArrayCriticalXorOpImpl implements XorOp {

test/micro/org/openjdk/bench/java/lang/foreign/xor/GetArrayElementsXorOpImpl.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
/*
2+
* Copyright (c) 2023, 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.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
124
package org.openjdk.bench.java.lang.foreign.xor;
225

326
public class GetArrayElementsXorOpImpl implements XorOp {

0 commit comments

Comments
 (0)