Skip to content

Commit

Permalink
Merging openj9-openjdk-jdk/openj9 into openj9
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Feng <fengj@ca.ibm.com>
  • Loading branch information
JasonFengJ9 committed Jan 13, 2025
2 parents 15c4b1d + ac2c4bd commit 8fdb6af
Show file tree
Hide file tree
Showing 426 changed files with 10,752 additions and 12,894 deletions.
11 changes: 0 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,6 @@ jobs:
bootjdk-platform: linux-x64
runs-on: ubuntu-22.04

test-macos-x64:
name: macos-x64
needs:
- build-macos-x64
uses: ./.github/workflows/test.yml
with:
platform: macos-x64
bootjdk-platform: macos-x64
runs-on: macos-13
xcode-toolset-version: '14.3.1'

test-macos-aarch64:
name: macos-aarch64
needs:
Expand Down
2 changes: 1 addition & 1 deletion closed/openjdk-tag.gmk
Original file line number Diff line number Diff line change
@@ -1 +1 @@
OPENJDK_TAG := jdk-25+3
OPENJDK_TAG := jdk-25+5
2 changes: 1 addition & 1 deletion doc/hotspot-unit-tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ <h3 id="error-messages">Error messages</h3>
<p>All GoogleTest asserts print compared expressions and their values,
so there is no need to have them in error messages. Asserts print only
compared values, they do not print any of interim variables, e.g.
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8)) || i == 18)</code>
<code>ASSERT_TRUE((val1 == val2 &amp;&amp; isFail(foo(8))) || i == 18)</code>
prints only one value. If you use some complex predicates, please
consider <code>EXPECT_PRED*</code> or <code>EXPECT_FORMAT_PRED</code>
assertions family, they check that a predicate returns true/success and
Expand Down
2 changes: 1 addition & 1 deletion doc/hotspot-unit-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Provide informative, but not too verbose error messages.
All GoogleTest asserts print compared expressions and their values, so
there is no need to have them in error messages. Asserts print only
compared values, they do not print any of interim variables, e.g.
`ASSERT_TRUE((val1 == val2 && isFail(foo(8)) || i == 18)` prints only
`ASSERT_TRUE((val1 == val2 && isFail(foo(8))) || i == 18)` prints only
one value. If you use some complex predicates, please consider
`EXPECT_PRED*` or `EXPECT_FORMAT_PRED` assertions family, they check that
a predicate returns true/success and print out all parameters values.
Expand Down
16 changes: 16 additions & 0 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,22 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
FLAGS_SETUP_BRANCH_PROTECTION
if test "x$FLAGS_CPU" = xriscv64; then
AC_MSG_CHECKING([if RVV/vector sigcontext supported])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <linux/ptrace.h>],
[
return (int)sizeof(struct __riscv_v_ext_state);
])],
[
AC_MSG_RESULT([yes])
],
[
$1_DEFINES_CPU_JVM="${$1_DEFINES_CPU_JVM} -DNO_RVV_SIGCONTEXT"
AC_MSG_RESULT([no])
]
)
fi
# EXPORT to API
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
$TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \
Expand Down
4 changes: 1 addition & 3 deletions make/test/BuildMicrobenchmark.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2025, 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 @@ -96,8 +96,6 @@ $(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
--add-exports java.base/jdk.internal.util=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED \
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
--add-exports java.base/sun.security.util=ALL-UNNAMED \
Expand Down
71 changes: 39 additions & 32 deletions src/java.base/aix/classes/sun/nio/ch/AixPollPort.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2008, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012 SAP SE. All rights reserved.
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024 SAP SE. 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 All @@ -26,15 +26,17 @@

package sun.nio.ch;

import java.nio.channels.spi.AsynchronousChannelProvider;
import sun.nio.ch.Pollset;
import java.io.FileDescriptor;
import java.io.IOException;
import java.util.HashSet;
import java.util.Iterator;
import java.nio.channels.spi.AsynchronousChannelProvider;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.RejectedExecutionException;
import java.util.HashSet;
import java.util.Iterator;
import sun.nio.ch.IOUtil;
import sun.nio.ch.Pollset;

/**
* AsynchronousChannelGroup implementation based on the AIX pollset framework.
Expand Down Expand Up @@ -141,6 +143,8 @@ static class ControlEvent {
sv = new int[2];
try {
Pollset.socketpair(sv);
// make the reading part of the socket nonblocking, so the drain (drain_all) method works
IOUtil.configureBlocking(IOUtil.newFD(sv[0]), false);
// register one end with pollset
Pollset.pollsetCtl(pollset, Pollset.PS_ADD, sv[0], Net.POLLIN);
} catch (IOException x) {
Expand Down Expand Up @@ -271,23 +275,21 @@ private void queueControlEvent(ControlEvent ev) {

// Process all events currently stored in the control queue.
private void processControlQueue() {
synchronized (controlQueue) {
// On Aix it is only possible to set the event
// bits on the first call of pollsetCtl. Later
// calls only add bits, but cannot remove them.
// Therefore, we always remove the file
// descriptor ignoring the error and then add it.
Iterator<ControlEvent> iter = controlQueue.iterator();
while (iter.hasNext()) {
ControlEvent ev = iter.next();
Pollset.pollsetCtl(pollset, Pollset.PS_DELETE, ev.fd(), 0);
if (!ev.removeOnly()) {
ev.setError(Pollset.pollsetCtl(pollset, Pollset.PS_MOD, ev.fd(), ev.events()));
}
iter.remove();
// On Aix it is only possible to set the event
// bits on the first call of pollsetCtl. Later
// calls only add bits, but cannot remove them.
// Therefore, we always remove the file
// descriptor ignoring the error and then add it.
Iterator<ControlEvent> iter = controlQueue.iterator();
while (iter.hasNext()) {
ControlEvent ev = iter.next();
Pollset.pollsetCtl(pollset, Pollset.PS_DELETE, ev.fd(), 0);
if (!ev.removeOnly()) {
ev.setError(Pollset.pollsetCtl(pollset, Pollset.PS_MOD, ev.fd(), ev.events()));
}
controlQueue.notifyAll();
iter.remove();
}
controlQueue.notifyAll();
}

/*
Expand All @@ -306,8 +308,21 @@ private Event poll() throws IOException {
int n;
controlLock.lock();
try {
n = Pollset.pollsetPoll(pollset, address,
int m;
m = n = Pollset.pollsetPoll(pollset, address,
MAX_EVENTS_TO_POLL, Pollset.PS_NO_TIMEOUT);
while (m-- > 0) {
long eventAddress = Pollset.getEvent(address, m);
int fd = Pollset.getDescriptor(eventAddress);

// To emulate one shot semantic we need to remove
// the file descriptor here.
if (fd != sp[0] && fd != ctlSp[0]) {
synchronized (controlQueue) {
Pollset.pollsetCtl(pollset, Pollset.PS_DELETE, fd, 0);
}
}
}
} finally {
controlLock.unlock();
}
Expand All @@ -323,14 +338,6 @@ private Event poll() throws IOException {
long eventAddress = Pollset.getEvent(address, n);
int fd = Pollset.getDescriptor(eventAddress);

// To emulate one shot semantic we need to remove
// the file descriptor here.
if (fd != sp[0] && fd != ctlSp[0]) {
synchronized (controlQueue) {
Pollset.pollsetCtl(pollset, Pollset.PS_DELETE, fd, 0);
}
}

// wakeup
if (fd == sp[0]) {
if (wakeupCount.decrementAndGet() == 0) {
Expand All @@ -350,7 +357,7 @@ private Event poll() throws IOException {
// wakeup to process control event
if (fd == ctlSp[0]) {
synchronized (controlQueue) {
Pollset.drain1(ctlSp[0]);
IOUtil.drain(ctlSp[0]);
processControlQueue();
}
if (n > 0) {
Expand Down
19 changes: 18 additions & 1 deletion src/java.base/aix/native/libjava/ProcessHandleImpl_aix.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,24 @@ jint os_getChildren(JNIEnv *env, jlong jpid, jlongArray jarray,
}

pid_t os_getParentPidAndTimings(JNIEnv *env, pid_t pid, jlong *total, jlong *start) {
return unix_getParentPidAndTimings(env, pid, total, start);
pid_t the_pid = pid;
struct procentry64 ProcessBuffer;

if (getprocs64(&ProcessBuffer, sizeof(ProcessBuffer), NULL, sizeof(struct fdsinfo64), &the_pid, 1) <= 0) {
return -1;
}

// Validate the pid before returning the info
if (kill(pid, 0) < 0) {
return -1;
}

*total = ((ProcessBuffer.pi_ru.ru_utime.tv_sec + ProcessBuffer.pi_ru.ru_stime.tv_sec) * 1000000000L) +
((ProcessBuffer.pi_ru.ru_utime.tv_usec + ProcessBuffer.pi_ru.ru_stime.tv_usec));

*start = ProcessBuffer.pi_start * (jlong)1000;

return (pid_t) ProcessBuffer.pi_ppid;
}

void os_getCmdlineAndUserInfo(JNIEnv *env, jobject jinfo, pid_t pid) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, 2025, 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 @@ -180,8 +180,8 @@ protected byte[] engineDeriveData(AlgorithmParameterSpec derivationSpec)
} else if (derivationSpec instanceof HKDFParameterSpec.Expand anExpand) {
// set this value in the "if"
if ((pseudoRandomKey = anExpand.prk().getEncoded()) == null) {
throw new AssertionError(
"PRK is required for HKDFParameterSpec.Expand");
throw new InvalidAlgorithmParameterException(
"Cannot retrieve PRK for HKDFParameterSpec.Expand");
}
// set this value in the "if"
if ((info = anExpand.info()) == null) {
Expand Down Expand Up @@ -411,4 +411,4 @@ public HKDFSHA512(KDFParameters kdfParameters)
}
}

}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2025, 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 @@ -42,12 +42,12 @@ public class EnumConstantNotPresentException extends RuntimeException {
private static final long serialVersionUID = -6046998521960521108L;

/**
* The type of the missing enum constant.
* @serial The type of the missing enum constant.
*/
private Class<? extends Enum> enumType;

/**
* The name of the missing enum constant.
* @serial The name of the missing enum constant.
*/
private String constantName;

Expand Down
18 changes: 9 additions & 9 deletions src/java.base/share/classes/java/lang/StackTraceElement.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, 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 @@ -64,35 +64,35 @@ public final class StackTraceElement implements java.io.Serializable {

// Normally initialized by VM
/**
* The name of the class loader.
* @serial The name of the class loader.
*/
private String classLoaderName;
/**
* The module name.
* @serial The module name.
*/
private String moduleName;
/**
* The module version.
* @serial The module version.
*/
private String moduleVersion;
/**
* The declaring class.
* @serial The declaring class.
*/
private String declaringClass;
/**
* The method name.
* @serial The method name.
*/
private String methodName;
/**
* The source file name.
* @serial The source file name.
*/
private String fileName;
/**
* The source line number.
* @serial The source line number.
*/
private int lineNumber;
/**
* Control to show full or partial module, package, and class names.
* @serial Control to show full or partial module, package, and class names.
*/
private byte format = 0; // Default to show all

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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 @@ -48,7 +48,7 @@ public class TypeNotPresentException extends RuntimeException {
private static final long serialVersionUID = -5101214195716534496L;

/**
* The type name or the name of a type variable.
* @serial The type name or the name of a type variable.
*/
private String typeName;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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 @@ -48,7 +48,7 @@ public class AnnotationTypeMismatchException extends RuntimeException {
private final transient Method element;

/**
* The (erroneous) type of data found in the annotation. This string
* @serial The (erroneous) type of data found in the annotation. This string
* may, but is not required to, contain the value as well. The exact
* format of the string is unspecified.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2025, 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,11 +43,11 @@ public class IncompleteAnnotationException extends RuntimeException {
private static final long serialVersionUID = 8445097402741811912L;

/**
* The annotation interface.
* @serial The annotation interface.
*/
private Class<? extends Annotation> annotationType;
/**
* The element name.
* @serial The element name.
*/
private String elementName;

Expand Down
Loading

0 comments on commit 8fdb6af

Please sign in to comment.