Skip to content

Commit

Permalink
JVM-2568: compilation of Nodes::flatten in ForkJoin framework. (#88)
Browse files Browse the repository at this point in the history
This patch fixed a bug for loop. PEA marks live objects 'Escaped' at
loop headers right before Parse mounts phi nodes.

The bug is introduced in the refactor of alias. We skipped aliasing the
trivial phi with its single input.

Co-authored-by: Xin Liu <xxinliu@amazon.com>
  • Loading branch information
navyxliu and Xin Liu authored Jan 12, 2024
1 parent 168e5ce commit ca21bf0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/hotspot/share/opto/parse1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,11 @@ void Parse::do_all_blocks() {

progress = true;
if (block->is_loop_head() || block->is_handler() || (has_irreducible && !block->is_ready())) {
// mark live objects 'Escaped' in map before mounting phi nodes.
if (DoPartialEscapeAnalysis && block->is_loop_head()) {
PEAState& as = jvms()->alloc_state();
as.mark_all_live_objects_escaped(PEA(), map());
}
// Not all preds have been parsed. We must build phis everywhere.
// (Note that dead locals do not get phis built, ever.)
ensure_phis_everywhere();
Expand Down Expand Up @@ -734,11 +739,6 @@ void Parse::do_all_blocks() {

// Leave behind an undisturbed copy of the map, for future merges.
set_map(clone_map());

if (DoPartialEscapeAnalysis && block->is_loop_head()) {
PEAState& as = jvms()->alloc_state();
as.mark_all_live_objects_escaped(PEA(), block->start_map());
}
}

if (control()->is_Region() && !block->is_loop_head() && !has_irreducible && !block->is_handler()) {
Expand Down

0 comments on commit ca21bf0

Please sign in to comment.