Skip to content

Commit

Permalink
Merge latest openj9 into openj9-staging
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Feng <[email protected]>
  • Loading branch information
JasonFengJ9 committed Nov 18, 2024
2 parents 25439be + 542733f commit 635a784
Show file tree
Hide file tree
Showing 111 changed files with 5,520 additions and 671 deletions.
1 change: 1 addition & 0 deletions closed/OpenJ9.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ stage-j9 :
OPENJ9_VERSION_VARS := \
COMPANY_NAME \
COMPILER_VERSION_STRING \
DEBUG_LEVEL \
J9JDK_EXT_NAME \
J9JDK_EXT_VERSION \
OPENJ9_TAG \
Expand Down
5 changes: 3 additions & 2 deletions closed/openj9_version_info.h.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/*
* ===========================================================================
* (c) Copyright IBM Corp. 2017, 2022 All Rights Reserved
* (c) Copyright IBM Corp. 2017, 2024 All Rights Reserved
* ===========================================================================
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
Expand Down Expand Up @@ -39,4 +38,6 @@
#define J9JDK_EXT_NAME "@J9JDK_EXT_NAME@"
#define JAVA_VENDOR "@COMPANY_NAME@"

#define JDK_DEBUG_LEVEL "@DEBUG_LEVEL@"

#endif /* OPENJ9_VERSION_INFO_H */
37 changes: 36 additions & 1 deletion closed/test/jtreg-ext/requires/OpenJ9PropsExt.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
*/
package requires;

import java.nio.file.Path;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;

import jdk.test.lib.Platform;

