@@ -1751,35 +1751,38 @@ public abstract static class KernelToHexStringNode extends PrimitiveArrayArgumen
1751
1751
@ Specialization
1752
1752
String toHexString (Object value ,
1753
1753
@ Cached ToHexStringNode toHexStringNode ) {
1754
- return toHexStringNode .execute (value );
1754
+ return toHexStringNode .execute (this , value );
1755
1755
}
1756
1756
}
1757
1757
1758
1758
1759
1759
@ GenerateUncached
1760
+ @ GenerateInline
1761
+ @ GenerateCached (false )
1760
1762
public abstract static class ToHexStringNode extends RubyBaseNode {
1761
1763
1762
- public static ToHexStringNode getUncached () {
1763
- return KernelNodesFactory .ToHexStringNodeGen .getUncached ();
1764
- }
1764
+ public abstract String execute (Node node , Object value );
1765
1765
1766
- public abstract String execute (Object value );
1766
+ public static String executeUncached (Object value ) {
1767
+ return KernelNodesFactory .ToHexStringNodeGen .getUncached ().execute (null , value );
1768
+ }
1767
1769
1768
1770
@ Specialization
1769
- String toHexString (int value ) {
1771
+ static String toHexString (int value ) {
1770
1772
return toHexString ((long ) value );
1771
1773
}
1772
1774
1773
1775
@ TruffleBoundary
1774
1776
@ Specialization
1775
- String toHexString (long value ) {
1777
+ static String toHexString (long value ) {
1776
1778
return Long .toHexString (value );
1777
1779
}
1778
1780
1779
1781
@ Specialization
1780
- String toHexString (RubyBignum value ) {
1782
+ static String toHexString (RubyBignum value ) {
1781
1783
return BigIntegerOps .toString (value .value , 16 );
1782
1784
}
1785
+
1783
1786
}
1784
1787
1785
1788
@ CoreMethod (names = { "to_s" , "inspect" }) // Basic #inspect, refined later in core
@@ -1812,7 +1815,7 @@ RubyString toS(Object self,
1812
1815
@ Cached ToHexStringNode toHexStringNode ) {
1813
1816
String className = classNode .execute (self ).fields .getName ();
1814
1817
Object id = objectIDNode .execute (self );
1815
- String hexID = toHexStringNode .execute (id );
1818
+ String hexID = toHexStringNode .execute (this , id );
1816
1819
1817
1820
String javaString = Utils .concat ("#<" , className , ":0x" , hexID , ">" );
1818
1821
@@ -1826,7 +1829,7 @@ RubyString toS(Object self,
1826
1829
public static String uncachedBasicToS (Object self ) {
1827
1830
String className = LogicalClassNode .getUncached ().execute (self ).fields .getName ();
1828
1831
Object id = ObjectIDNode .getUncached ().execute (self );
1829
- String hexID = ToHexStringNode .getUncached (). execute (id );
1832
+ String hexID = ToHexStringNode .executeUncached (id );
1830
1833
1831
1834
return "#<" + className + ":0x" + hexID + ">" ;
1832
1835
}
0 commit comments