Skip to content

Commit

Permalink
Merge branch 'upstream-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Datadog Syncup Service committed Sep 14, 2024
2 parents e1908db + c91fa27 commit 3396942
Show file tree
Hide file tree
Showing 36 changed files with 619 additions and 153 deletions.
80 changes: 46 additions & 34 deletions make/devkit/createAutoconfBundle.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -e
#
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2024, 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,50 +25,70 @@
#

# Create a bundle in the current directory, containing what's needed to run
# the 'autoconf' program by the OpenJDK build.
# the 'autoconf' program by the OpenJDK build. To override TARGET_PLATFORM
# just set the variable before running this script.

# Autoconf depends on m4, so download and build that first.
AUTOCONF_VERSION=2.69
M4_VERSION=1.4.18

PACKAGE_VERSION=1.0.1
TARGET_PLATFORM=linux_x86
case `uname -s` in
Darwin)
os=macosx
;;
Linux)
os=linux
;;
CYGWIN*)
os=cygwin
;;
esac
case `uname -m` in
arm64|aarch64)
arch=aarch64
;;
amd64|x86_64|x64)
arch=x64
;;
esac
TARGET_PLATFORM=${TARGET_PLATFORM:="${os}_${arch}"}

MODULE_NAME=autoconf-$TARGET_PLATFORM-$AUTOCONF_VERSION+$PACKAGE_VERSION
BUNDLE_NAME=$MODULE_NAME.tar.gz

TMPDIR=`mktemp -d -t autoconfbundle-XXXX`
trap "rm -rf \"$TMPDIR\"" EXIT
SCRIPT_DIR="$(cd "$(dirname $0)" > /dev/null && pwd)"
OUTPUT_ROOT="${SCRIPT_DIR}/../../build/autoconf"

ORIG_DIR=`pwd`
cd $TMPDIR
OUTPUT_DIR=$TMPDIR/$MODULE_NAME
mkdir -p $OUTPUT_DIR/usr
cd $OUTPUT_ROOT
IMAGE_DIR=$OUTPUT_ROOT/$MODULE_NAME
mkdir -p $IMAGE_DIR/usr

# Download and build m4

if test "x$TARGET_PLATFORM" = xcygwin_x64; then
# On cygwin 64-bit, just copy the cygwin .exe file
mkdir -p $OUTPUT_DIR/usr/bin
cp /usr/bin/m4 $OUTPUT_DIR/usr/bin
mkdir -p $IMAGE_DIR/usr/bin
cp /usr/bin/m4 $IMAGE_DIR/usr/bin
elif test "x$TARGET_PLATFORM" = xcygwin_x86; then
# On cygwin 32-bit, just copy the cygwin .exe file
mkdir -p $OUTPUT_DIR/usr/bin
cp /usr/bin/m4 $OUTPUT_DIR/usr/bin
mkdir -p $IMAGE_DIR/usr/bin
cp /usr/bin/m4 $IMAGE_DIR/usr/bin
elif test "x$TARGET_PLATFORM" = xlinux_x64; then
M4_VERSION=1.4.13-5
wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/x86_64/getPackage/m4-$M4_VERSION.el6.x86_64.rpm
cd $OUTPUT_DIR
rpm2cpio ../m4-$M4_VERSION.el6.x86_64.rpm | cpio -d -i
cd $IMAGE_DIR
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.x86_64.rpm | cpio -d -i
elif test "x$TARGET_PLATFORM" = xlinux_x86; then
M4_VERSION=1.4.13-5
wget http://yum.oracle.com/repo/OracleLinux/OL6/latest/i386/getPackage/m4-$M4_VERSION.el6.i686.rpm
cd $OUTPUT_DIR
rpm2cpio ../m4-$M4_VERSION.el6.i686.rpm | cpio -d -i
cd $IMAGE_DIR
rpm2cpio $OUTPUT_ROOT/m4-$M4_VERSION.el6.i686.rpm | cpio -d -i
else
wget https://ftp.gnu.org/gnu/m4/m4-$M4_VERSION.tar.gz
tar xzf m4-$M4_VERSION.tar.gz
cd m4-$M4_VERSION
./configure --prefix=$OUTPUT_DIR/usr
./configure --prefix=$IMAGE_DIR/usr CFLAGS="-w -Wno-everything"
make
make install
cd ..
Expand All @@ -79,15 +99,14 @@ fi
wget https://ftp.gnu.org/gnu/autoconf/autoconf-$AUTOCONF_VERSION.tar.gz
tar xzf autoconf-$AUTOCONF_VERSION.tar.gz
cd autoconf-$AUTOCONF_VERSION
./configure --prefix=$OUTPUT_DIR/usr M4=$OUTPUT_DIR/usr/bin/m4
./configure --prefix=$IMAGE_DIR/usr M4=$IMAGE_DIR/usr/bin/m4
make
make install
cd ..

