Skip to content

Commit

Permalink
Merge pull request #1589 from SAP/pr-jdk-23+6
Browse files Browse the repository at this point in the history
Merge to tag jdk-23+6
  • Loading branch information
RealCLanger authored Jan 19, 2024
2 parents dfc0525 + ff8cc26 commit f03c82e
Show file tree
Hide file tree
Showing 382 changed files with 9,739 additions and 7,677 deletions.
18 changes: 16 additions & 2 deletions .github/scripts/gen-test-results.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 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 @@ -44,8 +44,8 @@ for test in $failures $errors; do
base_path="$(echo "$test" | tr '#' '_')"
report_file="$report_dir/$base_path.jtr"
hs_err_files=$(ls $report_dir/$base_path/hs_err*.log 2> /dev/null || true)
replay_files=$(ls $report_dir/$base_path/replay*.log 2> /dev/null || true)
echo "#### <a id="$anchor">$test"

echo '<details><summary>View test results</summary>'
echo ''
echo '```'
Expand Down Expand Up @@ -73,6 +73,20 @@ for test in $failures $errors; do
echo ''
fi

if [[ "$replay_files" != "" ]]; then
echo '<details><summary>View HotSpot replay file</summary>'
echo ''
for replay in $replay_files; do
echo '```'
echo "$replay:"
echo ''
cat "$replay"
echo '```'
done

echo '</details>'
echo ''
fi
done >> $GITHUB_STEP_SUMMARY

# With many failures, the summary can easily exceed 1024 kB, the limit set by Github
Expand Down
2 changes: 2 additions & 0 deletions doc/building.html
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ <h3 id="fontconfig">Fontconfig</h3>
<code>sudo apt-get install libfontconfig-dev</code>.</li>
<li>To install on an rpm-based Linux, try running
<code>sudo yum install fontconfig-devel</code>.</li>
<li>To install on Alpine Linux, try running
<code>sudo apk add fontconfig-dev</code>.</li>
</ul>
<p>Use <code>--with-fontconfig-include=&lt;path&gt;</code> and
<code>--with-fontconfig=&lt;path&gt;</code> if <code>configure</code>
Expand Down
1 change: 1 addition & 0 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ required on all platforms except Windows and macOS.
libfontconfig-dev`.
* To install on an rpm-based Linux, try running `sudo yum install
fontconfig-devel`.
* To install on Alpine Linux, try running `sudo apk add fontconfig-dev`.

Use `--with-fontconfig-include=<path>` and `--with-fontconfig=<path>` if
`configure` does not automatically locate the platform Fontconfig files.
Expand Down
5 changes: 5 additions & 0 deletions make/RunTests.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,16 @@ define SetupRunMicroTestBody
$1_MICRO_WARMUP_TIME := -w $$(MICRO_WARMUP_TIME)
endif

# Microbenchmarks are executed from the root of the test image directory.
# This enables JMH tests to add dependencies using relative paths such as
# -Djava.library.path=micro/native

run-test-$1: pre-run-test
$$(call LogWarn)
$$(call LogWarn, Running test '$$($1_TEST)')
$$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR))
$$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/micro, ( \
$$(CD) $$(TEST_IMAGE_DIR) && \
$$(FIXPATH) $$($1_MICRO_TEST_JDK)/bin/java $$($1_MICRO_JAVA_OPTIONS) \
-jar $$($1_MICRO_BENCHMARKS_JAR) \
$$($1_MICRO_ITER) $$($1_MICRO_FORK) $$($1_MICRO_TIME) \
Expand Down
6 changes: 5 additions & 1 deletion make/autoconf/toolchain.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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 @@ -389,6 +389,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
CFLAGS="$ORG_CFLAGS"
CXXFLAGS="$ORG_CXXFLAGS"
# filter out some unwanted additions autoconf may add to CXX; we saw this on macOS with autoconf 2.72
UTIL_GET_NON_MATCHING_VALUES(cxx_filtered, $CXX, -std=c++11 -std=gnu++11)
CXX="$cxx_filtered"
])

# Check if a compiler is of the toolchain type we expect, and save the version
Expand Down
6 changes: 3 additions & 3 deletions make/autoconf/util.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 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 @@ -199,7 +199,7 @@ AC_DEFUN([UTIL_GET_NON_MATCHING_VALUES],
if test -z "$legal_values"; then
$1="$2"
else
result=`$GREP -Fvx "$legal_values" <<< "$values_to_check" | $GREP -v '^$'`
result=`$GREP -Fvx -- "$legal_values" <<< "$values_to_check" | $GREP -v '^$'`
$1=${result//$'\n'/ }
fi
])
Expand All @@ -226,7 +226,7 @@ AC_DEFUN([UTIL_GET_MATCHING_VALUES],
if test -z "$illegal_values"; then
$1=""
else
result=`$GREP -Fx "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'`
result=`$GREP -Fx -- "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'`
$1=${result//$'\n'/ }
fi
])
Expand Down
3 changes: 2 additions & 1 deletion make/devkit/Tools.gmk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 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 @@ -548,6 +548,7 @@ $(BUILDDIR)/$(gcc_ver)/Makefile \
$(PATHPRE) $(ENVS) $(GCC_CFG) $(EXTRA_CFLAGS) \
$(CONFIG) \
--with-sysroot=$(SYSROOT) \
--with-debug-prefix-map=$(OUTPUT_ROOT)=devkit \
--enable-languages=c,c++ \
--enable-shared \
--disable-nls \
Expand Down
2 changes: 1 addition & 1 deletion make/hotspot/lib/CompileJvm.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ CFLAGS_VM_VERSION := \

