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 Aug 10, 2024
2 parents 18f392f + 358d77d commit 7e78899
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 46 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/jniFastGetField_aarch64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -201,7 +201,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {

{
__ enter();
__ lea(rscratch1, ExternalAddress(slow_case_addr));
__ lea(rscratch1, RuntimeAddress(slow_case_addr));
__ blr(rscratch1);
__ leave();
__ ret(lr);
Expand Down
12 changes: 2 additions & 10 deletions src/hotspot/cpu/aarch64/sharedRuntime_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1883,16 +1883,8 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,

// Check for safepoint operation in progress and/or pending suspend requests.
{
// We need an acquire here to ensure that any subsequent load of the
// global SafepointSynchronize::_state flag is ordered after this load
// of the thread-local polling word. We don't want this poll to
// return false (i.e. not safepointing) and a later poll of the global
// SafepointSynchronize::_state spuriously to return true.
//
// This is to avoid a race when we're in a native->Java transition
// racing the code which wakes up from a safepoint.

__ safepoint_poll(safepoint_in_progress, true /* at_return */, true /* acquire */, false /* in_nmethod */);
// No need for acquire as Java threads always disarm themselves.
__ safepoint_poll(safepoint_in_progress, true /* at_return */, false /* acquire */, false /* in_nmethod */);
__ ldrw(rscratch1, Address(rthread, JavaThread::suspend_flags_offset()));
__ cbnzw(rscratch1, safepoint_in_progress);
__ bind(safepoint_in_progress_done);
Expand Down
11 changes: 2 additions & 9 deletions src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1413,15 +1413,8 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
{
Label L, Continue;

// We need an acquire here to ensure that any subsequent load of the
// global SafepointSynchronize::_state flag is ordered after this load
// of the thread-local polling word. We don't want this poll to
// return false (i.e. not safepointing) and a later poll of the global
// SafepointSynchronize::_state spuriously to return true.
//
// This is to avoid a race when we're in a native->Java transition
// racing the code which wakes up from a safepoint.
__ safepoint_poll(L, true /* at_return */, true /* acquire */, false /* in_nmethod */);
// No need for acquire as Java threads always disarm themselves.
__ safepoint_poll(L, true /* at_return */, false /* acquire */, false /* in_nmethod */);
__ ldrw(rscratch2, Address(rthread, JavaThread::suspend_flags_offset()));
__ cbz(rscratch2, Continue);
__ bind(L);
Expand Down
9 changes: 2 additions & 7 deletions src/hotspot/cpu/riscv/jniFastGetField_riscv.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Expand Down Expand Up @@ -173,12 +173,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {

{
__ enter();
ExternalAddress target(slow_case_addr);
__ relocate(target.rspec(), [&] {
int32_t offset;
__ la(t0, target.target(), offset);
__ jalr(t0, offset);
});
__ rt_call(slow_case_addr);
__ leave();
__ ret();
}
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/cpu/x86/assembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,7 @@ void Assembler::call(Register dst) {


void Assembler::call(Address adr) {
assert(!adr._rspec.reloc()->is_data(), "should not use ExternalAddress for call");
InstructionMark im(this);
prefix(adr);
emit_int8((unsigned char)0xFF);
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/cpu/x86/jniFastGetField_x86_32.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 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 @@ -138,7 +138,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
default: ShouldNotReachHere();
}
// tail call
__ jump (ExternalAddress(slow_case_addr));
__ jump (RuntimeAddress(slow_case_addr));

__ flush ();

Expand Down Expand Up @@ -251,7 +251,7 @@ address JNI_FastGetField::generate_fast_get_long_field() {
__ pop (rsi);
address slow_case_addr = jni_GetLongField_addr();;
// tail call
__ jump (ExternalAddress(slow_case_addr));
__ jump (RuntimeAddress(slow_case_addr));

__ flush ();

Expand Down Expand Up @@ -350,7 +350,7 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
default: ShouldNotReachHere();
}
// tail call
__ jump (ExternalAddress(slow_case_addr));
__ jump (RuntimeAddress(slow_case_addr));

__ flush ();

Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/cpu/x86/jniFastGetField_x86_64.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 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 @@ -118,7 +118,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) {
default: break;
}
// tail call
__ jump (ExternalAddress(slow_case_addr), rscratch1);
__ jump (RuntimeAddress(slow_case_addr), rscratch1);

__ flush ();

Expand Down Expand Up @@ -206,7 +206,7 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) {
default: break;
}
// tail call
__ jump (ExternalAddress(slow_case_addr), rscratch1);
__ jump (RuntimeAddress(slow_case_addr), rscratch1);

__ flush ();

Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/x86/macroAssembler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2329,7 +2329,7 @@ void MacroAssembler::incrementl(Address dst, int value) {

void MacroAssembler::jump(AddressLiteral dst, Register rscratch) {
assert(rscratch != noreg || always_reachable(dst), "missing");

assert(!dst.rspec().reloc()->is_data(), "should not use ExternalAddress for jump");
if (reachable(dst)) {
jmp_literal(dst.target(), dst.rspec());
} else {
Expand All @@ -2340,7 +2340,7 @@ void MacroAssembler::jump(AddressLiteral dst, Register rscratch) {

void MacroAssembler::jump_cc(Condition cc, AddressLiteral dst, Register rscratch) {
assert(rscratch != noreg || always_reachable(dst), "missing");

assert(!dst.rspec().reloc()->is_data(), "should not use ExternalAddress for jump_cc");
if (reachable(dst)) {
InstructionMark im(this);
relocate(dst.reloc());
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/x86/sharedRuntime_x86_32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -704,10 +704,10 @@ static void range_check(MacroAssembler* masm, Register pc_reg, Register temp_reg
address code_start, address code_end,
Label& L_ok) {
Label L_fail;
__ lea(temp_reg, ExternalAddress(code_start));
__ lea(temp_reg, AddressLiteral(code_start, relocInfo::none));
__ cmpptr(pc_reg, temp_reg);
__ jcc(Assembler::belowEqual, L_fail);
__ lea(temp_reg, ExternalAddress(code_end));
__ lea(temp_reg, AddressLiteral(code_end, relocInfo::none));
__ cmpptr(pc_reg, temp_reg);
__ jcc(Assembler::below, L_ok);
__ bind(L_fail);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,10 @@ static void range_check(MacroAssembler* masm, Register pc_reg, Register temp_reg
address code_start, address code_end,
Label& L_ok) {
Label L_fail;
__ lea(temp_reg, ExternalAddress(code_start));
__ lea(temp_reg, AddressLiteral(code_start, relocInfo::none));
__ cmpptr(pc_reg, temp_reg);
__ jcc(Assembler::belowEqual, L_fail);
__ lea(temp_reg, ExternalAddress(code_end));
__ lea(temp_reg, AddressLiteral(code_end, relocInfo::none));
__ cmpptr(pc_reg, temp_reg);
__ jcc(Assembler::below, L_ok);
__ bind(L_fail);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/cpu/x86/stubGenerator_x86_64_arraycopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void StubGenerator::array_overlap_test(address no_overlap_target, Label* NOLp, A
__ cmpptr(to, from);
__ lea(end_from, Address(from, count, sf, 0));
if (NOLp == nullptr) {
ExternalAddress no_overlap(no_overlap_target);
RuntimeAddress no_overlap(no_overlap_target);
__ jump_cc(Assembler::belowEqual, no_overlap);
__ cmpptr(to, end_from);
__ jump_cc(Assembler::aboveEqual, no_overlap);
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 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 @@ -180,7 +180,7 @@ bool os::win32::register_code_area(char *low, char *high) {
MacroAssembler* masm = new MacroAssembler(&cb);
pDCD = (pDynamicCodeData) masm->pc();

masm->jump(ExternalAddress((address)&HandleExceptionFromCodeCache), rscratch1);
masm->jump(RuntimeAddress((address)&HandleExceptionFromCodeCache), rscratch1);
masm->flush();

// Create an Unwind Structure specifying no unwind info
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/precompiled/precompiled.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 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 @@ -29,7 +29,7 @@

// These header files are included in at least 130 C++ files, as of
// measurements made in November 2018. This list excludes files named
// *.include.hpp, since including them decreased build performance.
// *.inline.hpp, since including them decreased build performance.

#include "classfile/classLoaderData.hpp"
#include "classfile/javaClasses.hpp"
Expand Down

0 comments on commit 7e78899

Please sign in to comment.