perl -pi -e "s!$OUTPUT_DIR/!./!" $OUTPUT_DIR/usr/bin/auto* $OUTPUT_DIR/usr/share/autoconf/autom4te.cfg
cp $OUTPUT_DIR/usr/share/autoconf/autom4te.cfg $OUTPUT_DIR/autom4te.cfg
perl -pi -e "s!$IMAGE_DIR/!./!" $IMAGE_DIR/usr/bin/auto* $IMAGE_DIR/usr/share/autoconf/autom4te.cfg

cat > $OUTPUT_DIR/autoconf << EOF
cat > $IMAGE_DIR/autoconf << EOF
#!/bin/bash
# Get an absolute path to this script
this_script_dir=\`dirname \$0\`
Expand All @@ -100,17 +119,10 @@ export AUTOHEADER="\$this_script_dir/usr/bin/autoheader"
export AC_MACRODIR="\$this_script_dir/usr/share/autoconf"
export autom4te_perllibdir="\$this_script_dir/usr/share/autoconf"
autom4te_cfg=\$this_script_dir/usr/share/autoconf/autom4te.cfg
cp \$this_script_dir/autom4te.cfg \$autom4te_cfg
echo 'begin-language: "M4sugar"' >> \$autom4te_cfg
echo "args: --prepend-include '"\$this_script_dir/usr/share/autoconf"'" >> \$autom4te_cfg
echo 'end-language: "M4sugar"' >> \$autom4te_cfg
PREPEND_INCLUDE="--prepend-include \$this_script_dir/usr/share/autoconf"
exec \$this_script_dir/usr/bin/autoconf "\$@"
exec \$this_script_dir/usr/bin/autoconf \$PREPEND_INCLUDE "\$@"
EOF
chmod +x $OUTPUT_DIR/autoconf
cd $OUTPUT_DIR
tar -cvzf ../$BUNDLE_NAME *
cd ..
cp $BUNDLE_NAME "$ORIG_DIR"
chmod +x $IMAGE_DIR/autoconf
cd $IMAGE_DIR
tar -cvzf $OUTPUT_ROOT/$BUNDLE_NAME *
3 changes: 2 additions & 1 deletion make/test/JtregNativeHotspot.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exedaemonDestroy := java.base:libjvm

ifeq ($(call isTargetOs, windows), true)
BUILD_HOTSPOT_JTREG_EXECUTABLES_CFLAGS_exeFPRegs := -MT
BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libMonitorWithDeadObjectTest.c libTestPsig.c exeGetCreatedJavaVMs.c
BUILD_HOTSPOT_JTREG_EXCLUDE += exesigtest.c libterminatedThread.c libTestJNI.c libCompleteExit.c libMonitorWithDeadObjectTest.c libTestPsig.c exeGetCreatedJavaVMs.c libTestUnloadedClass.cpp
BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libnativeStack := java.base:libjvm
BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libVThreadEventTest := java.base:libjvm
else
Expand Down Expand Up @@ -1526,6 +1526,7 @@ else
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libCompleteExit += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libMonitorWithDeadObjectTest += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libnativeStack += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_LIBS_libTestUnloadedClass += -lpthread
BUILD_HOTSPOT_JTREG_LIBRARIES_JDK_LIBS_libVThreadEventTest := java.base:libjvm
BUILD_HOTSPOT_JTREG_EXECUTABLES_LIBS_exeGetCreatedJavaVMs := -lpthread
BUILD_HOTSPOT_JTREG_EXECUTABLES_JDK_LIBS_exeGetCreatedJavaVMs := java.base:libjvm
Expand Down
9 changes: 9 additions & 0 deletions src/hotspot/share/classfile/classLoaderExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,15 @@ void ClassLoaderExt::process_jar_manifest(JavaThread* current, ClassPathEntry* e
char sep = os::file_separator()[0];
const char* dir_name = entry->name();
const char* dir_tail = strrchr(dir_name, sep);
#ifdef _WINDOWS
// On Windows, we also support forward slash as the file separator when locating entries in the classpath entry.
const char* dir_tail2 = strrchr(dir_name, '/');
if (dir_tail == nullptr) {
dir_tail = dir_tail2;
} else if (dir_tail2 != nullptr && dir_tail2 > dir_tail) {
dir_tail = dir_tail2;
}
#endif
int dir_len;
if (dir_tail == nullptr) {
dir_len = 0;
Expand Down
8 changes: 6 additions & 2 deletions src/hotspot/share/prims/jvmtiEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3132,7 +3132,9 @@ JvmtiEnv::GetFieldName(fieldDescriptor* fdesc_ptr, char** name_ptr, char** signa
// declaring_class_ptr - pre-checked for null
jvmtiError
JvmtiEnv::GetFieldDeclaringClass(fieldDescriptor* fdesc_ptr, jclass* declaring_class_ptr) {

// As for the GetFieldDeclaringClass method, the XSL generated C++ code that calls it has
// a jclass of the relevant class or a subclass of it, which is fine in terms of ensuring
// the holder is kept alive.
*declaring_class_ptr = get_jni_class_non_null(fdesc_ptr->field_holder());
return JVMTI_ERROR_NONE;
} /* end GetFieldDeclaringClass */
Expand Down Expand Up @@ -3210,7 +3212,9 @@ JvmtiEnv::GetMethodName(Method* method, char** name_ptr, char** signature_ptr, c
jvmtiError
JvmtiEnv::GetMethodDeclaringClass(Method* method, jclass* declaring_class_ptr) {
NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
(*declaring_class_ptr) = get_jni_class_non_null(method->method_holder());
Klass* k = method->method_holder();
Handle holder(Thread::current(), k->klass_holder()); // keep the klass alive
(*declaring_class_ptr) = get_jni_class_non_null(k);
return JVMTI_ERROR_NONE;
} /* end GetMethodDeclaringClass */

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/prims/jvmtiEnvBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ JvmtiEnvBase::jvf_for_thread_and_depth(JavaThread* java_thread, jint depth) {
jclass
JvmtiEnvBase::get_jni_class_non_null(Klass* k) {
assert(k != nullptr, "k != null");
assert(k->is_loader_alive(), "Must be alive");
Thread *thread = Thread::current();
return (jclass)jni_reference(Handle(thread, k->java_mirror()));
}
Expand Down
5 changes: 2 additions & 3 deletions src/java.base/share/classes/java/io/ObjectInputFilter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024, 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 @@ -1218,8 +1218,7 @@ private static boolean matchesPackage(Class<?> c, String pkg) {
}

/**
* Returns the pattern used to create this filter.
* @return the pattern used to create this filter
* {@return the pattern used to create this filter}
*/
@Override
public String toString() {
Expand Down
3 changes: 1 addition & 2 deletions src/java.base/share/classes/java/io/ObjectInputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -3859,8 +3859,7 @@ private int readUTFChar(StringBuilder sbuf, long utflen)
}

/**
* Returns the number of bytes read from the input stream.
* @return the number of bytes read from the input stream
* {@return the number of bytes read from the input stream}
*/
long getBytesRead() {
return in.getBytesRead();
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, 2024, 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 @@ -45,8 +45,7 @@
@Target(ElementType.ANNOTATION_TYPE)
public @interface Retention {
/**
* Returns the retention policy.
* @return the retention policy
* {@return the retention policy}
*/
RetentionPolicy value();
}
Original file line number Diff line number Diff line change
Expand Up @@ -1285,6 +1285,14 @@ MemorySegment reinterpret(long newSize,
* sequences with this charset's default replacement string. The {@link
* java.nio.charset.CharsetDecoder} class should be used when more control
* over the decoding process is required.
* <p>
* Getting a string from a segment with a known byte offset and
* known byte length can be done like so:
* {@snippet lang=java :
* byte[] bytes = new byte[length];
* MemorySegment.copy(segment, JAVA_BYTE, offset, bytes, 0, length);
* return new String(bytes, charset);
* }
*
* @param offset offset in bytes (relative to this segment address) at which this
* access operation will occur
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, 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 @@ -56,16 +56,14 @@ public MalformedInputException(int inputLength) {
}

/**
* Returns the length of the input.
* @return the length of the input
* {@return the length of the input}
*/
public int getInputLength() {
return inputLength;
}

/**
* Returns the message.
* @return the message
* {@return the message}
*/
public String getMessage() {
return "Input length = " + inputLength;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2024, 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 @@ -56,16 +56,14 @@ public UnmappableCharacterException(int inputLength) {
}

/**
* Returns the length of the input.
* @return the length of the input
* {@return the length of the input}
*/
public int getInputLength() {
return inputLength;
}

/**
* Returns the message.
* @return the message
* {@return the message}
*/
public String getMessage() {
return "Input length = " + inputLength;
Expand Down
5 changes: 2 additions & 3 deletions src/java.base/share/classes/java/time/format/TextStyle.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2024, 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 @@ -137,8 +137,7 @@ public boolean isStandalone() {
}

/**
* Returns the stand-alone style with the same size.
* @return the stand-alone style with the same size
* {@return the stand-alone style with the same size}
*/
public TextStyle asStandalone() {
return TextStyle.values()[ordinal() | 1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* <li>Series of generated values pass the DieHarder suite testing
* independence and uniformity properties of random number generators.
* (Most recently validated with <a
* href="http://www.phy.duke.edu/~rgb/General/dieharder.php"> version
* href="https://webhome.phy.duke.edu/~rgb/General/dieharder.php"> version
* 3.31.1</a>.) These tests validate only the methods for certain
* types and ranges, but similar properties are expected to hold, at
* least approximately, for others as well. The <em>period</em>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,7 @@ public Spliterator<E> spliterator() {
}

/**
* Returns a zero-length array.
* @return a zero-length array
* {@return a zero-length array}
*/
public Object[] toArray() {
return new Object[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ public final boolean getAndSet(boolean newValue) {
}

/**
* Returns the String representation of the current value.
* @return the String representation of the current value
* {@return the String representation of the current value}
*/
public String toString() {
return Boolean.toString(get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ public final int accumulateAndGet(int x,
}

/**
* Returns the String representation of the current value.
* @return the String representation of the current value
* {@return the String representation of the current value}
*/
public String toString() {
return Integer.toString(get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,7 @@ public final int accumulateAndGet(int i, int x,
}

/**
* Returns the String representation of the current values of array.
* @return the String representation of the current values of array
* {@return the String representation of the current values of array}
*/
public String toString() {
int iMax = array.length - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ public final long accumulateAndGet(long x,
}

/**
* Returns the String representation of the current value.
* @return the String representation of the current value
* {@return the String representation of the current value}
*/
public String toString() {
return Long.toString(get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,7 @@ public final long accumulateAndGet(int i, long x,
}

/**
* Returns the String representation of the current values of array.
* @return the String representation of the current values of array
* {@return the String representation of the current values of array}
*/
public String toString() {
int iMax = array.length - 1;
Expand Down
Loading

0 comments on commit 3396942

Please sign in to comment.