Skip to content

Commit bd83315

Browse files
committed
hotspot: fix intrinsic String.indexOfChar
1 parent e09b117 commit bd83315

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/hotspot/share/opto/library_call.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ Node* LibraryCallKit::make_string_method_node(int opcode, Node* str1_start, Node
10061006
str1_start, cnt1, str2_start, cnt2, ae);
10071007
#endif
10081008
break;
1009+
// corresponds to inline_string_equals, which is not enabled
10091010
case Op_StrEquals:
10101011
// We already know that cnt1 == cnt2 here (checked in 'inline_string_equals').
10111012
// Use the constant length if there is one because optimized match rule may exist.
@@ -1396,7 +1397,11 @@ bool LibraryCallKit::inline_string_indexOfChar(StrIntrinsicNode::ArgEnc ae) {
13961397
RegionNode* region = new RegionNode(3);
13971398
Node* phi = new PhiNode(region, TypeInt::INT);
13981399

1400+
#if HOTSPOT_TARGET_CLASSLIB == 8
1401+
Node* result = new StrIndexOfCharNode(control(), memory(TypeAryPtr::CHARS), src_start, src_count, int_ch, ae);
1402+
#else
13991403
Node* result = new StrIndexOfCharNode(control(), memory(TypeAryPtr::BYTES), src_start, src_count, int_ch, ae);
1404+
#endif
14001405
C->set_has_split_ifs(true); // Has chance for split-if optimization
14011406
_gvn.transform(result);
14021407

0 commit comments

Comments
 (0)