Skip to content

Commit 60af17f

Browse files
committed
8369805: [lworld] C2: assert(is_InlineType()) failed: invalid node class: Con
Reviewed-by: thartmann
1 parent 412ec88 commit 60af17f

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/hotspot/share/opto/inlinetypenode.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,19 @@ bool InlineTypeNode::has_phi_inputs(Node* region) {
124124
}
125125

126126
// Merges 'this' with 'other' by updating the input PhiNodes added by 'clone_with_phis'
127-
InlineTypeNode* InlineTypeNode::merge_with(PhaseGVN* gvn, const InlineTypeNode* other, int pnum, bool transform) {
127+
InlineTypeNode* InlineTypeNode::merge_with(PhaseGVN* gvn, const InlineTypeNode* other, int phi_index, bool transform) {
128128
assert(inline_klass() == other->inline_klass(), "Merging incompatible types");
129129

130130
// Merge oop inputs
131131
PhiNode* phi = get_oop()->as_Phi();
132-
phi->set_req(pnum, other->get_oop());
132+
phi->set_req(phi_index, other->get_oop());
133133
if (transform) {
134134
set_oop(*gvn, gvn->transform(phi));
135135
}
136136

137137
// Merge is_buffered inputs
138138
phi = get_is_buffered()->as_Phi();
139-
phi->set_req(pnum, other->get_is_buffered());
139+
phi->set_req(phi_index, other->get_is_buffered());
140140
if (transform) {
141141
set_req(IsBuffered, gvn->transform(phi));
142142
}
@@ -145,7 +145,7 @@ InlineTypeNode* InlineTypeNode::merge_with(PhaseGVN* gvn, const InlineTypeNode*
145145
Node* null_marker = get_null_marker();
146146
if (null_marker->is_Phi()) {
147147
phi = null_marker->as_Phi();
148-
phi->set_req(pnum, other->get_null_marker());
148+
phi->set_req(phi_index, other->get_null_marker());
149149
if (transform) {
150150
set_req(NullMarker, gvn->transform(phi));
151151
}
@@ -161,10 +161,15 @@ InlineTypeNode* InlineTypeNode::merge_with(PhaseGVN* gvn, const InlineTypeNode*
161161
if (val2->is_Phi()) {
162162
val2 = gvn->transform(val2);
163163
}
164-
val1->as_InlineType()->merge_with(gvn, val2->as_InlineType(), pnum, transform);
164+
if (val2->is_top()) {
165+
// The path where 'other' is used is dying. Therefore, we do not need to process the merge with 'other' further.
166+
// The phi inputs of 'this' at 'phi_index' will eventually be removed.
167+
break;
168+
}
169+
val1->as_InlineType()->merge_with(gvn, val2->as_InlineType(), phi_index, transform);
165170
} else {
166171
assert(val1->is_Phi(), "must be a phi node");
167-
val1->set_req(pnum, val2);
172+
val1->set_req(phi_index, val2);
168173
}
169174
if (transform) {
170175
set_field_value(i, gvn->transform(val1));

src/hotspot/share/opto/inlinetypenode.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class InlineTypeNode : public TypeNode {
101101
// Support for control flow merges
102102
bool has_phi_inputs(Node* region);
103103
InlineTypeNode* clone_with_phis(PhaseGVN* gvn, Node* region, SafePointNode* map = nullptr, bool is_non_null = false, bool init_with_top = false);
104-
InlineTypeNode* merge_with(PhaseGVN* gvn, const InlineTypeNode* other, int pnum, bool transform);
104+
InlineTypeNode* merge_with(PhaseGVN* gvn, const InlineTypeNode* other, int phi_index, bool transform);
105105
void add_new_path(Node* region);
106106

107107
// Get oop for heap allocated inline type (may be TypePtr::NULL_PTR)

0 commit comments

Comments
 (0)