Skip to content

Commit d3f514a

Browse files
committed
get rid of ReferenceLibrary in CApiContext
1 parent 7076d9e commit d3f514a

File tree

1 file changed

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

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
import com.oracle.truffle.api.interop.UnsupportedMessageException;
9090
import com.oracle.truffle.api.profiles.BranchProfile;
9191
import com.oracle.truffle.api.profiles.ConditionProfile;
92-
import com.oracle.truffle.llvm.spi.ReferenceLibrary;
9392

9493
public final class CApiContext extends CExtContext {
9594
private static final TruffleLogger LOGGER = PythonLanguage.getLogger(CApiContext.class);
@@ -119,7 +118,7 @@ public final class CApiContext extends CExtContext {
119118
@CompilationFinal(dimensions = 1) private final PrimitiveNativeWrapper[] primitiveNativeWrapperCache;
120119

121120
/** Just used for integrity checks if assertions are enabled. */
122-
@CompilationFinal private ReferenceLibrary referenceLibrary;
121+
@CompilationFinal private InteropLibrary interoplibrary;
123122

124123
/**
125124
* Required to emulate PyLongObject's ABI; number of bits per digit (equal to
@@ -523,14 +522,14 @@ PythonAbstractNativeObject createPythonAbstractNativeObject(TruffleObject native
523522

524523
/**
525524
* Checks if the given {@link NativeObjectReference} objects point to the same native object.
526-
* This method lazily initializes {@link #referenceLibrary} as a side-effect.
525+
* This method lazily initializes {@link #interoplibrary} as a side-effect.
527526
*/
528527
private boolean isReferenceToSameNativeObject(NativeObjectReference old, NativeObjectReference ref) {
529-
if (referenceLibrary == null) {
528+
if (interoplibrary == null) {
530529
CompilerDirectives.transferToInterpreterAndInvalidate();
531-
referenceLibrary = ReferenceLibrary.getFactory().getUncached(old.ptrObject);
530+
interoplibrary = InteropLibrary.getFactory().getUncached();
532531
}
533-
return referenceLibrary.isSame(old.ptrObject, ref.ptrObject);
532+
return interoplibrary.isIdentical(old.ptrObject, ref.ptrObject, interoplibrary);
534533
}
535534

536535
static int idFromRefCnt(long refCnt) {

0 commit comments

Comments
 (0)