@@ -1826,28 +1826,26 @@ protected boolean isUntrusted(Object object,
1826
1826
1827
1827
}
1828
1828
1829
- @ GenerateUncached
1830
- @ GenerateNodeFactory
1831
1829
@ NodeChild (value = "valueNode" , type = RubyNode .class )
1832
1830
@ Primitive (name = "kernel_to_hex" )
1833
- public abstract static class ToHexStringNode extends RubySourceNode {
1831
+ public abstract static class KernelToHexStringNode extends PrimitiveNode {
1834
1832
1835
- @ NeverDefault
1836
- public static ToHexStringNode create () {
1837
- return KernelNodesFactory .ToHexStringNodeFactory .create (null );
1833
+ @ Specialization
1834
+ protected String toHexString (Object value ,
1835
+ @ Cached ToHexStringNode toHexStringNode ) {
1836
+ return toHexStringNode .execute (value );
1838
1837
}
1838
+ }
1839
1839
1840
- public static ToHexStringNode create ( RubyNode valueNode ) {
1841
- return KernelNodesFactory . ToHexStringNodeFactory . create ( valueNode );
1842
- }
1840
+
1841
+ @ GenerateUncached
1842
+ public abstract static class ToHexStringNode extends RubyBaseNode {
1843
1843
1844
1844
public static ToHexStringNode getUncached () {
1845
- return KernelNodesFactory .ToHexStringNodeFactory .getUncached ();
1845
+ return KernelNodesFactory .ToHexStringNodeGen .getUncached ();
1846
1846
}
1847
1847
1848
- public abstract String executeToHexString (Object value );
1849
-
1850
- abstract RubyNode getValueNode ();
1848
+ public abstract String execute (Object value );
1851
1849
1852
1850
@ Specialization
1853
1851
protected String toHexString (int value ) {
@@ -1864,12 +1862,6 @@ protected String toHexString(long value) {
1864
1862
protected String toHexString (RubyBignum value ) {
1865
1863
return BigIntegerOps .toString (value .value , 16 );
1866
1864
}
1867
-
1868
- @ Override
1869
- public RubyNode cloneUninitialized () {
1870
- return create (getValueNode ().cloneUninitialized ()).copyFlags (this );
1871
- }
1872
-
1873
1865
}
1874
1866
1875
1867
@ GenerateUncached
@@ -1899,7 +1891,7 @@ protected RubyString toS(Object self,
1899
1891
@ Cached ToHexStringNode toHexStringNode ) {
1900
1892
String className = classNode .execute (self ).fields .getName ();
1901
1893
Object id = objectIDNode .execute (self );
1902
- String hexID = toHexStringNode .executeToHexString (id );
1894
+ String hexID = toHexStringNode .execute (id );
1903
1895
1904
1896
String javaString = Utils .concat ("#<" , className , ":0x" , hexID , ">" );
1905
1897
@@ -1913,7 +1905,7 @@ protected RubyString toS(Object self,
1913
1905
public static String uncachedBasicToS (Object self ) {
1914
1906
String className = LogicalClassNode .getUncached ().execute (self ).fields .getName ();
1915
1907
Object id = ObjectIDNode .getUncached ().execute (self );
1916
- String hexID = ToHexStringNode .getUncached ().executeToHexString (id );
1908
+ String hexID = ToHexStringNode .getUncached ().execute (id );
1917
1909
1918
1910
return "#<" + className + ":0x" + hexID + ">" ;
1919
1911
}
0 commit comments