Skip to content

Commit

Permalink
(valhalla) Merging openj9-openjdk-jdk/openj9 into openj9
Browse files Browse the repository at this point in the history
Conflicts:
	make/test/JtregNativeHotspot.gmk

Signed-off-by: Jason Feng <[email protected]>
  • Loading branch information
JasonFengJ9 committed Nov 9, 2023
2 parents ff20874 + 7ed7cc9 commit 6095031
Show file tree
Hide file tree
Showing 109 changed files with 2,959 additions and 1,022 deletions.
2 changes: 1 addition & 1 deletion doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ <h2 id="native-compiler-toolchain-requirements">Native Compiler
</tr>
<tr class="odd">
<td>Windows</td>
<td>Microsoft Visual Studio 2022 update 17.1.0</td>
<td>Microsoft Visual Studio 2022 version 17.6.5</td>
</tr>
</tbody>
</table>
Expand Down
10 changes: 5 additions & 5 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,11 @@ possible to compile the JDK with both older and newer versions, but the closer
you stay to this list, the more likely you are to compile successfully without
issues.

| Operating system | Toolchain version |
| ------------------ | ------------------------------------------ |
| Linux | gcc 11.2.0 |
| macOS | Apple Xcode 14.3.1 (using clang 14.0.3) |
| Windows | Microsoft Visual Studio 2022 update 17.1.0 |
| Operating system | Toolchain version |
| ------------------ | ------------------------------------------- |
| Linux | gcc 11.2.0 |
| macOS | Apple Xcode 14.3.1 (using clang 14.0.3) |
| Windows | Microsoft Visual Studio 2022 version 17.6.5 |

All compilers are expected to be able to compile to the C99 language standard,
as some C99 features are used in the source code. Microsoft Visual Studio
Expand Down
2 changes: 1 addition & 1 deletion make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ var getJibProfilesDependencies = function (input, common) {
var devkit_platform_revisions = {
linux_x64: "gcc11.2.0-OL6.4+1.0",
macosx: "Xcode14.3.1+1.0",
windows_x64: "VS2022-17.1.0+1.1",
windows_x64: "VS2022-17.6.5+1.0",
linux_aarch64: input.build_cpu == "x64" ? "gcc11.2.0-OL7.6+1.1" : "gcc11.2.0-OL7.6+1.0",
linux_arm: "gcc8.2.0-Fedora27+1.0",
linux_ppc64le: "gcc8.2.0-Fedora27+1.0",
Expand Down
11 changes: 10 additions & 1 deletion make/jdk/src/classes/build/tools/taglet/SealedGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ private String relativeLink(TypeElement node) {
var forwardNavigator = nodePackage.getQualifiedName().toString()
.replace(".", "/");

return backNavigator + forwardNavigator + "/" + node.getSimpleName() + ".html";
return backNavigator + forwardNavigator + "/" + packagelessCanonicalName(node) + ".html";
}

public void addEdge(TypeElement node, TypeElement subNode) {
Expand Down Expand Up @@ -315,5 +315,14 @@ private static Optional<String> packageName(TypeElement element) {
case MEMBER -> packageName((TypeElement) element.getEnclosingElement());
};
}

private static String packagelessCanonicalName(TypeElement element) {
String result = element.getSimpleName().toString();
while (element.getNestingKind() == NestingKind.MEMBER) {
element = (TypeElement) element.getEnclosingElement();
result = element.getSimpleName().toString() + '.' + result;
}
return result;
}
}
}
5 changes: 4 additions & 1 deletion make/modules/java.desktop/lib/Awt2dLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,10 @@ else
endif

# hb-ft.cc is not presently needed, and requires freetype 2.4.2 or later.
LIBFONTMANAGER_EXCLUDE_FILES += libharfbuzz/hb-ft.cc
# hb-subset and hb-style APIs are not needed, excluded to cut on compilation time.
LIBFONTMANAGER_EXCLUDE_FILES += hb-ft.cc hb-subset-cff-common.cc \
hb-subset-cff1.cc hb-subset-cff2.cc hb-subset-input.cc hb-subset-plan.cc \
hb-subset.cc hb-subset-instancer-solver.cc gsubgpos-context.cc hb-style.cc