public class OpenJ9PropsExt implements Callable<Map<String, String>> {

Expand All @@ -34,6 +38,8 @@ public Map<String, String> call() {
Map<String, String> map = new HashMap<>();
try {
map.put("container.support", "true");
map.put("jlink.packagedModules", Boolean.toString(packagedModules()));
map.put("systemd.support", Boolean.toString(systemdSupport()));
map.put("vm.bits", vmBits());
map.put("vm.cds", "false");
map.put("vm.cds.write.archived.java.heap", "false");
Expand Down Expand Up @@ -62,10 +68,39 @@ public Map<String, String> call() {
return map;
}

/**
* @return whether the current SDK includes packaged modules
*/
private static boolean packagedModules() {
try {
return Path.of(System.getProperty("java.home"), "jmods").toFile().exists();
} catch (Throwable t) {
return false;
}
}

/**
* @return whether systemd is available on the current platform
*/
private static boolean systemdSupport() {
if (Platform.isLinux()) {
try {
Process probe = new ProcessBuilder("which", "systemd-run").start();
probe.waitFor(10, TimeUnit.SECONDS);
if (probe.exitValue() == 0) {
return true;
}
} catch (Exception e) {
// assume not supported
}
}
return false;
}

/**
* @return VM bitness, the value of the "sun.arch.data.model" property.
*/
protected String vmBits() throws Exception {
private static String vmBits() throws Exception {
String dataModel = System.getProperty("sun.arch.data.model");
if (dataModel != null) {
return dataModel;
Expand Down
4 changes: 4 additions & 0 deletions make/Images.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ JLINK_DISABLE_WARNINGS := | ( $(GREP) -v -e "WARNING: Using incubator module" ||
JDK_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk
JRE_IMAGE_SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre

ifeq ($(JLINK_PRODUCE_LINKABLE_RUNTIME), true)
JLINK_JDK_EXTRA_OPTS += --generate-linkable-runtime
endif

$(eval $(call SetupExecute, jlink_jdk, \
WARN := Creating jdk image, \
DEPS := $(JDK_JMODS) $(BASE_RELEASE_FILE) \
Expand Down
40 changes: 33 additions & 7 deletions make/autoconf/jdk-options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -579,13 +579,42 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JMOD_OPTIONS],
################################################################################
#
# jlink options.
# We always keep packaged modules in JDK image.
#
AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
[
UTIL_ARG_ENABLE(NAME: keep-packaged-modules, DEFAULT: true,
################################################################################
#
# Configure option for building a JDK that is suitable for linking from the
# run-time image without JMODs.
#
# Determines whether or not a suitable run-time image is being produced from
# packaged modules. If set to 'true, changes the *default* of packaged
# modules to 'false'.
#
UTIL_ARG_ENABLE(NAME: linkable-runtime, DEFAULT: false,
RESULT: JLINK_PRODUCE_LINKABLE_RUNTIME,
DESC: [enable a JDK build suitable for linking from the run-time image],
CHECKING_MSG: [whether or not a JDK suitable for linking from the run-time image should be produced])
AC_SUBST(JLINK_PRODUCE_LINKABLE_RUNTIME)
if test "x$JLINK_PRODUCE_LINKABLE_RUNTIME" = xtrue; then
DEFAULT_PACKAGED_MODULES=false
else
DEFAULT_PACKAGED_MODULES=true
fi
################################################################################
#
# Configure option for packaged modules
#
# We keep packaged modules in the JDK image unless --enable-linkable-runtime is
# requested.
#
UTIL_ARG_ENABLE(NAME: keep-packaged-modules, DEFAULT: $DEFAULT_PACKAGED_MODULES,
RESULT: JLINK_KEEP_PACKAGED_MODULES,
DESC: [enable keeping of packaged modules in jdk image],
DEFAULT_DESC: [enabled by default unless --enable-linkable-runtime is set],
CHECKING_MSG: [if packaged modules are kept])
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
])
Expand Down Expand Up @@ -631,14 +660,11 @@ AC_DEFUN([JDKOPT_EXCLUDE_TRANSLATIONS],

################################################################################
#
# Optionally disable man pages
# Optionally disable man pages (deprecated)
#
AC_DEFUN([JDKOPT_ENABLE_DISABLE_MANPAGES],
[
UTIL_ARG_ENABLE(NAME: manpages, DEFAULT: true, RESULT: BUILD_MANPAGES,
DESC: [enable copying of static man pages],
CHECKING_MSG: [if static man pages should be copied])
AC_SUBST(BUILD_MANPAGES)
UTIL_DEPRECATED_ARG_ENABLE(manpages)
])

################################################################################
Expand Down
3 changes: 1 addition & 2 deletions make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,6 @@ ENABLE_GENERATE_CLASSLIST := @ENABLE_GENERATE_CLASSLIST@

EXCLUDE_TRANSLATIONS := @EXCLUDE_TRANSLATIONS@

BUILD_MANPAGES := @BUILD_MANPAGES@

BUILD_CDS_ARCHIVE := @BUILD_CDS_ARCHIVE@
BUILD_CDS_ARCHIVE_COH := @BUILD_CDS_ARCHIVE_COH@

Expand Down Expand Up @@ -719,6 +717,7 @@ NEW_JAVADOC = $(INTERIM_LANGTOOLS_ARGS) $(JAVADOC_MAIN_CLASS)

JMOD_COMPRESS := @JMOD_COMPRESS@
JLINK_KEEP_PACKAGED_MODULES := @JLINK_KEEP_PACKAGED_MODULES@
JLINK_PRODUCE_LINKABLE_RUNTIME := @JLINK_PRODUCE_LINKABLE_RUNTIME@

RCFLAGS := @RCFLAGS@

Expand Down
13 changes: 5 additions & 8 deletions make/common/modules/LauncherCommon.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,11 @@ ifeq ($(call isTargetOsType, unix)+$(MAKEFILE_PREFIX), true+Launcher)
endif
else
# No markdown man pages present
ifeq ($(BUILD_MANPAGES), true)
# BUILD_MANPAGES is a mis-nomer. It really means "copy the pre-generated man pages".
$(eval $(call SetupCopyFiles, COPY_MAN_PAGES, \
DEST := $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE)/man1, \
FILES := $(MAN_FILES_TROFF), \
))
$(eval $(call SetupCopyFiles, COPY_MAN_PAGES, \
DEST := $(SUPPORT_OUTPUTDIR)/modules_man/$(MODULE)/man1, \
FILES := $(MAN_FILES_TROFF), \
))

TARGETS += $(COPY_MAN_PAGES)
endif
TARGETS += $(COPY_MAN_PAGES)
endif
endif
1 change: 0 additions & 1 deletion make/conf/jib-profiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ var getJibProfilesCommon = function (input, data) {
default_make_targets: ["product-bundles", "test-bundles", "static-libs-bundles"],
configure_args: concat(
"--with-exclude-translations=es,fr,it,ko,pt_BR,sv,ca,tr,cs,sk,ja_JP_A,ja_JP_HA,ja_JP_HI,ja_JP_I,zh_TW,zh_HK",
"--disable-manpages",
"--disable-jvm-feature-shenandoahgc",
versionArgs(input, common))
};
Expand Down
6 changes: 3 additions & 3 deletions src/java.base/share/classes/java/lang/Double.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ public final class Double extends Number
public static final double NEGATIVE_INFINITY = -1.0 / 0.0;

/**
* A constant holding a Not-a-Number (NaN) value of type
* {@code double}. It is equivalent to the value returned by
* {@code Double.longBitsToDouble(0x7ff8000000000000L)}.
* A constant holding a Not-a-Number (NaN) value of type {@code double}.
* It is {@linkplain Double##equivalenceRelation equivalent} to the
* value returned by {@code Double.longBitsToDouble(0x7ff8000000000000L)}.
*/
public static final double NaN = 0.0d / 0.0;

Expand Down
6 changes: 3 additions & 3 deletions src/java.base/share/classes/java/lang/Float.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ public final class Float extends Number
public static final float NEGATIVE_INFINITY = -1.0f / 0.0f;

/**
* A constant holding a Not-a-Number (NaN) value of type
* {@code float}. It is equivalent to the value returned by
* {@code Float.intBitsToFloat(0x7fc00000)}.
* A constant holding a Not-a-Number (NaN) value of type {@code float}.
* It is {@linkplain Double##equivalenceRelation equivalent}
* to the value returned by{@code Float.intBitsToFloat(0x7fc00000)}.
*/
public static final float NaN = 0.0f / 0.0f;

Expand Down
44 changes: 8 additions & 36 deletions src/java.base/share/classes/java/lang/StringConcatHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,35 +236,21 @@ static long prepend(long indexCoder, byte[] buf, boolean value, String prefix) {
if (indexCoder < UTF16) {
if (value) {
index -= 4;
buf[index] = 't';
buf[index + 1] = 'r';
buf[index + 2] = 'u';
buf[index + 3] = 'e';
StringLatin1.putCharsAt(buf, index, 't', 'r', 'u', 'e');
} else {
index -= 5;
buf[index] = 'f';
buf[index + 1] = 'a';
buf[index + 2] = 'l';
buf[index + 3] = 's';
buf[index + 4] = 'e';
StringLatin1.putCharsAt(buf, index, 'f', 'a', 'l', 's', 'e');
}
index -= prefix.length();
prefix.getBytes(buf, index, String.LATIN1);
return index;
} else {
if (value) {
index -= 4;
StringUTF16.putChar(buf, index, 't');
StringUTF16.putChar(buf, index + 1, 'r');
StringUTF16.putChar(buf, index + 2, 'u');
StringUTF16.putChar(buf, index + 3, 'e');
StringUTF16.putCharsAt(buf, index, 't', 'r', 'u', 'e');
} else {
index -= 5;
StringUTF16.putChar(buf, index, 'f');
StringUTF16.putChar(buf, index + 1, 'a');
StringUTF16.putChar(buf, index + 2, 'l');
StringUTF16.putChar(buf, index + 3, 's');
StringUTF16.putChar(buf, index + 4, 'e');
StringUTF16.putCharsAt(buf, index, 'f', 'a', 'l', 's', 'e');
}
index -= prefix.length();
prefix.getBytes(buf, index, String.UTF16);
Expand Down Expand Up @@ -638,34 +624,20 @@ static int prepend(int index, byte coder, byte[] buf, boolean value, String pref
if (coder == String.LATIN1) {
if (value) {
index -= 4;
buf[index] = 't';
buf[index + 1] = 'r';
buf[index + 2] = 'u';
buf[index + 3] = 'e';
StringLatin1.putCharsAt(buf, index, 't', 'r', 'u', 'e');
} else {
index -= 5;
buf[index] = 'f';
buf[index + 1] = 'a';
buf[index + 2] = 'l';
buf[index + 3] = 's';
buf[index + 4] = 'e';
StringLatin1.putCharsAt(buf, index, 'f', 'a', 'l', 's', 'e');
}
index -= prefix.length();
prefix.getBytes(buf, index, String.LATIN1);
} else {
if (value) {
index -= 4;
StringUTF16.putChar(buf, index, 't');
StringUTF16.putChar(buf, index + 1, 'r');
StringUTF16.putChar(buf, index + 2, 'u');
StringUTF16.putChar(buf, index + 3, 'e');
StringUTF16.putCharsAt(buf, index, 't', 'r', 'u', 'e');
} else {
index -= 5;
StringUTF16.putChar(buf, index, 'f');
StringUTF16.putChar(buf, index + 1, 'a');
StringUTF16.putChar(buf, index + 2, 'l');
StringUTF16.putChar(buf, index + 3, 's');
StringUTF16.putChar(buf, index + 4, 'e');
StringUTF16.putCharsAt(buf, index, 'f', 'a', 'l', 's', 'e');
}
index -= prefix.length();
prefix.getBytes(buf, index, String.UTF16);
Expand Down
6 changes: 2 additions & 4 deletions src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -3149,10 +3149,8 @@ private Thread(String vmName, Object vmThreadGroup, int vmPriority, boolean vmIs
}

private boolean isDead() {
// Has already started, is not alive anymore, and has been removed from the ThreadGroup
synchronized (interruptLock) {
return (started && (eetop == NO_REF));
}
/* Has already started and is not alive anymore. */
return started && (eetop == NO_REF);
}

Thread(Runnable runnable, String threadName, boolean isSystemThreadGroup, boolean inheritThreadLocals, boolean isDaemon, ClassLoader contextClassLoader) {
Expand Down
13 changes: 4 additions & 9 deletions src/java.base/share/classes/java/util/stream/Gatherer.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
package java.util.stream;

import jdk.internal.javac.PreviewFeature;
import jdk.internal.vm.annotation.ForceInline;

import java.util.*;
Expand Down Expand Up @@ -195,9 +194,8 @@
* @param <A> the potentially mutable state type of the gatherer operation
* (often hidden as an implementation detail)
* @param <R> the type of output elements from the gatherer operation
* @since 22
* @since 24
*/
@PreviewFeature(feature = PreviewFeature.Feature.STREAM_GATHERERS)
public interface Gatherer<T, A, R> {
/**
* A function that produces an instance of the intermediate state used for
Expand Down Expand Up @@ -481,10 +479,9 @@ static <T, A, R> Gatherer<T, A, R> of(
* A Downstream object is the next stage in a pipeline of operations,
* to which elements can be sent.
* @param <T> the type of elements this downstream accepts
* @since 22
* @since 24
*/
@FunctionalInterface
@PreviewFeature(feature = PreviewFeature.Feature.STREAM_GATHERERS)
interface Downstream<T> {

/**
Expand Down Expand Up @@ -524,10 +521,9 @@ interface Downstream<T> {
* @param <A> the type of state used by this integrator
* @param <T> the type of elements this integrator consumes
* @param <R> the type of results this integrator can produce
* @since 22
* @since 24
*/
@FunctionalInterface
@PreviewFeature(feature = PreviewFeature.Feature.STREAM_GATHERERS)
interface Integrator<A, T, R> {
/**
* Performs an action given: the current state, the next element, and
Expand Down Expand Up @@ -584,10 +580,9 @@ static <A, T, R> Greedy<A, T, R> ofGreedy(Greedy<A, T, R> greedy) {
* @param <A> the type of state used by this integrator
* @param <T> the type of elements this greedy integrator receives
* @param <R> the type of results this greedy integrator can produce
* @since 22
* @since 24
*/
@FunctionalInterface
@PreviewFeature(feature = PreviewFeature.Feature.STREAM_GATHERERS)
interface Greedy<A, T, R> extends Integrator<A, T, R> { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* The performance-critical code below contains some more complicated encodings:
* therefore, make sure to run benchmarks to verify changes to prevent regressions.
*
* @since 22
* @since 24
*/
final class GathererOp<T, A, R> extends ReferencePipeline<T, R> {
@SuppressWarnings("unchecked")
Expand Down
Loading

0 comments on commit 635a784

Please sign in to comment.