Skip to content

Commit 71f3c2f

Browse files
authored
Update (2023.08.02)
23520: 8311631: When multiple users run tools/jpackage/share/LicenseTest.java, Permission denied for writing /var/tmp/*.files 11541: Prevent load reorder of VarHandle::getOpaque 31269: Ordering memory barriers testcases 31601: revert some copyright update by loongson
1 parent 7c69468 commit 71f3c2f

File tree

18 files changed

+875
-33
lines changed

18 files changed

+875
-33
lines changed

src/hotspot/cpu/loongarch/loongarch_64.ad

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6396,6 +6396,17 @@ instruct membar_storestore() %{
63966396
ins_pipe( pipe_serial );
63976397
%}
63986398

6399+
instruct same_addr_load_fence() %{
6400+
match(SameAddrLoadFence);
6401+
ins_cost(400);
6402+
6403+
format %{ "MEMBAR @ same_addr_load_fence" %}
6404+
ins_encode %{
6405+
__ dbar(0x700);
6406+
%}
6407+
ins_pipe( pipe_serial );
6408+
%}
6409+
63996410
//----------Move Instructions--------------------------------------------------
64006411
instruct castX2P(mRegP dst, mRegL src) %{
64016412
match(Set dst (CastX2P src));

src/hotspot/share/adlc/formssel.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*
2323
*/
2424

25+
/*
26+
* This file has been modified by Loongson Technology in 2023, These
27+
* modifications are Copyright (c) 2023, Loongson Technology, and are made
28+
* available on the same license terms set forth above.
29+
*/
30+
2531
// FORMS.CPP - Definitions for ADL Parser Forms Classes
2632
#include "adlc.hpp"
2733

@@ -4144,6 +4150,7 @@ bool MatchRule::is_ideal_membar() const {
41444150
!strcmp(_opType,"MemBarVolatile") ||
41454151
!strcmp(_opType,"MemBarCPUOrder") ||
41464152
!strcmp(_opType,"MemBarStoreStore") ||
4153+
!strcmp(_opType,"SameAddrLoadFence" ) ||
41474154
!strcmp(_opType,"OnSpinWait");
41484155
}
41494156

src/hotspot/share/gc/shared/c2/barrierSetC2.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*
2323
*/
2424

25+
/*
26+
* This file has been modified by Loongson Technology in 2023, These
27+
* modifications are Copyright (c) 2023, Loongson Technology, and are made
28+
* available on the same license terms set forth above.
29+
*/
30+
2531
#include "precompiled.hpp"
2632
#include "gc/shared/tlab_globals.hpp"
2733
#include "gc/shared/c2/barrierSetC2.hpp"
@@ -263,6 +269,8 @@ class C2AccessFence: public StackObj {
263269

264270
bool is_volatile = (decorators & MO_SEQ_CST) != 0;
265271
bool is_acquire = (decorators & MO_ACQUIRE) != 0;
272+
bool is_relaxed = (decorators & MO_RELAXED) != 0;
273+
bool is_unsafe = (decorators & C2_UNSAFE_ACCESS) != 0;
266274

267275
// If reference is volatile, prevent following volatiles ops from
268276
// floating up before the volatile access.
@@ -296,6 +304,13 @@ class C2AccessFence: public StackObj {
296304
assert(_leading_membar == nullptr || support_IRIW_for_not_multiple_copy_atomic_cpu, "no leading membar expected");
297305
Node* mb = kit->insert_mem_bar(Op_MemBarAcquire, n);
298306
mb->as_MemBar()->set_trailing_load();
307+
} else if (is_relaxed && is_unsafe) {
308+
#ifdef LOONGARCH64
309+
assert(kit != nullptr, "unsupported at optimization time");
310+
Node* n = _access.raw_access();
311+
Node* mb = kit->insert_mem_bar(Op_SameAddrLoadFence, n);
312+
mb->as_MemBar()->set_trailing_load();
313+
#endif
299314
}
300315
}
301316
}

src/hotspot/share/opto/classes.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*
2323
*/
2424

25+
/*
26+
* This file has been modified by Loongson Technology in 2023, These
27+
* modifications are Copyright (c) 2023, Loongson Technology, and are made
28+
* available on the same license terms set forth above.
29+
*/
30+
2531
#include "utilities/macros.hpp"
2632

2733
// The giant table of Node classes.
@@ -233,6 +239,7 @@ macro(StoreStoreFence)
233239
macro(MemBarReleaseLock)
234240
macro(MemBarVolatile)
235241
macro(MemBarStoreStore)
242+
macro(SameAddrLoadFence)
236243
macro(MergeMem)
237244
macro(MinI)
238245
macro(MinL)

src/hotspot/share/opto/compile.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*
2323
*/
2424

