Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 8345987_newObject…
Browse files Browse the repository at this point in the history
…Name
  • Loading branch information
kevinjwalls committed Dec 12, 2024
2 parents 1be59bf + 3f2556b commit 965b426
Show file tree
Hide file tree
Showing 1,102 changed files with 7,061 additions and 3,937 deletions.
17 changes: 0 additions & 17 deletions make/autoconf/flags-cflags.m4
Original file line number Diff line number Diff line change
Expand Up @@ -640,23 +640,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
# Linking is different on macOS
JVM_PICFLAG=""
fi
# Extra flags needed when building optional static versions of certain
# JDK libraries.
STATIC_LIBS_CFLAGS="-DSTATIC_BUILD=1"
if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -ffunction-sections -fdata-sections \
-DJNIEXPORT='__attribute__((visibility(\"default\")))'"
else
STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS -DJNIEXPORT="
fi
if test "x$TOOLCHAIN_TYPE" = xgcc; then
# Disable relax-relocation to enable compatibility with older linkers
RELAX_RELOCATIONS_FLAG="-Xassembler -mrelax-relocations=no"
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${RELAX_RELOCATIONS_FLAG}],
IF_TRUE: [STATIC_LIBS_CFLAGS="$STATIC_LIBS_CFLAGS ${RELAX_RELOCATIONS_FLAG}"])
fi
AC_SUBST(STATIC_LIBS_CFLAGS)
])

################################################################################
Expand Down
2 changes: 0 additions & 2 deletions make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,6 @@ LIBFFI_LIB_FILE := @LIBFFI_LIB_FILE@
FILE_MACRO_CFLAGS := @FILE_MACRO_CFLAGS@
REPRODUCIBLE_CFLAGS := @REPRODUCIBLE_CFLAGS@

STATIC_LIBS_CFLAGS := @STATIC_LIBS_CFLAGS@

JMH_CORE_JAR := @JMH_CORE_JAR@
JMH_GENERATOR_JAR := @JMH_GENERATOR_JAR@
JMH_JOPT_SIMPLE_JAR := @JMH_JOPT_SIMPLE_JAR@
Expand Down
2 changes: 1 addition & 1 deletion make/common/native/Flags.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ define SetupCompilerFlags
$1_EXTRA_CFLAGS += $$($1_CFLAGS_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_release)
endif
ifeq ($(STATIC_LIBS), true)
$1_EXTRA_CFLAGS += $$(STATIC_LIBS_CFLAGS)
$1_EXTRA_CFLAGS += -DSTATIC_BUILD=1
endif

# Pickup extra OPENJDK_TARGET_OS_TYPE, OPENJDK_TARGET_OS and/or TOOLCHAIN_TYPE
Expand Down
2 changes: 1 addition & 1 deletion src/demo/share/java2d/J2DBench/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
Expand Down
2 changes: 1 addition & 1 deletion src/demo/share/java2d/J2DBench/build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
Expand Down
40 changes: 5 additions & 35 deletions src/hotspot/cpu/aarch64/aarch64_vector.ad
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ source %{
}
}

bool Matcher::vector_rearrange_requires_load_shuffle(BasicType elem_bt, int vlen) {
return false;
}

// Assert that the given node is not a variable shift.
bool assert_not_var_shift(const Node* n) {
assert(!n->as_ShiftV()->is_var_shift(), "illegal variable shift");
Expand Down Expand Up @@ -6150,41 +6154,6 @@ instruct vtest_alltrue_sve(rFlagsReg cr, pReg src1, pReg src2, pReg ptmp) %{
ins_pipe(pipe_slow);
%}

// ------------------------------ Vector shuffle -------------------------------

instruct loadshuffle(vReg dst, vReg src) %{
match(Set dst (VectorLoadShuffle src));
format %{ "loadshuffle $dst, $src" %}
ins_encode %{
BasicType bt = Matcher::vector_element_basic_type(this);
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
if (bt == T_BYTE) {
if ($dst$$FloatRegister != $src$$FloatRegister) {
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
__ orr($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
$src$$FloatRegister, $src$$FloatRegister);
} else {
assert(UseSVE > 0, "must be sve");
__ sve_orr($dst$$FloatRegister, $src$$FloatRegister, $src$$FloatRegister);
}
}
} else {
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
// 4S/8S, 4I, 4F
__ uxtl($dst$$FloatRegister, __ T8H, $src$$FloatRegister, __ T8B);
if (type2aelembytes(bt) == 4) {
__ uxtl($dst$$FloatRegister, __ T4S, $dst$$FloatRegister, __ T4H);
}
} else {
assert(UseSVE > 0, "must be sve");
__ sve_vector_extend($dst$$FloatRegister, __ elemType_to_regVariant(bt),
$src$$FloatRegister, __ B);
}
}
%}
ins_pipe(pipe_slow);
%}

