Skip to content

Commit

Permalink
Merge branch 'openjdk:master' into backport-3f1174aa4709aabcfde8b40de…
Browse files Browse the repository at this point in the history
…ec88b8ed466cc06
  • Loading branch information
wkia committed Jul 14, 2023
2 parents 4d506b1 + 148af11 commit 736f89d
Show file tree
Hide file tree
Showing 65 changed files with 3,123 additions and 215 deletions.
3 changes: 2 additions & 1 deletion .github/actions/get-msys2/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ runs:
using: composite
steps:
- name: 'Install MSYS2'
uses: msys2/setup-msys2@v2
# use a specific release of msys2/setup-msys2 to prevent jtreg build failures on newer release
uses: msys2/setup-msys2@7efe20baefed56359985e327d329042cde2434ff
with:
install: 'autoconf tar unzip zip make'
path-type: minimal
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/build-cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,34 @@ jobs:
- arm
- s390x
- ppc64le
- riscv64
include:
- target-cpu: aarch64
debian-arch: arm64
gnu-arch: aarch64
debian-arch: arm64
debian-repository: https://httpredir.debian.org/debian/
debian-version: buster
- target-cpu: arm
debian-arch: armhf
gnu-arch: arm
debian-arch: armhf
debian-repository: https://httpredir.debian.org/debian/
debian-version: buster
gnu-abi: eabihf
- target-cpu: s390x
debian-arch: s390x
gnu-arch: s390x
debian-arch: s390x
debian-repository: https://httpredir.debian.org/debian/
debian-version: buster
- target-cpu: ppc64le
debian-arch: ppc64el
gnu-arch: powerpc64le
debian-arch: ppc64el
debian-repository: https://httpredir.debian.org/debian/
debian-version: buster
- target-cpu: riscv64
gnu-arch: riscv64
debian-arch: riscv64
debian-repository: https://deb.debian.org/debian-ports
debian-version: sid

steps:
- name: 'Checkout the JDK source'
Expand Down Expand Up @@ -118,9 +132,9 @@ jobs:
--verbose
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype6-dev,libpng-dev
--resolve-deps
buster
${{ matrix.debian-version }}
sysroot
https://httpredir.debian.org/debian/
${{ matrix.debian-repository }}
if: steps.get-cached-sysroot.outputs.cache-hit != 'true'

- name: 'Prepare sysroot'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ jobs:
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-x64
xcode-toolset-version: '11.7'
xcode-toolset-version: '12.5.1'
if: needs.select.outputs.macos-x64 == 'true'

build-macos-aarch64:
Expand All @@ -211,7 +211,7 @@ jobs:
uses: ./.github/workflows/build-macos.yml
with:
platform: macos-aarch64
xcode-toolset-version: '12.4'
xcode-toolset-version: '12.5.1'
extra-conf-options: '--openjdk-target=aarch64-apple-darwin'
if: needs.select.outputs.macos-aarch64 == 'true'

Expand Down
20 changes: 20 additions & 0 deletions make/autoconf/toolchain.m4
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ TOOLCHAIN_MINIMUM_VERSION_xlc=""
# Minimum supported linker versions, empty means unspecified
TOOLCHAIN_MINIMUM_LD_VERSION_gcc="2.18"

# Minimum supported version
JTREG_MINIMUM_VERSION=6.1

# Prepare the system so that TOOLCHAIN_CHECK_COMPILER_VERSION can be called.
# Must have CC_VERSION_NUMBER and CXX_VERSION_NUMBER.
# $1 - optional variable prefix for compiler and version variables (BUILD_)
Expand Down Expand Up @@ -1082,6 +1085,23 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG],
UTIL_FIXUP_PATH(JT_HOME)
AC_SUBST(JT_HOME)
# Verify jtreg version
if test "x$JT_HOME" != x; then
AC_MSG_CHECKING([jtreg version number])
# jtreg -version looks like this: "jtreg 6.1+1-19"
# Extract actual version part ("6.1" in this case)
jtreg_version_full=`$JAVA -jar $JT_HOME/lib/jtreg.jar -version | $HEAD -n 1 | $CUT -d ' ' -f 2`
jtreg_version=${jtreg_version_full/%+*}
AC_MSG_RESULT([$jtreg_version])
# This is a simplified version of TOOLCHAIN_CHECK_COMPILER_VERSION
comparable_actual_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$jtreg_version"`
comparable_minimum_version=`$AWK -F. '{ printf("%05d%05d%05d%05d\n", [$]1, [$]2, [$]3, [$]4) }' <<< "$JTREG_MINIMUM_VERSION"`
if test $comparable_actual_version -lt $comparable_minimum_version ; then
AC_MSG_ERROR([jtreg version is too old, at least version $JTREG_MINIMUM_VERSION is required])
fi
fi
])

