27
27
package com .oracle .graal .python .builtins .objects .method ;
28
28
29
29
import static com .oracle .graal .python .nodes .SpecialAttributeNames .__TEXT_SIGNATURE__ ;
30
+ import static com .oracle .graal .python .nodes .SpecialMethodNames .__OBJCLASS__ ;
30
31
import static com .oracle .graal .python .nodes .SpecialMethodNames .__REDUCE__ ;
31
32
import static com .oracle .graal .python .nodes .SpecialMethodNames .__REPR__ ;
32
33
import static com .oracle .graal .python .runtime .exception .PythonErrorType .TypeError ;
38
39
import com .oracle .graal .python .builtins .PythonBuiltinClassType ;
39
40
import com .oracle .graal .python .builtins .PythonBuiltins ;
40
41
import com .oracle .graal .python .builtins .objects .PNone ;
42
+ import com .oracle .graal .python .builtins .objects .PythonAbstractObject ;
41
43
import com .oracle .graal .python .builtins .objects .function .AbstractFunctionBuiltins ;
42
44
import com .oracle .graal .python .builtins .objects .function .PFunction ;
43
45
import com .oracle .graal .python .builtins .objects .module .PythonModule ;
46
48
import com .oracle .graal .python .builtins .objects .type .TypeNodes .GetNameNode ;
47
49
import com .oracle .graal .python .nodes .ErrorMessages ;
48
50
import com .oracle .graal .python .nodes .SpecialAttributeNames ;
49
- import static com .oracle .graal .python .nodes .SpecialMethodNames .__OBJCLASS__ ;
50
51
import com .oracle .graal .python .nodes .attributes .GetAttributeNode ;
51
52
import com .oracle .graal .python .nodes .function .PythonBuiltinBaseNode ;
52
53
import com .oracle .graal .python .nodes .function .builtins .PythonBinaryBuiltinNode ;
@@ -106,7 +107,7 @@ Object reprBuiltinMethod(VirtualFrame frame, PBuiltinMethod self,
106
107
@ Cached ("createGetAttributeNode()" ) GetAttributeNode getNameNode ,
107
108
@ Cached ("create()" ) GetNameNode getTypeNameNode ) {
108
109
String typeName = getTypeNameNode .execute (lib .getLazyPythonClass (self .getSelf ()));
109
- return strFormat ("<built-in method %s of %s object at 0x%x>" , getNameNode .executeObject (frame , self .getFunction ()), typeName , hashCode (self ));
110
+ return strFormat ("<built-in method %s of %s object at 0x%x>" , getNameNode .executeObject (frame , self .getFunction ()), typeName , PythonAbstractObject . systemHashCode (self . getSelf () ));
110
111
}
111
112
112
113
@ Specialization (guards = "!isBuiltinFunction(self)" , limit = "3" )
@@ -115,12 +116,7 @@ Object reprBuiltinMethod(VirtualFrame frame, PMethod self,
115
116
@ Cached ("createGetAttributeNode()" ) GetAttributeNode getNameNode ,
116
117
@ Cached ("create()" ) GetNameNode getTypeNameNode ) {
117
118
String typeName = getTypeNameNode .execute (lib .getLazyPythonClass (self .getSelf ()));
118
- return strFormat ("<built-in method %s of %s object at 0x%x>" , getNameNode .executeObject (frame , self .getFunction ()), typeName , hashCode (self ));
119
- }
120
-
121
- @ TruffleBoundary (allowInlining = true )
122
- private static int hashCode (Object self ) {
123
- return self .hashCode ();
119
+ return strFormat ("<built-in method %s of %s object at 0x%x>" , getNameNode .executeObject (frame , self .getFunction ()), typeName , PythonAbstractObject .systemHashCode (self .getSelf ()));
124
120
}
125
121
126
122
@ TruffleBoundary
0 commit comments