DISABLED_WARNINGS_gcc := array-bounds comment delete-non-virtual-dtor \
empty-body implicit-fallthrough int-in-bool-context \
maybe-uninitialized missing-field-initializers parentheses \
maybe-uninitialized missing-field-initializers \
shift-negative-value unknown-pragmas

DISABLED_WARNINGS_clang := sometimes-uninitialized \
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/cpu/aarch64/nativeInst_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "code/codeCache.hpp"
#include "code/compiledIC.hpp"
#include "gc/shared/collectedHeap.hpp"
#include "memory/resourceArea.hpp"
#include "nativeInst_aarch64.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.hpp"
Expand Down Expand Up @@ -189,8 +188,6 @@ void NativeCall::set_destination_mt_safe(address dest, bool assert_lock) {
CompiledICLocker::is_safe(addr_at(0)),
"concurrent code patching");

ResourceMark rm;
int code_size = NativeInstruction::instruction_size;
address addr_call = addr_at(0);
bool reachable = Assembler::reachable_from_branch_at(addr_call, dest);
assert(NativeCall::is_call_at(addr_call), "unexpected code at call site");
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/aarch64/vtableStubs_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ VtableStub* VtableStubs::create_itable_stub(int itable_index) {
temp_reg, temp_reg2, itable_index, L_no_such_interface);