// ------------------------------ Vector rearrange -----------------------------

// Here is an example that rearranges a NEON vector with 4 ints:
Expand All @@ -6207,6 +6176,7 @@ instruct loadshuffle(vReg dst, vReg src) %{
// need to lookup 2/4 bytes as a group. For VectorRearrange long, we use bsl
// to implement rearrange.

// Maybe move the shuffle preparation to VectorLoadShuffle
instruct rearrange_HS_neon(vReg dst, vReg src, vReg shuffle, vReg tmp1, vReg tmp2) %{
predicate(UseSVE == 0 &&
(Matcher::vector_element_basic_type(n) == T_SHORT ||
Expand Down
40 changes: 5 additions & 35 deletions src/hotspot/cpu/aarch64/aarch64_vector_ad.m4
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ source %{
}
}

bool Matcher::vector_rearrange_requires_load_shuffle(BasicType elem_bt, int vlen) {
return false;
}

// Assert that the given node is not a variable shift.
bool assert_not_var_shift(const Node* n) {
assert(!n->as_ShiftV()->is_var_shift(), "illegal variable shift");
Expand Down Expand Up @@ -4397,41 +4401,6 @@ instruct vtest_alltrue_sve(rFlagsReg cr, pReg src1, pReg src2, pReg ptmp) %{
ins_pipe(pipe_slow);
%}

// ------------------------------ Vector shuffle -------------------------------

instruct loadshuffle(vReg dst, vReg src) %{
match(Set dst (VectorLoadShuffle src));
format %{ "loadshuffle $dst, $src" %}
ins_encode %{
BasicType bt = Matcher::vector_element_basic_type(this);
uint length_in_bytes = Matcher::vector_length_in_bytes(this);
if (bt == T_BYTE) {
if ($dst$$FloatRegister != $src$$FloatRegister) {
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
__ orr($dst$$FloatRegister, length_in_bytes == 16 ? __ T16B : __ T8B,
$src$$FloatRegister, $src$$FloatRegister);
} else {
assert(UseSVE > 0, "must be sve");
__ sve_orr($dst$$FloatRegister, $src$$FloatRegister, $src$$FloatRegister);
}
}
} else {
if (VM_Version::use_neon_for_vector(length_in_bytes)) {
// 4S/8S, 4I, 4F
__ uxtl($dst$$FloatRegister, __ T8H, $src$$FloatRegister, __ T8B);
if (type2aelembytes(bt) == 4) {
__ uxtl($dst$$FloatRegister, __ T4S, $dst$$FloatRegister, __ T4H);
}
} else {
assert(UseSVE > 0, "must be sve");
__ sve_vector_extend($dst$$FloatRegister, __ elemType_to_regVariant(bt),
$src$$FloatRegister, __ B);
}
}
%}
ins_pipe(pipe_slow);
%}

// ------------------------------ Vector rearrange -----------------------------

// Here is an example that rearranges a NEON vector with 4 ints:
Expand All @@ -4454,6 +4423,7 @@ instruct loadshuffle(vReg dst, vReg src) %{
// need to lookup 2/4 bytes as a group. For VectorRearrange long, we use bsl
// to implement rearrange.

// Maybe move the shuffle preparation to VectorLoadShuffle
instruct rearrange_HS_neon(vReg dst, vReg src, vReg shuffle, vReg tmp1, vReg tmp2) %{
predicate(UseSVE == 0 &&
(Matcher::vector_element_basic_type(n) == T_SHORT ||
Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,

BasicType* out_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_c_args);
VMRegPair* out_regs = NEW_RESOURCE_ARRAY(VMRegPair, total_c_args);
BasicType* in_elem_bt = nullptr;

int argc = 0;
out_sig_bt[argc++] = T_ADDRESS;
Expand Down Expand Up @@ -1668,15 +1667,12 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,

// For JNI natives the incoming and outgoing registers are offset upwards.
GrowableArray<int> arg_order(2 * total_in_args);
VMRegPair tmp_vmreg;
tmp_vmreg.set2(r19->as_VMReg());

for (int i = total_in_args - 1, c_arg = total_c_args - 1; i >= 0; i--, c_arg--) {
arg_order.push(i);
arg_order.push(c_arg);
}

int temploc = -1;
for (int ai = 0; ai < arg_order.length(); ai += 2) {
int i = arg_order.at(ai);
int c_arg = arg_order.at(ai + 1);
Expand Down Expand Up @@ -1892,7 +1888,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
}

Label safepoint_in_progress, safepoint_in_progress_done;
Label after_transition;

// Switch thread to "native transition" state before reading the synchronization state.
// This additional state is necessary because reading and testing the synchronization
Expand Down Expand Up @@ -1925,7 +1920,6 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
__ mov(rscratch1, _thread_in_Java);
__ lea(rscratch2, Address(rthread, JavaThread::thread_state_offset()));
__ stlrw(rscratch1, rscratch2);
__ bind(after_transition);

if (LockingMode != LM_LEGACY && method->is_object_wait0()) {
// Check preemption for Object.wait()
Expand Down
4 changes: 4 additions & 0 deletions src/hotspot/cpu/arm/arm.ad
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,10 @@ bool Matcher::vector_needs_partial_operations(Node* node, const TypeVect* vt) {
return false;
}

bool Matcher::vector_rearrange_requires_load_shuffle(BasicType elem_bt, int vlen) {
return false;
}

const RegMask* Matcher::predicate_reg_mask(void) {
return nullptr;
}
Expand Down
10 changes: 1 addition & 9 deletions src/hotspot/cpu/ppc/assembler_ppc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,10 @@ class Address {
intptr_t _disp; // Displacement.

public:
Address(Register b, Register i, address d = 0)
: _base(b), _index(i), _disp((intptr_t)d) {
assert(i == noreg || d == 0, "can't have both");
}

Address(Register b, address d = 0)
: _base(b), _index(noreg), _disp((intptr_t)d) {}

Address(Register b, ByteSize d)
: _base(b), _index(noreg), _disp((intptr_t)d) {}

Address(Register b, intptr_t d)
Address(Register b, intptr_t d = 0)
: _base(b), _index(noreg), _disp(d) {}

Address(Register b, RegisterOrConstant roc)
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/cpu/ppc/frame_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ void frame::patch_pc(Thread* thread, address pc) {
p2i(&((address*) _sp)[-1]), p2i(((address*) _sp)[-1]), p2i(pc));
}
assert(!Continuation::is_return_barrier_entry(*pc_addr), "return barrier");
assert(_pc == *pc_addr || pc == *pc_addr || 0 == *pc_addr,
assert(_pc == *pc_addr || pc == *pc_addr || nullptr == *pc_addr,
"must be (pc: " INTPTR_FORMAT " _pc: " INTPTR_FORMAT " pc_addr: " INTPTR_FORMAT
" *pc_addr: " INTPTR_FORMAT " sp: " INTPTR_FORMAT ")",
p2i(pc), p2i(_pc), p2i(pc_addr), p2i(*pc_addr), p2i(sp()));
Expand Down Expand Up @@ -318,10 +318,10 @@ void frame::patch_pc(Thread* thread, address pc) {
bool frame::is_interpreted_frame_valid(JavaThread* thread) const {
assert(is_interpreted_frame(), "Not an interpreted frame");
// These are reasonable sanity checks
if (fp() == 0 || (intptr_t(fp()) & (wordSize-1)) != 0) {
if (fp() == nullptr || (intptr_t(fp()) & (wordSize-1)) != 0) {
return false;
}
if (sp() == 0 || (intptr_t(sp()) & (wordSize-1)) != 0) {
if (sp() == nullptr || (intptr_t(sp()) & (wordSize-1)) != 0) {
return false;
}
int min_frame_slots = (parent_ijava_frame_abi_size + ijava_state_size) / sizeof(intptr_t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ void ShenandoahBarrierSetAssembler::store_at(MacroAssembler *masm, DecoratorSet
tmp1, tmp2, tmp3,
preservation_level);

// No need for post barrier if storing NULL
// No need for post barrier if storing null
if (ShenandoahCardBarrier && is_reference_type(type) && val != noreg) {
store_check(masm, base, ind_or_offs, tmp1);
}
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3296,7 +3296,7 @@ void MacroAssembler::get_vm_result_2(Register metadata_result) {

Register MacroAssembler::encode_klass_not_null(Register dst, Register src) {
Register current = (src != noreg) ? src : dst; // Klass is in dst if no src provided.
if (CompressedKlassPointers::base() != 0) {
if (CompressedKlassPointers::base() != nullptr) {
// Use dst as temp if it is free.
sub_const_optimized(dst, current, CompressedKlassPointers::base(), R0);
current = dst;
Expand Down Expand Up @@ -3356,11 +3356,11 @@ void MacroAssembler::decode_klass_not_null(Register dst, Register src) {
if (src == noreg) src = dst;
Register shifted_src = src;
if (CompressedKlassPointers::shift() != 0 ||
(CompressedKlassPointers::base() == 0 && src != dst)) { // Move required.
(CompressedKlassPointers::base() == nullptr && src != dst)) { // Move required.
shifted_src = dst;
sldi(shifted_src, src, CompressedKlassPointers::shift());
}
if (CompressedKlassPointers::base() != 0) {
if (CompressedKlassPointers::base() != nullptr) {
add_const_optimized(dst, shifted_src, CompressedKlassPointers::base(), R0);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/ppc/nativeInst_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bool NativeInstruction::is_sigill_not_entrant_at(address addr) {
void NativeInstruction::verify() {
// Make sure code pattern is actually an instruction address.
address addr = addr_at(0);
if (addr == 0 || ((intptr_t)addr & 3) != 0) {
if (addr == nullptr || ((intptr_t)addr & 3) != 0) {
fatal("not an instruction address");
}
}
Expand Down Expand Up @@ -115,7 +115,7 @@ void NativeCall::set_destination_mt_safe(address dest, bool assert_lock) {
// does not provide this information. The branch will be patched
// later during a final fixup, when all necessary information is
// available.
if (trampoline_stub_addr == 0)
if (trampoline_stub_addr == nullptr)
return;

// Patch the constant in the call's trampoline stub.
Expand Down
10 changes: 7 additions & 3 deletions src/hotspot/cpu/ppc/ppc.ad
Original file line number Diff line number Diff line change
Expand Up @@ -2153,6 +2153,10 @@ bool Matcher::vector_needs_partial_operations(Node* node, const TypeVect* vt) {
return false;
}

bool Matcher::vector_rearrange_requires_load_shuffle(BasicType elem_bt, int vlen) {
return false;
}

const RegMask* Matcher::predicate_reg_mask(void) {
return nullptr;
}
Expand Down Expand Up @@ -3338,7 +3342,7 @@ encode %{
// The trampoline stub.
// No entry point given, use the current pc.
// Make sure branch fits into
if (entry_point == 0) entry_point = __ pc();
if (entry_point == nullptr) entry_point = __ pc();

// Put the entry point as a constant into the constant pool.
const address entry_point_toc_addr = __ address_constant(entry_point, RelocationHolder::none);
Expand Down Expand Up @@ -3377,7 +3381,7 @@ encode %{
enc_class enc_java_dynamic_call_sched(method meth) %{
if (!ra_->C->output()->in_scratch_emit_size()) {
// Create a call trampoline stub for the given method.
const address entry_point = !($meth$$method) ? 0 : (address)$meth$$method;
const address entry_point = !($meth$$method) ? nullptr : (address)$meth$$method;
const address entry_point_const = __ address_constant(entry_point, RelocationHolder::none);
if (entry_point_const == nullptr) {
ciEnv::current()->record_out_of_memory_failure();
Expand Down Expand Up @@ -3610,7 +3614,7 @@ encode %{
MachNode *mtctr = new CallLeafDirect_mtctrNode();

assert(loadConLNodes_Entry._last != nullptr, "entry must exist");
mtctr->add_req(0, loadConLNodes_Entry._last);
mtctr->add_req(nullptr, loadConLNodes_Entry._last);

mtctr->_opnds[0] = new iRegLdstOper();
mtctr->_opnds[1] = new iRegLdstOper();
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/cpu/ppc/relocInfo_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ void Relocation::pd_set_call_destination(address x) {

address* Relocation::pd_address_in_code() {
ShouldNotReachHere();
return 0;
}

address Relocation::pd_get_address_from_code() {
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2103,7 +2103,6 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,

BasicType *out_sig_bt = NEW_RESOURCE_ARRAY(BasicType, total_c_args);
VMRegPair *out_regs = NEW_RESOURCE_ARRAY(VMRegPair, total_c_args);
BasicType* in_elem_bt = nullptr;

// Create the signature for the C call:
// 1) add the JNIEnv*
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/ppc/stubGenerator_ppc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ class StubGenerator: public StubCodeGenerator {
// Don't generate, rather use C++ code.
address generate_verify_oop() {
// this is actually a `FunctionDescriptor*'.
address start = 0;
address start = nullptr;

#if !defined(PRODUCT)
start = CAST_FROM_FN_PTR(address, verify_oop_helper);
Expand Down
Loading

0 comments on commit 965b426

Please sign in to comment.