@@ -1547,17 +1547,19 @@ public abstract static class PackNode extends CoreMethodNode {
1547
1547
1548
1548
@ Specialization (
1549
1549
guards = {
1550
- "libFormat.isRubyString(format )" ,
1551
- "equalNode.execute(libFormat, format , cachedFormat, cachedEncoding)" },
1550
+ "libFormat.isRubyString(formatAsString )" ,
1551
+ "equalNode.execute(libFormat, formatAsString , cachedFormat, cachedEncoding)" },
1552
1552
limit = "getCacheLimit()" )
1553
1553
protected RubyString packCached (RubyArray array , Object format ,
1554
+ @ Cached @ Shared ToStrNode toStrNode ,
1555
+ @ Bind ("toStrNode.execute(this, format)" ) Object formatAsString ,
1554
1556
@ Cached @ Shared InlinedBranchProfile exceptionProfile ,
1555
1557
@ Cached @ Shared InlinedConditionProfile resizeProfile ,
1556
1558
@ Cached @ Shared RubyStringLibrary libFormat ,
1557
- @ Cached ("asTruffleStringUncached(format )" ) TruffleString cachedFormat ,
1558
- @ Cached ("libFormat.getEncoding(format )" ) RubyEncoding cachedEncoding ,
1559
+ @ Cached ("asTruffleStringUncached(formatAsString )" ) TruffleString cachedFormat ,
1560
+ @ Cached ("libFormat.getEncoding(formatAsString )" ) RubyEncoding cachedEncoding ,
1559
1561
@ Cached ("cachedFormat.byteLength(cachedEncoding.tencoding)" ) int cachedFormatLength ,
1560
- @ Cached ("create(compileFormat(getJavaString(format )))" ) DirectCallNode callPackNode ,
1562
+ @ Cached ("create(compileFormat(getJavaString(formatAsString )))" ) DirectCallNode callPackNode ,
1561
1563
@ Cached StringHelperNodes .EqualNode equalNode ) {
1562
1564
final BytesResult result ;
1563
1565
try {
@@ -1571,15 +1573,15 @@ protected RubyString packCached(RubyArray array, Object format,
1571
1573
return finishPack (cachedFormatLength , result , resizeProfile );
1572
1574
}
1573
1575
1574
- @ Specialization (guards = { "libFormat.isRubyString(format )" }, replaces = "packCached" , limit = "1" )
1576
+ @ Specialization (guards = { "libFormat.isRubyString(formatAsString )" }, replaces = "packCached" , limit = "1" )
1575
1577
protected RubyString packUncached (RubyArray array , Object format ,
1576
- @ Cached ToStrNode toStrNode ,
1578
+ @ Cached @ Shared ToStrNode toStrNode ,
1579
+ @ Bind ("toStrNode.execute(this, format)" ) Object formatAsString ,
1577
1580
@ Cached @ Shared InlinedBranchProfile exceptionProfile ,
1578
1581
@ Cached @ Shared InlinedConditionProfile resizeProfile ,
1579
1582
@ Cached @ Shared RubyStringLibrary libFormat ,
1580
1583
@ Cached ToJavaStringNode toJavaStringNode ,
1581
1584
@ Cached IndirectCallNode callPackNode ) {
1582
- final var formatAsString = toStrNode .execute (this , format );
1583
1585
final String formatString = toJavaStringNode .execute (formatAsString );
1584
1586
1585
1587
final BytesResult result ;
0 commit comments