// Reduce "estimate" such that "padding" does not drop below 8.
const ptrdiff_t estimate = 124;
const ptrdiff_t estimate = 144;
const ptrdiff_t codesize = __ pc() - start_pc;
slop_delta = (int)(estimate - codesize);
slop_bytes += slop_delta;
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2862,6 +2862,7 @@ void LIR_Assembler::rt_call(LIR_Opr result, address dest,
if (info != nullptr) {
add_call_info_here(info);
}
assert(__ last_calls_return_pc() == __ pc(), "pcn not at return pc");
__ post_call_nop();
}

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/continuationFreezeThaw_ppc.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ inline void Thaw<ConfigT>::patch_caller_links(intptr_t* sp, intptr_t* bottom) {
if (is_entry_frame) {
callers_sp = _cont.entryFP();
} else {
CodeBlob* cb = CodeCache::find_blob(pc);
CodeBlob* cb = CodeCache::find_blob_fast(pc);
callers_sp = sp + cb->frame_size();
}
// set the back link
Expand Down
10 changes: 5 additions & 5 deletions src/hotspot/cpu/ppc/frame_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ bool frame::safe_for_sender(JavaThread *thread) {

// It should be safe to construct the sender though it might not be valid.

frame sender(sender_sp, sender_pc);
frame sender(sender_sp, sender_pc, nullptr /* unextended_sp */, nullptr /* fp */, sender_blob);

// Do we have a valid fp?
address sender_fp = (address) sender.fp();
Expand Down Expand Up @@ -196,12 +196,12 @@ frame frame::sender_for_entry_frame(RegisterMap *map) const {
assert(map->include_argument_oops(), "should be set by clear");

if (jfa->last_Java_pc() != nullptr) {
frame fr(jfa->last_Java_sp(), jfa->last_Java_pc());
frame fr(jfa->last_Java_sp(), jfa->last_Java_pc(), kind::code_blob);
return fr;
}
// Last_java_pc is not set, if we come here from compiled code. The
// constructor retrieves the PC from the stack.
frame fr(jfa->last_Java_sp());
frame fr(jfa->last_Java_sp(), nullptr, kind::code_blob);
return fr;
}

Expand Down Expand Up @@ -229,7 +229,7 @@ frame frame::sender_for_upcall_stub_frame(RegisterMap* map) const {
assert(jfa->last_Java_sp() > sp(), "must be above this frame on stack");
map->clear();
assert(map->include_argument_oops(), "should be set by clear");
frame fr(jfa->last_Java_sp(), jfa->last_Java_pc());
frame fr(jfa->last_Java_sp(), jfa->last_Java_pc(), kind::code_blob);

return fr;
}
Expand Down Expand Up @@ -451,7 +451,7 @@ intptr_t *frame::initial_deoptimization_info() {
#ifndef PRODUCT
// This is a generic constructor which is only used by pns() in debug.cpp.
// fp is dropped and gets determined by backlink.
frame::frame(void* sp, void* fp, void* pc) : frame((intptr_t*)sp, (address)pc) {}
frame::frame(void* sp, void* fp, void* pc) : frame((intptr_t*)sp, (address)pc, kind::unknown) {}
#endif

BasicObjectLock* frame::interpreter_frame_monitor_end() const {
Expand Down
14 changes: 12 additions & 2 deletions src/hotspot/cpu/ppc/frame_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,16 +393,26 @@
inline common_abi* own_abi() const { return (common_abi*) _sp; }
inline common_abi* callers_abi() const { return (common_abi*) _fp; }

enum class kind {
unknown, // The frame's pc is not necessarily in the CodeCache.
// CodeCache::find_blob_fast(void* pc) can yield wrong results in this case and must not be used.
code_blob, // The frame's pc is known to be in the CodeCache but it is likely not in an nmethod.
// CodeCache::find_blob_fast() will be correct but not faster in this case.
nmethod // This is likely the frame of a nmethod.
// The code cache lookup is optimized based on NativePostCallNops.
};

private:

// Initialize frame members (_pc and _sp must be given)
inline void setup();
inline void setup(kind knd);

public:

// Constructors
inline frame(intptr_t* sp, intptr_t* fp, address pc);
inline frame(intptr_t* sp, address pc, intptr_t* unextended_sp = nullptr, intptr_t* fp = nullptr, CodeBlob* cb = nullptr);
inline frame(intptr_t* sp, address pc, kind knd = kind::nmethod);
inline frame(intptr_t* sp, address pc, intptr_t* unextended_sp, intptr_t* fp = nullptr, CodeBlob* cb = nullptr);
inline frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb, const ImmutableOopMap* oop_map);
inline frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb, const ImmutableOopMap* oop_map, bool on_heap);

Expand Down
20 changes: 13 additions & 7 deletions src/hotspot/cpu/ppc/frame_ppc.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
// Inline functions for ppc64 frames:

// Initialize frame members (_sp must be given)
inline void frame::setup() {
inline void frame::setup(kind knd) {
if (_pc == nullptr) {
_pc = (address)own_abi()->lr;
assert(_pc != nullptr, "must have PC");
}

if (_cb == nullptr) {
_cb = CodeCache::find_blob(_pc);
_cb = (knd == kind::nmethod) ? CodeCache::find_blob_fast(_pc) : CodeCache::find_blob(_pc);
}

if (_unextended_sp == nullptr) {
Expand Down Expand Up @@ -89,21 +89,27 @@ inline void frame::setup() {
inline frame::frame() : _sp(nullptr), _pc(nullptr), _cb(nullptr), _oop_map(nullptr), _deopt_state(unknown),
_on_heap(false), DEBUG_ONLY(_frame_index(-1) COMMA) _unextended_sp(nullptr), _fp(nullptr) {}

inline frame::frame(intptr_t* sp) : frame(sp, nullptr) {}
inline frame::frame(intptr_t* sp) : frame(sp, nullptr, kind::nmethod) {}

inline frame::frame(intptr_t* sp, intptr_t* fp, address pc) : frame(sp, pc, nullptr, fp, nullptr) {}

inline frame::frame(intptr_t* sp, address pc, kind knd)
: _sp(sp), _pc(pc), _cb(nullptr), _oop_map(nullptr),
_on_heap(false), DEBUG_ONLY(_frame_index(-1) COMMA) _unextended_sp(sp), _fp(nullptr) {
setup(knd);
}

inline frame::frame(intptr_t* sp, address pc, intptr_t* unextended_sp, intptr_t* fp, CodeBlob* cb)
: _sp(sp), _pc(pc), _cb(cb), _oop_map(nullptr),
_on_heap(false), DEBUG_ONLY(_frame_index(-1) COMMA) _unextended_sp(unextended_sp), _fp(fp) {
setup();
setup(kind::nmethod);
}

inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb, const ImmutableOopMap* oop_map)
: _sp(sp), _pc(pc), _cb(cb), _oop_map(oop_map),
_on_heap(false), DEBUG_ONLY(_frame_index(-1) COMMA) _unextended_sp(unextended_sp), _fp(fp) {
assert(_cb != nullptr, "pc: " INTPTR_FORMAT, p2i(pc));
setup();
setup(kind::nmethod);
}

inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address pc, CodeBlob* cb,
Expand All @@ -113,7 +119,7 @@ inline frame::frame(intptr_t* sp, intptr_t* unextended_sp, intptr_t* fp, address
// In thaw, non-heap frames use this constructor to pass oop_map. I don't know why.
assert(_on_heap || _cb != nullptr, "these frames are always heap frames");
if (cb != nullptr) {
setup();
setup(kind::nmethod);
}
#ifdef ASSERT
// The following assertion has been disabled because it would sometime trap for Continuation.run,
Expand Down Expand Up @@ -300,7 +306,7 @@ inline frame frame::sender_raw(RegisterMap* map) const {

// Must be native-compiled frame, i.e. the marshaling code for native
// methods that exists in the core system.
return frame(sender_sp(), sender_pc());
return frame(sender_sp(), sender_pc(), kind::code_blob);
}

inline frame frame::sender(RegisterMap* map) const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
*
*/

#include "gc/shared/gcArguments.hpp"
#include "gc/shared/gc_globals.hpp"
#include "macroAssembler_ppc.hpp"
#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/gcArguments.hpp"
#include "gc/shared/gc_globals.hpp"
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
#include "gc/shenandoah/shenandoahBarrierSetAssembler.hpp"
#include "gc/shenandoah/shenandoahForwarding.hpp"
Expand All @@ -38,6 +37,7 @@
#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
#include "gc/shenandoah/heuristics/shenandoahHeuristics.hpp"
#include "interpreter/interpreter.hpp"
#include "macroAssembler_ppc.hpp"
#include "runtime/javaThread.hpp"
#include "runtime/sharedRuntime.hpp"
#include "utilities/globalDefinitions.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/gc/x/xBarrierSetAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* questions.
*/

#include "asm/register.hpp"
#include "precompiled.hpp"
#include "asm/register.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "code/codeBlob.hpp"
#include "code/vmreg.inline.hpp"
Expand Down
6 changes: 5 additions & 1 deletion src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,12 @@ void MacroAssembler::post_call_nop() {
if (!Continuations::enabled()) {
return;
}
// We use CMPI/CMPLI instructions to encode post call nops.
// Refer to NativePostCallNop for details.
relocate(post_call_nop_Relocation::spec());
InlineSkippedInstructionsCounter skipCounter(this);
nop();
Assembler::emit_int32(Assembler::CMPLI_OPCODE | Assembler::opp_u_field(1, 9, 9));
assert(is_post_call_nop(*(int*)(pc() - 4)), "post call not not found");
}

void MacroAssembler::call_VM_base(Register oop_result,
Expand Down
6 changes: 6 additions & 0 deletions src/hotspot/cpu/ppc/macroAssembler_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,12 @@ class MacroAssembler: public Assembler {
inline void call_stub_and_return_to(Register function_entry, Register return_pc);

void post_call_nop();
static bool is_post_call_nop(int instr_bits) {
const uint32_t nineth_bit = opp_u_field(1, 9, 9);
const uint32_t opcode_mask = 0b111110 << OPCODE_SHIFT;
const uint32_t pcn_mask = opcode_mask | nineth_bit;
return (instr_bits & pcn_mask) == (Assembler::CMPLI_OPCODE | nineth_bit);
}

//
// Java utilities
Expand Down
Loading

0 comments on commit f03c82e

Please sign in to comment.