|
167 | 167 | import com.oracle.truffle.api.nodes.NodeUtil;
|
168 | 168 | import com.oracle.truffle.api.profiles.BranchProfile;
|
169 | 169 | import com.oracle.truffle.api.profiles.ConditionProfile;
|
170 |
| -import com.oracle.truffle.llvm.spi.ReferenceLibrary; |
171 | 170 |
|
172 | 171 | public abstract class CExtNodes {
|
173 | 172 |
|
@@ -2710,12 +2709,12 @@ public abstract static class GetTypeMemberNode extends PNodeWithContext {
|
2710 | 2709 | * native context, so we can be sure that the "nativeClassStableAssumption" (which is
|
2711 | 2710 | * per-context) is from the context in which this native object was created.
|
2712 | 2711 | */
|
2713 |
| - @Specialization(guards = {"referenceLibrary.isSame(cachedObj, obj)", "memberName == cachedMemberName"}, // |
| 2712 | + @Specialization(guards = {"lib.isIdentical(cachedObj, obj, lib)", "memberName == cachedMemberName"}, // |
2714 | 2713 | limit = "1", //
|
2715 | 2714 | assumptions = {"getNativeClassStableAssumption(cachedObj)", "singleContextAssumption()"})
|
2716 | 2715 | public Object doCachedObj(@SuppressWarnings("unused") PythonAbstractNativeObject obj, @SuppressWarnings("unused") NativeMember memberName,
|
2717 | 2716 | @Cached("obj") @SuppressWarnings("unused") PythonAbstractNativeObject cachedObj,
|
2718 |
| - @CachedLibrary("cachedObj") @SuppressWarnings("unused") ReferenceLibrary referenceLibrary, |
| 2717 | + @CachedLibrary(limit = "2") @SuppressWarnings("unused") InteropLibrary lib, |
2719 | 2718 | @Cached("memberName") @SuppressWarnings("unused") NativeMember cachedMemberName,
|
2720 | 2719 | @Cached("doSlowPath(obj, memberName)") Object result) {
|
2721 | 2720 | return result;
|
@@ -3158,12 +3157,12 @@ static PythonNativeWrapper resolveLongCached(@SuppressWarnings("unused") long po
|
3158 | 3157 | }
|
3159 | 3158 |
|
3160 | 3159 | @Specialization(limit = "3", //
|
3161 |
| - guards = {"isSame(referenceLibrary, cachedPointerObject, pointerObject)", "cachedValue != null"}, // |
| 3160 | + guards = {"isSame(lib, cachedPointerObject, pointerObject)", "cachedValue != null"}, // |
3162 | 3161 | assumptions = "singleContextAssumption()", //
|
3163 | 3162 | rewriteOn = InvalidAssumptionException.class)
|
3164 | 3163 | static PythonNativeWrapper resolveObjectCached(@SuppressWarnings("unused") Object pointerObject,
|
3165 | 3164 | @Cached("pointerObject") @SuppressWarnings("unused") Object cachedPointerObject,
|
3166 |
| - @CachedLibrary("cachedPointerObject") @SuppressWarnings("unused") ReferenceLibrary referenceLibrary, |
| 3165 | + @CachedLibrary(limit = "3") @SuppressWarnings("unused") InteropLibrary lib, |
3167 | 3166 | @Cached("resolveHandleUncached(pointerObject)") PythonNativeWrapper cachedValue,
|
3168 | 3167 | @Cached("getHandleValidAssumption(cachedValue)") Assumption associationValidAssumption) throws InvalidAssumptionException {
|
3169 | 3168 | associationValidAssumption.check();
|
@@ -3195,8 +3194,8 @@ static PythonNativeWrapper resolveHandleUncached(Object pointerObject) {
|
3195 | 3194 | return null;
|
3196 | 3195 | }
|
3197 | 3196 |
|
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); |
3200 | 3199 | }
|
3201 | 3200 |
|
3202 | 3201 | static Assumption singleContextAssumption() {
|
|
0 commit comments