# Setup the JIB dependency resolver
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,6 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm

gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup);

__ flush();
return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry, c2i_no_clinit_check_entry);
}

Expand Down
14 changes: 7 additions & 7 deletions src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3265,19 +3265,19 @@ class StubGenerator: public StubCodeGenerator {
__ addw(rscratch4, r1, rscratch2); \
__ ldrw(rscratch1, Address(buf, k*4)); \
__ eorw(rscratch3, rscratch3, r4); \
__ addw(rscratch3, rscratch3, rscratch1); \
__ addw(rscratch4, rscratch4, rscratch1); \
__ addw(rscratch3, rscratch3, rscratch4); \
__ rorw(rscratch2, rscratch3, 32 - s); \
__ addw(r1, rscratch2, r2);

#define GG(r1, r2, r3, r4, k, s, t) \
__ eorw(rscratch2, r2, r3); \
__ andw(rscratch3, r2, r4); \
__ bicw(rscratch4, r3, r4); \
__ ldrw(rscratch1, Address(buf, k*4)); \
__ andw(rscratch3, rscratch2, r4); \
__ movw(rscratch2, t); \
__ eorw(rscratch3, rscratch3, r3); \
__ orrw(rscratch3, rscratch3, rscratch4); \
__ addw(rscratch4, r1, rscratch2); \
__ addw(rscratch3, rscratch3, rscratch1); \
__ addw(rscratch4, rscratch4, rscratch1); \
__ addw(rscratch3, rscratch3, rscratch4); \
__ rorw(rscratch2, rscratch3, 32 - s); \
__ addw(r1, rscratch2, r2);
Expand All @@ -3288,7 +3288,7 @@ class StubGenerator: public StubCodeGenerator {
__ addw(rscratch4, r1, rscratch2); \
__ ldrw(rscratch1, Address(buf, k*4)); \
__ eorw(rscratch3, rscratch3, r2); \
__ addw(rscratch3, rscratch3, rscratch1); \
__ addw(rscratch4, rscratch4, rscratch1); \
__ addw(rscratch3, rscratch3, rscratch4); \
__ rorw(rscratch2, rscratch3, 32 - s); \
__ addw(r1, rscratch2, r2);
Expand All @@ -3299,7 +3299,7 @@ class StubGenerator: public StubCodeGenerator {
__ addw(rscratch4, r1, rscratch3); \
__ ldrw(rscratch1, Address(buf, k*4)); \
__ eorw(rscratch3, rscratch2, r3); \
__ addw(rscratch3, rscratch3, rscratch1); \
__ addw(rscratch4, rscratch4, rscratch1); \
__ addw(rscratch3, rscratch3, rscratch4); \
__ rorw(rscratch2, rscratch3, 32 - s); \
__ addw(r1, rscratch2, r2);
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/cpu/arm/sharedRuntime_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,6 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
address c2i_entry = __ pc();
gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup);

__ flush();
return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
}

Expand Down
1 change: 0 additions & 1 deletion src/hotspot/cpu/riscv/sharedRuntime_riscv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm

gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup);

__ flush();
return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry, c2i_no_clinit_check_entry);
}

