@@ -164,27 +164,16 @@ protected boolean notComparable(
164
164
}
165
165
166
166
@ ImportStatic (StringGuards .class )
167
- public abstract static class StringCountStringsNode extends CoreMethodArrayArgumentsNode {
167
+ public abstract static class CountStringsNode extends TrTableNode {
168
168
169
+ public abstract int execute (Object string , TStringWithEncoding [] tstringsWithEncs );
169
170
170
171
@ Specialization (guards = "libString.getTString(string).isEmpty()" , limit = "1" )
171
- protected int count (Object string , Object [] args ,
172
- @ Cached RubyStringLibrary libString ) {
172
+ protected int count (Object string , TStringWithEncoding [] args ,
173
+ @ Cached @ Shared RubyStringLibrary libString ) {
173
174
return 0 ;
174
175
}
175
176
176
- @ Specialization
177
- protected int countStrings (Object string , TStringWithEncoding [] args ,
178
- @ Cached CountStringsNode countStringsNode ) {
179
- return countStringsNode .execute (string , args );
180
- }
181
- }
182
-
183
- @ ImportStatic (StringGuards .class )
184
- public abstract static class CountStringsNode extends TrTableNode {
185
-
186
- public abstract int execute (Object string , TStringWithEncoding [] tstringsWithEncs );
187
-
188
177
@ Specialization (
189
178
guards = {
190
179
"cachedArgs.length > 0" ,
@@ -299,22 +288,6 @@ protected boolean argsMatch(TStringWithEncoding[] cachedStrings, TStringWithEnco
299
288
}
300
289
}
301
290
302
- @ ImportStatic (StringGuards .class )
303
- public abstract static class StringDeleteBangStringsNode extends CoreMethodArrayArgumentsNode {
304
-
305
- @ Specialization (guards = "string.tstring.isEmpty()" )
306
- protected Object deleteBangEmpty (RubyString string , Object [] args ) {
307
- return nil ;
308
- }
309
-
310
- @ Specialization
311
- protected static Object deleteBangString (RubyString string , TStringWithEncoding [] args ,
312
- @ Cached DeleteBangStringsNode deleteBangStringsNode ,
313
- @ Bind ("this" ) Node node ) {
314
- return deleteBangStringsNode .execute (node , string , args );
315
- }
316
- }
317
-
318
291
319
292
@ ImportStatic (StringGuards .class )
320
293
@ GenerateCached (false )
@@ -323,6 +296,11 @@ public abstract static class DeleteBangStringsNode extends TrTableNode {
323
296
324
297
public abstract Object execute (Node node , RubyString string , TStringWithEncoding [] tstringsWithEncs );
325
298
299
+ @ Specialization (guards = "string.tstring.isEmpty()" )
300
+ protected Object deleteBangEmpty (RubyString string , TStringWithEncoding [] args ) {
301
+ return nil ;
302
+ }
303
+
326
304
@ Specialization (
327
305
guards = {
328
306
"cachedArgs.length > 0" ,
0 commit comments