Skip to content

Commit 974ef02

Browse files
committed
add missing boundary
1 parent 5e3165e commit 974ef02

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/PythonAbstractObject.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2032,10 +2032,15 @@ public int identityHashCode(
20322032
return Long.hashCode(objectLib.hash(this));
20332033
} else {
20342034
// everything in Python has an identity, but not everything provides a __hash__ method
2035-
return System.identityHashCode(this);
2035+
return identityHashCode(this);
20362036
}
20372037
}
20382038

2039+
@TruffleBoundary
2040+
public static int identityHashCode(Object obj) {
2041+
return System.identityHashCode(obj);
2042+
}
2043+
20392044
@ExportMessage
20402045
public TriState isIdenticalOrUndefined(Object other,
20412046
@CachedLibrary(limit = "3") InteropLibrary otherLib,

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object/ObjectBuiltins.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import com.oracle.graal.python.builtins.PythonBuiltins;
5757
import com.oracle.graal.python.builtins.objects.PNone;
5858
import com.oracle.graal.python.builtins.objects.PNotImplemented;
59+
import com.oracle.graal.python.builtins.objects.PythonAbstractObject;
5960
import com.oracle.graal.python.builtins.objects.cext.CExtNodes;
6061
import com.oracle.graal.python.builtins.objects.cext.PythonAbstractNativeObject;
6162
import com.oracle.graal.python.builtins.objects.cext.PythonNativeClass;
@@ -303,9 +304,9 @@ String repr(VirtualFrame frame, Object self,
303304
Object moduleName = readModuleNode.executeObject(frame, type);
304305
Object qualName = readQualNameNode.executeObject(frame, type);
305306
if (moduleName != PNone.NO_VALUE && !BuiltinNames.BUILTINS.equals(moduleName)) {
306-
return strFormat("<%s.%s object at 0x%x>", moduleName, qualName, System.identityHashCode(self));
307+
return strFormat("<%s.%s object at 0x%x>", moduleName, qualName, PythonAbstractObject.identityHashCode(self));
307308
}
308-
return strFormat("<%s object at 0x%x>", qualName, System.identityHashCode(self));
309+
return strFormat("<%s object at 0x%x>", qualName, PythonAbstractObject.identityHashCode(self));
309310
}
310311

311312
@TruffleBoundary

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/expression/IsExpressionNode.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import com.oracle.graal.python.nodes.expression.IsExpressionNodeGen.IsNodeGen;
5555
import com.oracle.graal.python.nodes.object.IsBuiltinClassProfile;
5656
import com.oracle.graal.python.runtime.PythonContext;
57+
import com.oracle.graal.python.runtime.PythonCore;
5758
import com.oracle.graal.python.runtime.PythonOptions;
5859
import com.oracle.truffle.api.RootCallTarget;
5960
import com.oracle.truffle.api.dsl.Cached;
@@ -113,10 +114,11 @@ boolean doBD(boolean left, double right) {
113114
@Specialization
114115
boolean doBP(boolean left, PInt right,
115116
@Shared("ctxt") @CachedContext(PythonLanguage.class) PythonContext ctxt) {
117+
PythonCore core = ctxt.getCore();
116118
if (left) {
117-
return right == ctxt.getCore().getTrue();
119+
return right == core.getTrue();
118120
} else {
119-
return right == ctxt.getCore().getFalse();
121+
return right == core.getFalse();
120122
}
121123
}
122124

0 commit comments

Comments
 (0)