Expand Down
21 changes: 11 additions & 10 deletions src/hotspot/cpu/x86/macroAssembler_x86_md5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,16 @@
// int com.sun.security.provider.MD5.implCompress0(byte[] b, int ofs)
void MacroAssembler::fast_md5(Register buf, Address state, Address ofs, Address limit, bool multi_block) {

Label start, done_hash, loop0;
Label done_hash, loop0;

bind(start);

bind(loop0);

// Save hash values for addition after rounds
movptr(rdi, state);
movl(rax, Address(rdi, 0));
movl(rbx, Address(rdi, 4));
movl(rcx, Address(rdi, 8));
movl(rdx, Address(rdi, 12));

bind(loop0);

#define FF(r1, r2, r3, r4, k, s, t) \
addl(r1, t); \
movl(rsi, r3); \
Expand Down Expand Up @@ -189,10 +186,14 @@ void MacroAssembler::fast_md5(Register buf, Address state, Address ofs, Address

// write hash values back in the correct order
movptr(rdi, state);
addl(Address(rdi, 0), rax);
addl(Address(rdi, 4), rbx);
addl(Address(rdi, 8), rcx);
addl(Address(rdi, 12), rdx);
addl(rax, Address(rdi, 0));
movl(Address(rdi, 0), rax);
addl(rbx, Address(rdi, 4));
movl(Address(rdi, 4), rbx);
addl(rcx, Address(rdi, 8));
movl(Address(rdi, 8), rcx);
addl(rdx, Address(rdi, 12));
movl(Address(rdi, 12), rdx);

if (multi_block) {
// increment data pointer and loop if more to process
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,6 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm

gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup);

__ flush();
return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
}

Expand Down
1 change: 0 additions & 1 deletion src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,6 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm

gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup);

