Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.
/ lanai Public archive

Commit

Permalink
8248388: ZGC: Load barrier incorrectly elided in jdk/java/text/Format…
Browse files Browse the repository at this point in the history
…/DateFormat/SDFTCKZoneNamesTest.java

Reviewed-by: kvn, thartmann
  • Loading branch information
Nils Eliasson committed Jul 3, 2020
1 parent 5a90271 commit 9993572
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/hotspot/share/opto/arraycopynode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ class ArrayCopyNode : public CallNode {
bool finish_transform(PhaseGVN *phase, bool can_reshape,
Node* ctl, Node *mem);
static bool may_modify_helper(const TypeOopPtr *t_oop, Node* n, PhaseTransform *phase, CallNode*& call);

public:
static Node* load(BarrierSetC2* bs, PhaseGVN *phase, Node*& ctl, MergeMemNode* mem, Node* addr, const TypePtr* adr_type, const Type *type, BasicType bt);
private:
void store(BarrierSetC2* bs, PhaseGVN *phase, Node*& ctl, MergeMemNode* mem, Node* addr, const TypePtr* adr_type, Node* val, const Type *type, BasicType bt);

public:
Expand Down Expand Up @@ -153,7 +154,7 @@ class ArrayCopyNode : public CallNode {
bool is_clone_array() const { assert(_kind != None, "should bet set"); return _kind == CloneArray; }
// is_clone_oop_array is used when oop arrays need GC barriers
bool is_clone_oop_array() const { assert(_kind != None, "should bet set"); return _kind == CloneOopArray; }
// is_clonebasic - is true for any type of clone that doesn't need a barrier.
// is_clonebasic - is true for any type of clone that doesn't need a writebarrier.
bool is_clonebasic() const { assert(_kind != None, "should bet set"); return _kind == CloneInst || _kind == CloneArray; }
bool is_copyof() const { assert(_kind != None, "should bet set"); return _kind == CopyOf; }
bool is_copyof_validated() const { assert(_kind != None, "should bet set"); return _kind == CopyOf && _arguments_validated; }
Expand Down
9 changes: 6 additions & 3 deletions src/hotspot/share/opto/macro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,9 @@ Node* PhaseMacroExpand::make_arraycopy_load(ArrayCopyNode* ac, intptr_t offset,
Node* base = ac->in(ArrayCopyNode::Src);
Node* adr = _igvn.transform(new AddPNode(base, base, MakeConX(offset)));
const TypePtr* adr_type = _igvn.type(base)->is_ptr()->add_offset(offset);
res = LoadNode::make(_igvn, ctl, mem, adr, adr_type, type, bt, MemNode::unordered, LoadNode::UnknownControl);
MergeMemNode* mergemen = MergeMemNode::make(mem);
BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
res = ArrayCopyNode::load(bs, &_igvn, ctl, mergemen, adr, adr_type, type, bt);
} else {
if (ac->modifies(offset, offset, &_igvn, true)) {
assert(ac->in(ArrayCopyNode::Dest) == alloc->result_cast(), "arraycopy destination should be allocation's result");
Expand Down Expand Up @@ -405,11 +407,12 @@ Node* PhaseMacroExpand::make_arraycopy_load(ArrayCopyNode* ac, intptr_t offset,
return NULL;
}
}
res = LoadNode::make(_igvn, ctl, mem, adr, adr_type, type, bt, MemNode::unordered, LoadNode::UnknownControl);
MergeMemNode* mergemen = MergeMemNode::make(mem);
BarrierSetC2* bs = BarrierSet::barrier_set()->barrier_set_c2();
res = ArrayCopyNode::load(bs, &_igvn, ctl, mergemen, adr, adr_type, type, bt);
}
}
if (res != NULL) {
res = _igvn.transform(res);
if (ftype->isa_narrowoop()) {
// PhaseMacroExpand::scalar_replacement adds DecodeN nodes
res = _igvn.transform(new EncodePNode(res, ftype));
Expand Down

0 comments on commit 9993572

Please sign in to comment.