# list of disabled warnings and the compilers for which it was specifically added.
# array-bounds -> GCC 12 on Alpine Linux
Expand Down
23 changes: 12 additions & 11 deletions make/test/JtregNativeHotspot.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -841,17 +841,18 @@ BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libVirtualMachine09agent00 := $(NSK_AOD_INC

# Platform specific setup
ifeq ($(call isTargetOs, linux), true)
BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libtest-rw := -z noexecstack
BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libtest-rwx := -z execstack
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libstepBreakPopReturn := -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libIndyRedefineClass := -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libredefineClasses := -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeinvoke := -ljvm -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exestack-gap := -ljvm -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exestack-tls := -ljvm
BUILD_TEST_exeinvoke_exeinvoke.c_OPTIMIZATION := NONE
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeFPRegs := -ldl
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libAsyncGetCallTraceTest := -ldl
BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libtest-rw := -z noexecstack
BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libtest-rwx := -z execstack
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libstepBreakPopReturn := -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libIndyRedefineClass := -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libredefineClasses := -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeinvoke := -ljvm -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exestack-gap := -ljvm -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exestack-tls := -ljvm
BUILD_TEST_exeinvoke_exeinvoke.c_OPTIMIZATION := NONE
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeFPRegs := -ldl
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libAsyncGetCallTraceTest := -ldl
BUILD_HOTSPOT_JTREG_LIBRARIES_LDFLAGS_libfast-math := -ffast-math
else
BUILD_HOTSPOT_JTREG_EXCLUDE += libtest-rw.c libtest-rwx.c \
exeinvoke.c exestack-gap.c exestack-tls.c libAsyncGetCallTraceTest.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ class DefaultPollerProvider extends PollerProvider {
DefaultPollerProvider() { }

@Override
Poller readPoller() throws IOException {
Poller readPoller(boolean subPoller) throws IOException {
return new PollsetPoller(true);
}

@Override
Poller writePoller() throws IOException {
Poller writePoller(boolean subPoller) throws IOException {
return new PollsetPoller(false);
}
}
6 changes: 3 additions & 3 deletions src/java.base/aix/classes/sun/nio/ch/PollsetPoller.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,12 @@ class PollsetPoller extends Poller {
MAX_EVENTS_TO_POLL = 512;
}

private final int event;
private final int setid;
private final long pollBuffer;

PollsetPoller(boolean read) throws IOException {
super(read);
this.event = (read) ? Net.POLLIN : Net.POLLOUT;
this.setid = Pollset.pollsetCreate();
this.pollBuffer = Pollset.allocatePollArray(MAX_EVENTS_TO_POLL);
}
Expand All @@ -58,8 +59,7 @@ int fdVal() {

@Override
void implRegister(int fd) throws IOException {
int ret = Pollset.pollsetCtl(setid, Pollset.PS_MOD, fd,
Pollset.PS_POLLPRI | (this.reading() ? Net.POLLIN : Net.POLLOUT));
int ret = Pollset.pollsetCtl(setid, Pollset.PS_MOD, fd, Pollset.PS_POLLPRI | event);
if (ret != 0) {
throw new IOException("Unable to register fd " + fd);
}
Expand Down
30 changes: 25 additions & 5 deletions src/java.base/linux/classes/sun/nio/ch/DefaultPollerProvider.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023, 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 All @@ -25,6 +25,7 @@
package sun.nio.ch;

import java.io.IOException;
import jdk.internal.vm.ContinuationSupport;

/**
* Default PollerProvider for Linux.
Expand All @@ -33,12 +34,31 @@ class DefaultPollerProvider extends PollerProvider {
DefaultPollerProvider() { }

@Override
Poller readPoller() throws IOException {
return new EPollPoller(true);
Poller.Mode defaultPollerMode() {
if (ContinuationSupport.isSupported()) {
return Poller.Mode.VTHREAD_POLLERS;
} else {
return Poller.Mode.SYSTEM_THREADS;
}
}

@Override
Poller writePoller() throws IOException {
return new EPollPoller(false);
int defaultReadPollers(Poller.Mode mode) {
int ncpus = Runtime.getRuntime().availableProcessors();
if (mode == Poller.Mode.VTHREAD_POLLERS) {
return Math.min(Integer.highestOneBit(ncpus), 32);
} else {
return Math.max(Integer.highestOneBit(ncpus / 4), 1);
}
}

@Override
Poller readPoller(boolean subPoller) throws IOException {
return new EPollPoller(subPoller, true);
}

@Override
Poller writePoller(boolean subPoller) throws IOException {
return new EPollPoller(subPoller, false);
}
}
10 changes: 5 additions & 5 deletions src/java.base/linux/classes/sun/nio/ch/EPollPoller.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@
*/

class EPollPoller extends Poller {
private static final int MAX_EVENTS_TO_POLL = 512;
private static final int ENOENT = 2;

private final int epfd;
private final int event;
private final int maxEvents;
private final long address;

EPollPoller(boolean read) throws IOException {
super(read);
EPollPoller(boolean subPoller, boolean read) throws IOException {
this.epfd = EPoll.create();
this.event = (read) ? EPOLLIN : EPOLLOUT;
this.address = EPoll.allocatePollArray(MAX_EVENTS_TO_POLL);
this.maxEvents = (subPoller) ? 64 : 512;
this.address = EPoll.allocatePollArray(maxEvents);
}

@Override
Expand All @@ -68,7 +68,7 @@ void implDeregister(int fdVal) {

@Override
int poll(int timeout) throws IOException {
int n = EPoll.wait(epfd, address, MAX_EVENTS_TO_POLL, timeout);
int n = EPoll.wait(epfd, address, maxEvents, timeout);
int i = 0;
while (i < n) {
long eventAddress = EPoll.getEvent(address, i);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2023, 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 @@ -33,12 +33,12 @@ class DefaultPollerProvider extends PollerProvider {
DefaultPollerProvider() { }

@Override
Poller readPoller() throws IOException {
return new KQueuePoller(true);
Poller readPoller(boolean subPoller) throws IOException {
return new KQueuePoller(subPoller, true);
}

@Override
Poller writePoller() throws IOException {
return new KQueuePoller(false);
Poller writePoller(boolean subPoller) throws IOException {
return new KQueuePoller(subPoller, false);
}
}
11 changes: 5 additions & 6 deletions src/java.base/macosx/classes/sun/nio/ch/KQueuePoller.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,16 @@
* Poller implementation based on the kqueue facility.
*/
class KQueuePoller extends Poller {
private static final int MAX_EVENTS_TO_POLL = 512;

private final int kqfd;
private final int filter;
private final int maxEvents;
private final long address;

KQueuePoller(boolean read) throws IOException {
super(read);
KQueuePoller(boolean subPoller, boolean read) throws IOException {
this.kqfd = KQueue.create();
this.filter = (read) ? EVFILT_READ : EVFILT_WRITE;
this.address = KQueue.allocatePollArray(MAX_EVENTS_TO_POLL);
this.maxEvents = (subPoller) ? 64 : 512;
this.address = KQueue.allocatePollArray(maxEvents);
}

@Override
Expand All @@ -63,7 +62,7 @@ void implDeregister(int fdVal) {

@Override
int poll(int timeout) throws IOException {
int n = KQueue.poll(kqfd, address, MAX_EVENTS_TO_POLL, timeout);
int n = KQueue.poll(kqfd, address, maxEvents, timeout);
int i = 0;
while (i < n) {
long keventAddress = KQueue.getEvent(address, i);
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/lang/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -2693,7 +2693,7 @@ public String getLoaderNameID(ClassLoader loader) {
}

public String getLoaderNameID(ClassLoader loader) {
return loader.nameAndId();
return loader != null ? loader.nameAndId() : "null";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public sealed interface AddressLayout extends ValueLayout permits ValueLayouts.O
*}
*
* @param layout the target layout.
* @return an address layout with same characteristics as this layout, but with the provided target layout.
* @return an address layout with the same characteristics as this layout, but with the provided target layout.
* @throws IllegalCallerException If the caller is in a module that does not have native access enabled
* @see #targetLayout()
*/
Expand All @@ -114,7 +114,7 @@ public sealed interface AddressLayout extends ValueLayout permits ValueLayouts.O
*
* @apiNote This can be useful to compare two address layouts that have different target layouts, but are otherwise equal.
*
* @return an address layout with same characteristics as this layout, but with no target layout.
* @return an address layout with the same characteristics as this layout, but with no target layout.
* @see #targetLayout()
*/
AddressLayout withoutTargetLayout();
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/lang/foreign/Arena.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static Arena ofShared() {
* The returned segment is associated with this {@linkplain #scope() arena scope}.
* The segment's {@link MemorySegment#address() address} is the starting address of the
* allocated off-heap region of memory backing the segment, and the address is
* aligned according the provided alignment constraint.
* aligned according to the provided alignment constraint.
*
* @implSpec
* Implementations of this method must return a native segment featuring the requested size,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public sealed interface FunctionDescriptor permits FunctionDescriptorImpl {
* Returns a function descriptor with the given argument layouts inserted at the given index, into the argument
* layout array of this function descriptor.
* @param index the index at which to insert the arguments
* @param addedLayouts the argument layouts to insert at given index.
* @param addedLayouts the argument layouts to insert at the given index.
* @return a new function descriptor, with the provided additional argument layouts.
* @throws IllegalArgumentException if one of the layouts in {@code addedLayouts} is a padding layout
* @throws IllegalArgumentException if {@code index < 0 || index > argumentLayouts().size()}
Expand Down Expand Up @@ -100,7 +100,7 @@ public sealed interface FunctionDescriptor permits FunctionDescriptorImpl {
* </ul>
*
* @apiNote A function descriptor cannot, by construction, contain any padding layouts. As such, it is not
* necessary to specify how padding layout should be mapped to carrier types.
* necessary to specify how padding layouts should be mapped to carrier types.
*
* @return the method type consisting of the carrier types of the layouts in this function descriptor.
*/
Expand All @@ -121,7 +121,7 @@ static FunctionDescriptor of(MemoryLayout resLayout, MemoryLayout... argLayouts)
}

/**
* Creates a function descriptor with the given argument layouts and no return layout. This is useful to model functions
* Creates a function descriptor with the given argument layouts and no return layout. This is useful for modeling functions
* that return no values.
* @param argLayouts the argument layouts.
* @throws IllegalArgumentException if one of the layouts in {@code argLayouts} is a padding layout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public sealed interface GroupLayout extends MemoryLayout permits StructLayout, U
/**
* {@return the member layouts of this group layout}
*
* @apiNote the order in which member layouts are returned is the same order in which member layouts have
* @apiNote the order in which member layouts are returned in the same order in which member layouts have
* been passed to one of the group layout factory methods (see {@link MemoryLayout#structLayout(MemoryLayout...)},
* {@link MemoryLayout#unionLayout(MemoryLayout...)}).
*/
Expand Down
Loading

0 comments on commit 6095031

Please sign in to comment.