__ flush();
return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry, c2i_no_clinit_check_entry);
}

Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/c1/c1_Compilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,6 @@ void Compilation::emit_code_epilog(LIR_Assembler* assembler) {
// Emit the handler to remove the activation from the stack and
// dispatch to the caller.
offsets()->set_value(CodeOffsets::UnwindHandler, assembler->emit_unwind_handler());

// done
masm()->flush();
}


Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/ci/ciReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,7 @@ class CompileReplay : public StackObj {
value = oopFactory::new_longArray(length, CHECK);
} else if (field_signature[0] == JVM_SIGNATURE_ARRAY &&
field_signature[1] == JVM_SIGNATURE_CLASS) {
parse_klass(CHECK); // eat up the array class name
Klass* kelem = resolve_klass(field_signature + 1, CHECK);
value = oopFactory::new_objArray(kelem, length, CHECK);
} else {
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/code/codeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,9 +609,6 @@ void CodeCache::commit(CodeBlob* cb) {
if (cb->is_adapter_blob()) {
heap->set_adapter_count(heap->adapter_count() + 1);
}

// flush the hardware I-cache
ICache::invalidate_range(cb->content_begin(), cb->content_size());
}

bool CodeCache::contains(void *p) {
Expand Down
8 changes: 1 addition & 7 deletions src/hotspot/share/compiler/compilerDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,13 +394,7 @@ void CompilerConfig::set_compilation_policy_flags() {
if (CompilerConfig::is_tiered() && CompilerConfig::is_c2_enabled()) {
#ifdef COMPILER2
// Some inlining tuning
#ifdef X86
if (FLAG_IS_DEFAULT(InlineSmallCode)) {
FLAG_SET_DEFAULT(InlineSmallCode, 2500);
}
#endif

#if defined AARCH64
#if defined(X86) || defined(AARCH64) || defined(RISCV64)
if (FLAG_IS_DEFAULT(InlineSmallCode)) {
FLAG_SET_DEFAULT(InlineSmallCode, 2500);
}
Expand Down
7 changes: 4 additions & 3 deletions src/hotspot/share/logging/logAsyncWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "logging/logAsyncWriter.hpp"
#include "logging/logConfiguration.hpp"
#include "logging/logFileOutput.hpp"
#include "logging/logFileStreamOutput.hpp"
#include "logging/logHandle.hpp"
#include "runtime/atomic.hpp"
#include "runtime/os.inline.hpp"
Expand Down Expand Up @@ -56,7 +57,7 @@ void AsyncLogWriter::enqueue_locked(const AsyncLogMessage& msg) {
_lock.notify();
}

void AsyncLogWriter::enqueue(LogFileOutput& output, const LogDecorations& decorations, const char* msg) {
void AsyncLogWriter::enqueue(LogFileStreamOutput& output, const LogDecorations& decorations, const char* msg) {
AsyncLogMessage m(&output, decorations, os::strdup(msg));

{ // critical area
Expand All @@ -67,7 +68,7 @@ void AsyncLogWriter::enqueue(LogFileOutput& output, const LogDecorations& decora

// LogMessageBuffer consists of a multiple-part/multiple-line messsage.
// The lock here guarantees its integrity.
void AsyncLogWriter::enqueue(LogFileOutput& output, LogMessageBuffer::Iterator msg_iterator) {
void AsyncLogWriter::enqueue(LogFileStreamOutput& output, LogMessageBuffer::Iterator msg_iterator) {
AsyncLogLocker locker;

for (; !msg_iterator.is_at_end(); msg_iterator++) {
Expand Down Expand Up @@ -95,7 +96,7 @@ class AsyncLogMapIterator {

public:
AsyncLogMapIterator(AsyncLogBuffer& logs) :_logs(logs) {}
bool do_entry(LogFileOutput* output, uint32_t* counter) {
bool do_entry(LogFileStreamOutput* output, uint32_t* counter) {
using none = LogTagSetMapping<LogTag::__NO_TAG>;

if (*counter > 0) {
Expand Down
17 changes: 10 additions & 7 deletions src/hotspot/share/logging/logAsyncWriter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
#define SHARE_LOGGING_LOGASYNCWRITER_HPP
#include "logging/log.hpp"
#include "logging/logDecorations.hpp"
#include "logging/logFileOutput.hpp"
#include "logging/logMessageBuffer.hpp"
#include "memory/resourceArea.hpp"
#include "runtime/nonJavaThread.hpp"
#include "runtime/semaphore.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/linkedlist.hpp"

Expand Down Expand Up @@ -90,25 +90,28 @@ class LinkedListDeque : private LinkedListImpl<E, ResourceObj::C_HEAP, F> {
}
};

// Forward declaration
class LogFileStreamOutput;

class AsyncLogMessage {
LogFileOutput* _output;
LogFileStreamOutput* _output;
const LogDecorations _decorations;
char* _message;

public:
AsyncLogMessage(LogFileOutput* output, const LogDecorations& decorations, char* msg)
AsyncLogMessage(LogFileStreamOutput* output, const LogDecorations& decorations, char* msg)
: _output(output), _decorations(decorations), _message(msg) {}

// placeholder for LinkedListImpl.
bool equals(const AsyncLogMessage& o) const { return false; }

LogFileOutput* output() const { return _output; }
LogFileStreamOutput* output() const { return _output; }
const LogDecorations& decorations() const { return _decorations; }
char* message() const { return _message; }
};

typedef LinkedListDeque<AsyncLogMessage, mtLogging> AsyncLogBuffer;
typedef KVHashtable<LogFileOutput*, uint32_t, mtLogging> AsyncLogMap;
typedef KVHashtable<LogFileStreamOutput*, uint32_t, mtLogging> AsyncLogMap;

//
// ASYNC LOGGING SUPPORT
Expand Down Expand Up @@ -163,8 +166,8 @@ class AsyncLogWriter : public NonJavaThread {
}

public:
void enqueue(LogFileOutput& output, const LogDecorations& decorations, const char* msg);
void enqueue(LogFileOutput& output, LogMessageBuffer::Iterator msg_iterator);
void enqueue(LogFileStreamOutput& output, const LogDecorations& decorations, const char* msg);
void enqueue(LogFileStreamOutput& output, LogMessageBuffer::Iterator msg_iterator);

static AsyncLogWriter* instance();
static void initialize();
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/logging/logFileOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ int LogFileOutput::write_blocking(const LogDecorations& decorations, const char*
return 0;
}

int written = LogFileStreamOutput::write(decorations, msg);
int written = write_internal(decorations, msg);
// Need to flush to the filesystem before should_rotate()
written = flush() ? written : -1;
if (written > 0) {
_current_size += written;

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/logging/logFileOutput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class LogFileOutput : public LogFileStreamOutput {
virtual bool initialize(const char* options, outputStream* errstream);
virtual int write(const LogDecorations& decorations, const char* msg);
virtual int write(LogMessageBuffer::Iterator msg_iterator);
int write_blocking(const LogDecorations& decorations, const char* msg);
virtual int write_blocking(const LogDecorations& decorations, const char* msg);
virtual void force_rotate();
virtual void describe(outputStream* out);

Expand Down
Loading

0 comments on commit 736f89d

Please sign in to comment.