Skip to content

Commit 7076d9e

Browse files
committed
use isIdentical message in CExtNodes
1 parent 09ef110 commit 7076d9e

File tree

1 file changed

+6
-7
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext

1 file changed

+6
-7
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/CExtNodes.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
import com.oracle.truffle.api.nodes.NodeUtil;
168168
import com.oracle.truffle.api.profiles.BranchProfile;
169169
import com.oracle.truffle.api.profiles.ConditionProfile;
170-
import com.oracle.truffle.llvm.spi.ReferenceLibrary;
171170

172171
public abstract class CExtNodes {
173172

@@ -2710,12 +2709,12 @@ public abstract static class GetTypeMemberNode extends PNodeWithContext {
27102709
* native context, so we can be sure that the "nativeClassStableAssumption" (which is
27112710
* per-context) is from the context in which this native object was created.
27122711
*/
2713-
@Specialization(guards = {"referenceLibrary.isSame(cachedObj, obj)", "memberName == cachedMemberName"}, //
2712+
@Specialization(guards = {"lib.isIdentical(cachedObj, obj, lib)", "memberName == cachedMemberName"}, //
27142713
limit = "1", //
27152714
assumptions = {"getNativeClassStableAssumption(cachedObj)", "singleContextAssumption()"})
27162715
public Object doCachedObj(@SuppressWarnings("unused") PythonAbstractNativeObject obj, @SuppressWarnings("unused") NativeMember memberName,
27172716
@Cached("obj") @SuppressWarnings("unused") PythonAbstractNativeObject cachedObj,
2718-
@CachedLibrary("cachedObj") @SuppressWarnings("unused") ReferenceLibrary referenceLibrary,
2717+
@CachedLibrary(limit = "2") @SuppressWarnings("unused") InteropLibrary lib,
27192718
@Cached("memberName") @SuppressWarnings("unused") NativeMember cachedMemberName,
27202719
@Cached("doSlowPath(obj, memberName)") Object result) {
27212720
return result;
@@ -3158,12 +3157,12 @@ static PythonNativeWrapper resolveLongCached(@SuppressWarnings("unused") long po
31583157
}
31593158

31603159
@Specialization(limit = "3", //
3161-
guards = {"isSame(referenceLibrary, cachedPointerObject, pointerObject)", "cachedValue != null"}, //
3160+
guards = {"isSame(lib, cachedPointerObject, pointerObject)", "cachedValue != null"}, //
31623161
assumptions = "singleContextAssumption()", //
31633162
rewriteOn = InvalidAssumptionException.class)
31643163
static PythonNativeWrapper resolveObjectCached(@SuppressWarnings("unused") Object pointerObject,
31653164
@Cached("pointerObject") @SuppressWarnings("unused") Object cachedPointerObject,
3166-
@CachedLibrary("cachedPointerObject") @SuppressWarnings("unused") ReferenceLibrary referenceLibrary,
3165+
@CachedLibrary(limit = "3") @SuppressWarnings("unused") InteropLibrary lib,
31673166
@Cached("resolveHandleUncached(pointerObject)") PythonNativeWrapper cachedValue,
31683167
@Cached("getHandleValidAssumption(cachedValue)") Assumption associationValidAssumption) throws InvalidAssumptionException {
31693168
associationValidAssumption.check();
@@ -3195,8 +3194,8 @@ static PythonNativeWrapper resolveHandleUncached(Object pointerObject) {
31953194
return null;
31963195
}
31973196

3198-
static boolean isSame(ReferenceLibrary referenceLibrary, Object left, Object right) {
3199-
return referenceLibrary.isSame(left, right);
3197+
static boolean isSame(InteropLibrary lib, Object left, Object right) {
3198+
return lib.isIdentical(left, right, lib);
32003199
}
32013200

32023201
static Assumption singleContextAssumption() {

0 commit comments

Comments
 (0)