@@ -67,20 +67,8 @@ public abstract class EncodingNodes {
67
67
68
68
@ CoreMethod (names = "ascii_compatible?" )
69
69
public abstract static class AsciiCompatibleNode extends CoreMethodArrayArgumentsNode {
70
-
71
- @ Specialization (guards = "encoding == cachedEncoding" , limit = "getIdentityCacheLimit()" )
72
- protected boolean isAsciiCompatibleCached (RubyEncoding encoding ,
73
- @ Cached ("encoding" ) RubyEncoding cachedEncoding ,
74
- @ Cached ("isAsciiCompatible(cachedEncoding)" ) boolean isAsciiCompatible ) {
75
- return isAsciiCompatible ;
76
- }
77
-
78
- @ Specialization (replaces = "isAsciiCompatibleCached" )
79
- protected boolean isAsciiCompatibleUncached (RubyEncoding encoding ) {
80
- return isAsciiCompatible (encoding );
81
- }
82
-
83
- protected static boolean isAsciiCompatible (RubyEncoding encoding ) {
70
+ @ Specialization
71
+ protected boolean isAsciiCompatible (RubyEncoding encoding ) {
84
72
return encoding .encoding .isAsciiCompatible ();
85
73
}
86
74
}
@@ -432,29 +420,18 @@ protected ImmutableRubyString localeCharacterMap(
432
420
433
421
@ CoreMethod (names = "dummy?" )
434
422
public abstract static class DummyNode extends CoreMethodArrayArgumentsNode {
435
-
436
- @ Specialization (guards = "encoding == cachedEncoding" , limit = "getIdentityCacheLimit()" )
437
- protected boolean isDummyCached (RubyEncoding encoding ,
438
- @ Cached ("encoding" ) RubyEncoding cachedEncoding ,
439
- @ Cached ("isDummyUncached(cachedEncoding)" ) boolean isDummy ) {
440
- return isDummy ;
441
- }
442
-
443
- @ Specialization (replaces = "isDummyCached" )
444
- protected boolean isDummyUncached (RubyEncoding encoding ) {
423
+ @ Specialization
424
+ protected boolean isDummy (RubyEncoding encoding ) {
445
425
return encoding .encoding .isDummy ();
446
426
}
447
-
448
427
}
449
428
450
429
@ CoreMethod (names = { "name" , "to_s" })
451
430
public abstract static class ToSNode extends CoreMethodArrayArgumentsNode {
452
-
453
431
@ Specialization
454
432
protected ImmutableRubyString toS (RubyEncoding encoding ) {
455
433
return encoding .name ;
456
434
}
457
-
458
435
}
459
436
460
437
@ CoreMethod (names = { "__allocate__" , "__layout_allocate__" }, constructor = true , visibility = Visibility .PRIVATE )
@@ -491,12 +468,10 @@ protected Object eachAlias(RubyProc block) {
491
468
492
469
@ Primitive (name = "encoding_is_unicode" )
493
470
public abstract static class IsUnicodeNode extends PrimitiveArrayArgumentsNode {
494
-
495
471
@ Specialization
496
472
protected boolean isUnicode (RubyEncoding encoding ) {
497
473
return encoding .encoding .isUnicode ();
498
474
}
499
-
500
475
}
501
476
502
477
@ Primitive (name = "get_actual_encoding" )
@@ -756,22 +731,18 @@ private RubyEncoding createDummy(String name) {
756
731
757
732
@ Primitive (name = "encoding_get_encoding_by_index" , lowerFixnum = 0 )
758
733
public static abstract class GetEncodingObjectByIndexNode extends PrimitiveArrayArgumentsNode {
759
-
760
734
@ Specialization
761
735
protected RubyEncoding getEncoding (int index ) {
762
736
return getContext ().getEncodingManager ().getRubyEncoding (index );
763
737
}
764
-
765
738
}
766
739
767
740
@ Primitive (name = "encoding_get_encoding_index" )
768
741
public static abstract class GetEncodingIndexNode extends PrimitiveArrayArgumentsNode {
769
-
770
742
@ Specialization
771
743
protected int getIndex (RubyEncoding encoding ) {
772
744
return encoding .encoding .getIndex ();
773
745
}
774
-
775
746
}
776
747
777
748
public static abstract class CheckRopeEncodingNode extends RubyContextNode {
0 commit comments