代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openjdk-17 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From cfa76d24fb8fdee972a0e9a35479bceb288ca59e Mon Sep 17 00:00:00 2001
Date: Wed, 4 Jan 2023 20:46:49 +0800
Subject: Apply TBI barrier patch to C1
---
.../gc/z/zBarrierSetAssembler_aarch64.cpp | 14 ++++++----
src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad | 28 ++++++++++++++++---
2 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp
index cafd4e58f..41f047f2c 100644
--- a/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/gc/z/zBarrierSetAssembler_aarch64.cpp
@@ -212,11 +212,8 @@ static void change_immediate(uint32_t& instr, uint32_t imm, uint32_t start, uint
void ZBarrierSetAssembler::patch_barrier_relocation(address addr) {
uint32_t* const patch_addr = (uint32_t*)addr;
- // The next 3 insns should be movz, andr, cbnz.
- assert(nativeInstruction_at(addr)->is_movz() &&
- Instruction_aarch64::extract(*(patch_addr + 1), 30, 24) == 0b0001010 &&
- Instruction_aarch64::extract(*(patch_addr + 2), 31, 24) == 0b10110101,
- "wrong insns in barrier patch");
+ // The next insn should be movz.
+ assert(nativeInstruction_at(addr)->is_movz(), "wrong insn in barrier patch");
change_immediate(*patch_addr, (uint16_t) (ZAddressBadMask >> 48), 5, 20);
OrderAccess::fence();
@@ -232,7 +229,12 @@ void ZBarrierSetAssembler::generate_c1_load_barrier_test(LIR_Assembler* ce,
LIR_Opr ref) const {
assert_different_registers(rscratch1, rthread, ref->as_register());
- __ ldr(rscratch1, address_bad_mask_from_thread(rthread));
+ if (UseTBI) {
+ __ relocate(barrier_Relocation::spec());
+ __ movz(rscratch1, barrier_Relocation::unpatched, 48);
+ } else {
+ __ ldr(rscratch1, address_bad_mask_from_thread(rthread));
+ }
__ tst(ref->as_register(), rscratch1);
}
diff --git a/src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad b/src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad
index 426a1cc2a..4dc54c280 100644
--- a/src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad
+++ b/src/hotspot/cpu/aarch64/gc/z/z_aarch64.ad
@@ -113,7 +113,12 @@ instruct zCompareAndSwapP(iRegINoSp res, indirect mem, iRegP oldval, iRegP newva
__ cset($res$$Register, Assembler::EQ);
if (barrier_data() != ZLoadBarrierElided) {
Label good;
- __ ldr(rscratch1, Address(rthread, ZThreadLocalData::address_bad_mask_offset()));
+ if (UseTBI) {
+ __ relocate(barrier_Relocation::spec());
+ __ movz(rscratch1, barrier_Relocation::unpatched, 48);
+ } else {
+ __ ldr(rscratch1, Address(rthread, ZThreadLocalData::address_bad_mask_offset()));
+ }
__ andr(rscratch1, rscratch1, rscratch2);
__ cbz(rscratch1, good);
z_load_barrier_slow_path(_masm, this, Address($mem$$Register), rscratch2 /* ref */, rscratch1 /* tmp */);
@@ -145,7 +150,12 @@ instruct zCompareAndSwapPAcq(iRegINoSp res, indirect mem, iRegP oldval, iRegP ne
__ cset($res$$Register, Assembler::EQ);
if (barrier_data() != ZLoadBarrierElided) {
Label good;
- __ ldr(rscratch1, Address(rthread, ZThreadLocalData::address_bad_mask_offset()));
+ if (UseTBI) {
+ __ relocate(barrier_Relocation::spec());
+ __ movz(rscratch1, barrier_Relocation::unpatched, 48);
+ } else {
+ __ ldr(rscratch1, Address(rthread, ZThreadLocalData::address_bad_mask_offset()));
+ }
__ andr(rscratch1, rscratch1, rscratch2);
__ cbz(rscratch1, good);
z_load_barrier_slow_path(_masm, this, Address($mem$$Register), rscratch2 /* ref */, rscratch1 /* tmp */ );
@@ -174,7 +184,12 @@ instruct zCompareAndExchangeP(iRegPNoSp res, indirect mem, iRegP oldval, iRegP n
false /* acquire */, true /* release */, false /* weak */, $res$$Register);
if (barrier_data() != ZLoadBarrierElided) {
Label good;
- __ ldr(rscratch1, Address(rthread, ZThreadLocalData::address_bad_mask_offset()));
+ if (UseTBI) {
+ __ relocate(barrier_Relocation::spec());
+ __ movz(rscratch1, barrier_Relocation::unpatched, 48);
+ } else {
+ __ ldr(rscratch1, Address(rthread, ZThreadLocalData::address_bad_mask_offset()));
+ }
__ andr(rscratch1, rscratch1, $res$$Register);
__ cbz(rscratch1, good);
z_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, rscratch1 /* tmp */);
@@ -202,7 +217,12 @@ instruct zCompareAndExchangePAcq(iRegPNoSp res, indirect mem, iRegP oldval, iReg
true /* acquire */, true /* release */, false /* weak */, $res$$Register);
if (barrier_data() != ZLoadBarrierElided) {
Label good;
- __ ldr(rscratch1, Address(rthread, ZThreadLocalData::address_bad_mask_offset()));
+ if (UseTBI) {
+ __ relocate(barrier_Relocation::spec());
+ __ movz(rscratch1, barrier_Relocation::unpatched, 48);
+ } else {
+ __ ldr(rscratch1, Address(rthread, ZThreadLocalData::address_bad_mask_offset()));
+ }
__ andr(rscratch1, rscratch1, $res$$Register);
__ cbz(rscratch1, good);
z_load_barrier_slow_path(_masm, this, Address($mem$$Register), $res$$Register /* ref */, rscratch1 /* tmp */);
--
2.37.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。