Skip to content

Commit

Permalink
8287227: Shenandoah: A couple of virtual thread tests failed with iu …
Browse files Browse the repository at this point in the history
…mode even without Loom enabled.

Backport-of: 210a06a287521a554316a9052bd9fdf616c7b884
  • Loading branch information
William Kemper authored and shipilev committed Jun 24, 2023
1 parent b8a65e0 commit 5021a07
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp
Expand Up @@ -1334,6 +1334,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
Node* orig_ctrl = ctrl;

Node* raw_mem = fixer.find_mem(ctrl, lrb);
Node* raw_mem_for_ctrl = fixer.find_mem(ctrl, NULL);

IdealLoopTree *loop = phase->get_loop(ctrl);

Expand Down Expand Up @@ -1435,6 +1436,7 @@ void ShenandoahBarrierC2Support::pin_and_expand(PhaseIdealLoop* phase) {
phase->set_ctrl(n, region);
follow_barrier_uses(n, ctrl, uses, phase);
}
fixer.record_new_ctrl(ctrl, region, raw_mem, raw_mem_for_ctrl);
}
// Done expanding load-reference-barriers.
assert(ShenandoahBarrierSetC2::bsc2()->state()->load_reference_barriers_count() == 0, "all load reference barrier nodes should have been replaced");
Expand Down Expand Up @@ -2670,6 +2672,13 @@ void MemoryGraphFixer::fix_mem(Node* ctrl, Node* new_ctrl, Node* mem, Node* mem_
#endif
}

void MemoryGraphFixer::record_new_ctrl(Node* ctrl, Node* new_ctrl, Node* mem, Node* mem_for_ctrl) {
if (mem_for_ctrl != mem && new_ctrl != ctrl) {
_memory_nodes.map(ctrl->_idx, mem);
_memory_nodes.map(new_ctrl->_idx, mem_for_ctrl);
}
}

MergeMemNode* MemoryGraphFixer::allocate_merge_mem(Node* mem, Node* rep_proj, Node* rep_ctrl) const {
MergeMemNode* mm = MergeMemNode::make(mem);
mm->set_memory_at(_alias, rep_proj);
Expand Down
2 changes: 2 additions & 0 deletions src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.hpp
Expand Up @@ -132,6 +132,8 @@ class MemoryGraphFixer : public ResourceObj {
int alias() const { return _alias; }

Node* collect_memory_for_infinite_loop(const Node* in);

void record_new_ctrl(Node* ctrl, Node* region, Node* mem, Node* mem_for_ctrl);
};

class ShenandoahCompareAndSwapPNode : public CompareAndSwapPNode {
Expand Down

1 comment on commit 5021a07

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.