@@ -2054,11 +2054,11 @@ const bool Matcher::match_rule_supported(int opcode) {
20542054 return (UsePopCountInstruction && VM_Version::has_popcntw());
20552055
20562056 case Op_StrComp:
2057- return SpecialStringCompareTo;
2057+ return SpecialStringCompareTo && !CompactStrings ;
20582058 case Op_StrEquals:
2059- return SpecialStringEquals;
2059+ return SpecialStringEquals && !CompactStrings ;
20602060 case Op_StrIndexOf:
2061- return SpecialStringIndexOf;
2061+ return SpecialStringIndexOf && !CompactStrings ;
20622062 }
20632063
20642064 return true; // Per default match rules are supported.
@@ -11077,7 +11077,7 @@ instruct string_indexOf_imm1_char(iRegIdst result, iRegPsrc haystack, iRegIsrc h
1107711077 immP needleImm, immL offsetImm, immI_1 needlecntImm,
1107811078 iRegIdst tmp1, iRegIdst tmp2,
1107911079 flagsRegCR0 cr0, flagsRegCR1 cr1) %{
11080- predicate(SpecialStringIndexOf); // type check implicit by parameter type, See Matcher::match_rule_supported
11080+ predicate(SpecialStringIndexOf && !CompactStrings ); // type check implicit by parameter type, See Matcher::match_rule_supported
1108111081 match(Set result (StrIndexOf (Binary haystack haycnt) (Binary (AddP needleImm offsetImm) needlecntImm)));
1108211082
1108311083 effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, KILL cr0, KILL cr1);
@@ -11120,7 +11120,7 @@ instruct string_indexOf_imm1(iRegIdst result, iRegPsrc haystack, iRegIsrc haycnt
1112011120 effect(USE_KILL needle, /* TDEF needle, */ TEMP_DEF result,
1112111121 TEMP tmp1, TEMP tmp2);
1112211122 // Required for EA: check if it is still a type_array.
11123- predicate(SpecialStringIndexOf && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
11123+ predicate(SpecialStringIndexOf && !CompactStrings && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
1112411124 n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array());
1112511125 ins_cost(180);
1112611126
@@ -11167,7 +11167,7 @@ instruct string_indexOf_imm(iRegIdst result, iRegPsrc haystack, rscratch1RegI ha
1116711167 effect(USE_KILL haycnt, /* better: TDEF haycnt, */ TEMP_DEF result,
1116811168 TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, KILL cr0, KILL cr1, KILL cr6);
1116911169 // Required for EA: check if it is still a type_array.
11170- predicate(SpecialStringIndexOf && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
11170+ predicate(SpecialStringIndexOf && !CompactStrings && n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop() &&
1117111171 n->in(3)->in(1)->bottom_type()->is_aryptr()->const_oop()->is_type_array());
1117211172 ins_cost(250);
1117311173
@@ -11200,7 +11200,7 @@ instruct string_indexOf(iRegIdst result, iRegPsrc haystack, rscratch1RegI haycnt
1120011200 effect(USE_KILL haycnt, USE_KILL needlecnt, /*better: TDEF haycnt, TDEF needlecnt,*/
1120111201 TEMP_DEF result,
1120211202 TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr0, KILL cr1, KILL cr6);
11203- predicate(SpecialStringIndexOf); // See Matcher::match_rule_supported.
11203+ predicate(SpecialStringIndexOf && !CompactStrings ); // See Matcher::match_rule_supported.
1120411204 ins_cost(300);
1120511205
1120611206 ins_alignment(8); // 'compute_padding()' gets called, up to this number-1 nops will get inserted.
@@ -11224,7 +11224,7 @@ instruct string_equals_imm(iRegPsrc str1, iRegPsrc str2, uimmI15 cntImm, iRegIds
1122411224 match(Set result (StrEquals (Binary str1 str2) cntImm));
1122511225 effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2,
1122611226 KILL cr0, KILL cr6, KILL ctr);
11227- predicate(SpecialStringEquals); // See Matcher::match_rule_supported.
11227+ predicate(SpecialStringEquals && !CompactStrings ); // See Matcher::match_rule_supported.
1122811228 ins_cost(250);
1122911229
1123011230 ins_alignment(8); // 'compute_padding()' gets called, up to this number-1 nops will get inserted.
@@ -11247,7 +11247,7 @@ instruct string_equals(iRegPsrc str1, iRegPsrc str2, iRegIsrc cnt, iRegIdst resu
1124711247 match(Set result (StrEquals (Binary str1 str2) cnt));
1124811248 effect(TEMP_DEF result, TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5,
1124911249 KILL cr0, KILL cr1, KILL cr6, KILL ctr);
11250- predicate(SpecialStringEquals); // See Matcher::match_rule_supported.
11250+ predicate(SpecialStringEquals && !CompactStrings ); // See Matcher::match_rule_supported.
1125111251 ins_cost(300);
1125211252
1125311253 ins_alignment(8); // 'compute_padding()' gets called, up to this number-1 nops will get inserted.
@@ -11267,6 +11267,7 @@ instruct string_equals(iRegPsrc str1, iRegPsrc str2, iRegIsrc cnt, iRegIdst resu
1126711267// Use dst register classes if register gets killed, as it is the case for TEMP operands!
1126811268instruct string_compare(rarg1RegP str1, rarg2RegP str2, rarg3RegI cnt1, rarg4RegI cnt2, iRegIdst result,
1126911269 iRegPdst tmp, flagsRegCR0 cr0, regCTR ctr) %{
11270+ predicate(!CompactStrings);
1127011271 match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2)));
1127111272 effect(USE_KILL cnt1, USE_KILL cnt2, USE_KILL str1, USE_KILL str2, TEMP_DEF result, TEMP tmp, KILL cr0, KILL ctr);
1127211273 ins_cost(300);
0 commit comments