25+
/*
26+
* This file has been modified by Loongson Technology in 2023, These
27+
* modifications are Copyright (c) 2023, Loongson Technology, and are made
28+
* available on the same license terms set forth above.
29+
*/
30+
2531
#include "precompiled.hpp"
2632
#include "asm/macroAssembler.hpp"
2733
#include "asm/macroAssembler.inline.hpp"
@@ -3743,6 +3749,7 @@ void Compile::final_graph_reshaping_main_switch(Node* n, Final_Reshape_Counts& f
37433749
n->set_req(MemBarNode::Precedent, top());
37443750
}
37453751
break;
3752+
case Op_SameAddrLoadFence:
37463753
case Op_MemBarAcquire: {
37473754
if (n->as_MemBar()->trailing_load() && n->req() > MemBarNode::Precedent) {
37483755
// At parse time, the trailing MemBarAcquire for a volatile load

src/hotspot/share/opto/memnode.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*
2323
*/
2424

25+
/*
26+
* This file has been modified by Loongson Technology in 2023, These
27+
* modifications are Copyright (c) 2023, Loongson Technology, and are made
28+
* available on the same license terms set forth above.
29+
*/
30+
2531
#include "precompiled.hpp"
2632
#include "classfile/javaClasses.hpp"
2733
#include "compiler/compileLog.hpp"
@@ -3288,6 +3294,7 @@ MemBarNode* MemBarNode::make(Compile* C, int opcode, int atp, Node* pn) {
32883294
case Op_MemBarReleaseLock: return new MemBarReleaseLockNode(C, atp, pn);
32893295
case Op_MemBarVolatile: return new MemBarVolatileNode(C, atp, pn);
32903296
case Op_MemBarCPUOrder: return new MemBarCPUOrderNode(C, atp, pn);
3297+
case Op_SameAddrLoadFence: return new SameAddrLoadFenceNode(C, atp, pn);
32913298
case Op_OnSpinWait: return new OnSpinWaitNode(C, atp, pn);
32923299
case Op_Initialize: return new InitializeNode(C, atp, pn);
32933300
default: ShouldNotReachHere(); return nullptr;

src/hotspot/share/opto/memnode.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*
2323
*/
2424

25+
/*
26+
* This file has been modified by Loongson Technology in 2023, These
27+
* modifications are Copyright (c) 2023, Loongson Technology, and are made
28+
* available on the same license terms set forth above.
29+
*/
30+
2531
#ifndef SHARE_OPTO_MEMNODE_HPP
2632
#define SHARE_OPTO_MEMNODE_HPP
2733

@@ -1289,6 +1295,14 @@ class MemBarCPUOrderNode: public MemBarNode {
12891295
virtual uint ideal_reg() const { return 0; } // not matched in the AD file
12901296
};
12911297

1298+
// Used to prevent LoadLoad reorder for same address.
1299+
class SameAddrLoadFenceNode: public MemBarNode {
1300+
public:
1301+
SameAddrLoadFenceNode(Compile* C, int alias_idx, Node* precedent)
1302+
: MemBarNode(C, alias_idx, precedent) {}
1303+
virtual int Opcode() const;
1304+
};
1305+
12921306
class OnSpinWaitNode: public MemBarNode {
12931307
public:
12941308
OnSpinWaitNode(Compile* C, int alias_idx, Node* precedent)

src/hotspot/share/runtime/vmStructs.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
*
2323
*/
2424

25+
/*
26+
* This file has been modified by Loongson Technology in 2023, These
27+
* modifications are Copyright (c) 2023, Loongson Technology, and are made
28+
* available on the same license terms set forth above.
29+
*/
30+
2531
#include "precompiled.hpp"
2632
#include "cds/filemap.hpp"
2733
#include "ci/ciField.hpp"
@@ -1500,6 +1506,7 @@
15001506
declare_c2_type(StoreFenceNode, MemBarNode) \
15011507
declare_c2_type(MemBarVolatileNode, MemBarNode) \
15021508
declare_c2_type(MemBarCPUOrderNode, MemBarNode) \
1509+
declare_c2_type(SameAddrLoadFenceNode, MemBarNode) \
15031510
declare_c2_type(OnSpinWaitNode, MemBarNode) \
15041511
declare_c2_type(BlackholeNode, MultiNode) \
15051512
declare_c2_type(InitializeNode, MemBarNode) \

src/java.base/share/classes/jdk/internal/util/Architecture.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
24-
/*
25-
* This file has been modified by Loongson Technology in 2023. These
26-
* modifications are Copyright (c) 2023, Loongson Technology, and are made
27-
* available on the same license terms set forth above.
28-
*
29-
*/
30-
3123
package jdk.internal.util;
3224

3325
import jdk.internal.vm.annotation.ForceInline;

src/java.base/share/classes/jdk/internal/util/PlatformProps.java.template

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@
2020
* or visit www.oracle.com if you need additional information or have any
2121
* questions.
2222
*/
23-
24-
/*
25-
* This file has been modified by Loongson Technology in 2023. These
26-
* modifications are Copyright (c) 2023, Loongson Technology, and are made
27-
* available on the same license terms set forth above.
28-
*
29-
*/
30-
3123
package jdk.internal.util;
3224

3325
/**

0 commit comments

Comments
 (0)