File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change 74
74
75
75
import com .oracle .graal .python .PythonLanguage ;
76
76
import com .oracle .graal .python .builtins .PythonBuiltinClassType ;
77
+ import com .oracle .graal .python .builtins .modules .BuiltinFunctions ;
77
78
import com .oracle .graal .python .builtins .modules .MathGuards ;
78
79
import com .oracle .graal .python .builtins .objects .bytes .PBytes ;
79
80
import com .oracle .graal .python .builtins .objects .cext .CApiGuards ;
@@ -2026,19 +2027,13 @@ public Object getMetaObject(@Shared("getClassThis") @Cached GetClassNode getClas
2026
2027
}
2027
2028
2028
2029
@ ExportMessage
2029
- public int identityHashCode (
2030
- @ CachedLibrary ("this" ) PythonObjectLibrary objectLib ) {
2031
- if (objectLib .isHashable (this )) {
2032
- return Long .hashCode (objectLib .hash (this ));
2033
- } else {
2034
- // everything in Python has an identity, but not everything provides a __hash__ method
2035
- return systemHashCode (this );
2036
- }
2030
+ public int identityHashCode (@ Cached BuiltinFunctions .IdExpressionNode idNode ) {
2031
+ return Long .hashCode (idNode .executeLong (0 ));
2037
2032
}
2038
2033
2039
2034
@ TruffleBoundary
2040
- public static int systemHashCode (Object obj ) {
2041
- return System .identityHashCode (obj );
2035
+ public static int systemHashCode (Object value ) {
2036
+ return System .identityHashCode (value );
2042
2037
}
2043
2038
2044
2039
@ ExportMessage
You can’t perform that action at this time.
0 commit comments