Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8248388: ZGC: Load barrier incorrectly elided in jdk/java/text/Format…
…/DateFormat/SDFTCKZoneNamesTest.java

Reviewed-by: kvn, thartmann
  • Loading branch information
Nils Eliasson committed Jul 3, 2020
1 parent 5a90271 commit 999357250a023f5280ec47c153596f4ac8be570a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
@@ -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:
@@ -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; }
@@ -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");
@@ -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));

0 comments on commit 9993572

Please sign in to comment.