@@ -642,9 +642,9 @@ protected int codeToMbcLen(int code, RubyEncoding encoding) {
642
642
@ CoreMethod (names = "rb_enc_codepoint_len" , onSingleton = true , required = 1 )
643
643
public abstract static class RbEncCodePointLenNode extends CoreMethodArrayArgumentsNode {
644
644
645
- @ Specialization (guards = "strings.isRubyString(string)" )
645
+ @ Specialization (guards = "strings.isRubyString(string)" , limit = "1" )
646
646
protected RubyArray rbEncCodePointLen (Object string ,
647
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary strings ,
647
+ @ Cached RubyStringLibrary strings ,
648
648
@ Cached TruffleString .ByteLengthOfCodePointNode byteLengthOfCodePointNode ,
649
649
@ Cached TruffleString .CodePointAtByteIndexNode codePointAtByteIndexNode ,
650
650
@ Cached BranchProfile errorProfile ) {
@@ -730,7 +730,7 @@ public abstract static class RbStrSetLenNode extends CoreMethodArrayArgumentsNod
730
730
731
731
@ Specialization
732
732
protected RubyString strSetLen (RubyString string , int newByteLength ,
733
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary libString ,
733
+ @ Cached RubyStringLibrary libString ,
734
734
@ Cached StringToNativeNode stringToNativeNode ,
735
735
@ Cached MutableTruffleString .FromNativePointerNode fromNativePointerNode ) {
736
736
var pointer = stringToNativeNode .executeToNative (string );
@@ -750,7 +750,7 @@ public abstract static class RbStrResizeNode extends CoreMethodArrayArgumentsNod
750
750
751
751
@ Specialization
752
752
protected RubyString rbStrResize (RubyString string , int newByteLength ,
753
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary libString ,
753
+ @ Cached RubyStringLibrary libString ,
754
754
@ Cached StringToNativeNode stringToNativeNode ,
755
755
@ Cached MutableTruffleString .FromNativePointerNode fromNativePointerNode ) {
756
756
var pointer = stringToNativeNode .executeToNative (string );
@@ -779,7 +779,7 @@ public abstract static class TrStrCapaResizeNode extends CoreMethodArrayArgument
779
779
780
780
@ Specialization
781
781
protected RubyString trStrCapaResize (RubyString string , int newCapacity ,
782
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary libString ,
782
+ @ Cached RubyStringLibrary libString ,
783
783
@ Cached StringToNativeNode stringToNativeNode ,
784
784
@ Cached MutableTruffleString .FromNativePointerNode fromNativePointerNode ) {
785
785
var pointer = stringToNativeNode .executeToNative (string );
@@ -1191,7 +1191,7 @@ public static StringToNativeNode create() {
1191
1191
1192
1192
@ Specialization
1193
1193
protected Pointer toNative (RubyString string ,
1194
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary libString ,
1194
+ @ Cached RubyStringLibrary libString ,
1195
1195
@ Cached ConditionProfile convertProfile ,
1196
1196
@ Cached TruffleString .CopyToNativeMemoryNode copyToNativeMemoryNode ,
1197
1197
@ Cached MutableTruffleString .FromNativePointerNode fromNativePointerNode ,
@@ -1382,7 +1382,7 @@ public abstract static class RbTrMbcCaseFoldNode extends CoreMethodArrayArgument
1382
1382
1383
1383
@ Specialization (guards = "strings.isRubyString(string)" , limit = "getCacheLimit()" )
1384
1384
protected Object rbTrEncMbcCaseFold (int flags , Object string , Object advance_p , Object p ,
1385
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary strings ,
1385
+ @ Cached RubyStringLibrary strings ,
1386
1386
@ CachedLibrary ("advance_p" ) InteropLibrary receivers ,
1387
1387
@ Cached TranslateInteropExceptionNode translateInteropExceptionNode ,
1388
1388
@ Cached TruffleString .FromByteArrayNode fromByteArrayNode ,
@@ -1447,9 +1447,9 @@ protected Object rbEncMinLen(RubyEncoding value) {
1447
1447
1448
1448
@ CoreMethod (names = "rb_enc_mbclen" , onSingleton = true , required = 1 )
1449
1449
public abstract static class RbEncMbLenNode extends CoreMethodArrayArgumentsNode {
1450
- @ Specialization (guards = "strings.isRubyString(string)" )
1450
+ @ Specialization (guards = "strings.isRubyString(string)" , limit = "1" )
1451
1451
protected Object rbEncMbLen (Object string ,
1452
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary strings ,
1452
+ @ Cached RubyStringLibrary strings ,
1453
1453
@ Cached TruffleString .ByteLengthOfCodePointNode byteLengthOfCodePointNode ) {
1454
1454
var tstring = strings .getTString (string );
1455
1455
var tencoding = strings .getTEncoding (string );
@@ -1459,9 +1459,9 @@ protected Object rbEncMbLen(Object string,
1459
1459
1460
1460
@ CoreMethod (names = "rb_enc_precise_mbclen" , onSingleton = true , required = 1 )
1461
1461
public abstract static class RbEncPreciseMbclenNode extends CoreMethodArrayArgumentsNode {
1462
- @ Specialization (guards = "strings.isRubyString(string)" )
1462
+ @ Specialization (guards = "strings.isRubyString(string)" , limit = "1" )
1463
1463
protected int rbEncPreciseMbclen (Object string ,
1464
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary strings ,
1464
+ @ Cached RubyStringLibrary strings ,
1465
1465
@ Cached TruffleString .ByteLengthOfCodePointNode byteLengthOfCodePointNode ) {
1466
1466
var tstring = strings .getTString (string );
1467
1467
var tencoding = strings .getTEncoding (string );
@@ -1473,19 +1473,19 @@ protected int rbEncPreciseMbclen(Object string,
1473
1473
public abstract static class RbEncLeftCharHeadNode extends CoreMethodArrayArgumentsNode {
1474
1474
1475
1475
@ TruffleBoundary
1476
- @ Specialization (guards = "strings.isRubyString(string)" )
1476
+ @ Specialization (guards = "strings.isRubyString(string)" , limit = "1" )
1477
1477
protected Object rbEncLeftCharHead (RubyEncoding enc , Object string , int p ,
1478
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary strings ) {
1478
+ @ Cached RubyStringLibrary strings ) {
1479
1479
byte [] bytes = TStringUtils .getBytesOrFail (strings .getTString (string ), strings .getEncoding (string ));
1480
1480
return enc .jcoding .leftAdjustCharHead (bytes , 0 , p , bytes .length );
1481
1481
}
1482
1482
}
1483
1483
1484
1484
@ CoreMethod (names = "rb_enc_mbc_to_codepoint" , onSingleton = true , required = 1 )
1485
1485
public abstract static class RbEncMbcToCodepointNode extends CoreMethodArrayArgumentsNode {
1486
- @ Specialization (guards = "strings.isRubyString(string)" )
1486
+ @ Specialization (guards = "strings.isRubyString(string)" , limit = "1" )
1487
1487
protected int rbEncMbcToCodepoint (Object string ,
1488
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary strings ,
1488
+ @ Cached RubyStringLibrary strings ,
1489
1489
@ Cached TruffleString .CodePointAtByteIndexNode codePointAtByteIndexNode ,
1490
1490
@ Cached TruffleString .GetInternalByteArrayNode byteArrayNode ,
1491
1491
@ Cached ConditionProfile brokenProfile ) {
@@ -1684,9 +1684,9 @@ protected Object wrapFunction() {
1684
1684
1685
1685
@ CoreMethod (names = "rb_check_symbol_cstr" , onSingleton = true , required = 1 )
1686
1686
public abstract static class RbCheckSymbolCStrNode extends CoreMethodArrayArgumentsNode {
1687
- @ Specialization (guards = "strings.isRubyString(string)" )
1687
+ @ Specialization (guards = "strings.isRubyString(string)" , limit = "1" )
1688
1688
protected Object checkSymbolCStr (Object string ,
1689
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary strings ) {
1689
+ @ Cached RubyStringLibrary strings ) {
1690
1690
final RubySymbol sym = getLanguage ().symbolTable .getSymbolIfExists (
1691
1691
strings .getTString (string ),
1692
1692
strings .getEncoding (string ));
@@ -1717,17 +1717,17 @@ public abstract static class RBSprintfFormatNode extends CoreMethodArrayArgument
1717
1717
"equalNode.execute(libFormat, format, cachedFormat, cachedEncoding)" },
1718
1718
limit = "2" )
1719
1719
protected Object typesCached (VirtualFrame frame , Object format ,
1720
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary libFormat ,
1720
+ @ Cached RubyStringLibrary libFormat ,
1721
1721
@ Cached ("asTruffleStringUncached(format)" ) TruffleString cachedFormat ,
1722
1722
@ Cached ("libFormat.getEncoding(format)" ) RubyEncoding cachedEncoding ,
1723
1723
@ Cached ("compileArgTypes(cachedFormat, cachedEncoding, byteArrayNode)" ) RubyArray cachedTypes ,
1724
1724
@ Cached StringHelperNodes .EqualSameEncodingNode equalNode ) {
1725
1725
return cachedTypes ;
1726
1726
}
1727
1727
1728
- @ Specialization (guards = "libFormat.isRubyString(format)" )
1728
+ @ Specialization (guards = "libFormat.isRubyString(format)" , limit = "1" )
1729
1729
protected RubyArray typesUncached (VirtualFrame frame , Object format ,
1730
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary libFormat ) {
1730
+ @ Cached RubyStringLibrary libFormat ) {
1731
1731
return compileArgTypes (libFormat .getTString (format ), libFormat .getEncoding (format ), byteArrayNode );
1732
1732
}
1733
1733
@@ -1762,7 +1762,7 @@ protected RubyString formatCached(Object format, Object stringReader, RubyArray
1762
1762
@ Cached ArrayToObjectArrayNode arrayToObjectArrayNode ,
1763
1763
@ Cached WrapNode wrapNode ,
1764
1764
@ Cached UnwrapNode unwrapNode ,
1765
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary libFormat ,
1765
+ @ Cached RubyStringLibrary libFormat ,
1766
1766
@ Cached ("asTruffleStringUncached(format)" ) TruffleString cachedFormat ,
1767
1767
@ Cached ("libFormat.getEncoding(format)" ) RubyEncoding cachedEncoding ,
1768
1768
@ Cached ("cachedFormat.byteLength(cachedEncoding.tencoding)" ) int cachedFormatLength ,
@@ -1782,14 +1782,14 @@ protected RubyString formatCached(Object format, Object stringReader, RubyArray
1782
1782
1783
1783
@ Specialization (
1784
1784
guards = "libFormat.isRubyString(format)" ,
1785
- replaces = "formatCached" )
1785
+ replaces = "formatCached" , limit = "1" )
1786
1786
protected RubyString formatUncached (Object format , Object stringReader , RubyArray argArray ,
1787
1787
@ Cached TranslateInteropExceptionNode translateInteropExceptionNode ,
1788
1788
@ Cached WrapNode wrapNode ,
1789
1789
@ Cached UnwrapNode unwrapNode ,
1790
1790
@ Cached IndirectCallNode formatNode ,
1791
1791
@ Cached ArrayToObjectArrayNode arrayToObjectArrayNode ,
1792
- @ CachedLibrary ( limit = "LIBSTRING_CACHE" ) RubyStringLibrary libFormat ) {
1792
+ @ Cached RubyStringLibrary libFormat ) {
1793
1793
var tstring = libFormat .getTString (format );
1794
1794
var encoding = libFormat .getEncoding (format );
1795
1795
final Object [] arguments = arrayToObjectArrayNode .executeToObjectArray (argArray );
0 commit comments