Skip to content

Commit 325b193

Browse files
committed
remove ReferenceLibrary
1 parent 8bff015 commit 325b193

File tree

4 files changed

+0
-47
lines changed

4 files changed

+0
-47
lines changed

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,6 @@
174174
import com.oracle.truffle.api.profiles.ValueProfile;
175175
import com.oracle.truffle.api.utilities.TriState;
176176
import com.oracle.truffle.llvm.spi.NativeTypeLibrary;
177-
import com.oracle.truffle.llvm.spi.ReferenceLibrary;
178177

179178
@ExportLibrary(InteropLibrary.class)
180179
@ExportLibrary(NativeTypeLibrary.class)
@@ -1462,7 +1461,6 @@ static boolean isModifiableCached(PythonObjectNativeWrapper receiver, String nam
14621461
}
14631462
}
14641463

1465-
@ExportLibrary(ReferenceLibrary.class)
14661464
public static final class PrimitiveNativeWrapper extends DynamicObjectNativeWrapper {
14671465

14681466
public static final byte PRIMITIVE_STATE_BOOL = 1;
@@ -1728,24 +1726,6 @@ TriState isIdenticalOrUndefined(Object obj) {
17281726
return TriState.UNDEFINED;
17291727
}
17301728
}
1731-
1732-
@ExportMessage
1733-
static class IsSame {
1734-
1735-
@Specialization
1736-
static boolean doPrimitiveWrapper(PrimitiveNativeWrapper receiver, PrimitiveNativeWrapper other) {
1737-
// This basically emulates singletons for boxed values. However, we need to do so to
1738-
// preserve the invariant that storing an object into a list and getting it out (in
1739-
// the same critical region) returns the same object.
1740-
return other.state == receiver.state && other.value == receiver.value && (other.dvalue == receiver.dvalue || Double.isNaN(receiver.dvalue) && Double.isNaN(other.dvalue));
1741-
}
1742-
1743-
@Fallback
1744-
@SuppressWarnings("unused")
1745-
static boolean doGeneric(PrimitiveNativeWrapper receiver, Object other) {
1746-
return false;
1747-
}
1748-
}
17491729
}
17501730

17511731
@ExportMessage

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,8 @@
9292
import com.oracle.truffle.api.profiles.ConditionProfile;
9393
import com.oracle.truffle.api.profiles.ValueProfile;
9494
import com.oracle.truffle.api.utilities.TriState;
95-
import com.oracle.truffle.llvm.spi.ReferenceLibrary;
9695

9796
@ExportLibrary(PythonObjectLibrary.class)
98-
@ExportLibrary(ReferenceLibrary.class)
9997
@ExportLibrary(InteropLibrary.class)
10098
public final class PythonAbstractNativeObject extends PythonAbstractObject implements PythonNativeObject, PythonNativeClass {
10199

@@ -304,22 +302,6 @@ TriState isIdenticalOrUndefined(Object other,
304302
return TriState.valueOf(lib.isIdentical(object, other, lib));
305303
}
306304

307-
@ExportMessage
308-
static class IsSame {
309-
310-
@Specialization
311-
static boolean doNativeObject(PythonAbstractNativeObject receiver, PythonAbstractNativeObject other,
312-
@CachedLibrary("receiver.object") ReferenceLibrary referenceLibrary) {
313-
return referenceLibrary.isSame(receiver.object, other.object);
314-
}
315-
316-
@Fallback
317-
@SuppressWarnings("unused")
318-
static boolean doOther(PythonAbstractNativeObject receiver, Object other) {
319-
return false;
320-
}
321-
}
322-
323305
@ExportMessage(library = PythonObjectLibrary.class, name = "isLazyPythonClass")
324306
@ExportMessage(library = InteropLibrary.class)
325307
boolean isMetaObject(

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,12 @@
4949
import com.oracle.truffle.api.library.ExportMessage;
5050
import com.oracle.truffle.api.utilities.TriState;
5151
import com.oracle.truffle.llvm.spi.NativeTypeLibrary;
52-
import com.oracle.truffle.llvm.spi.ReferenceLibrary;
5352

5453
/**
5554
* A simple wrapper around native {@code NULL}.
5655
*/
5756
@ExportLibrary(InteropLibrary.class)
5857
@ExportLibrary(NativeTypeLibrary.class)
59-
@ExportLibrary(ReferenceLibrary.class)
6058
public class PythonNativeNull implements TruffleObject {
6159
private Object ptr;
6260

@@ -97,12 +95,6 @@ public Object getNativeType() {
9795
return null;
9896
}
9997

100-
@ExportMessage(limit = "1")
101-
boolean isSame(Object other,
102-
@CachedLibrary("this.getPtr()") ReferenceLibrary delegateLib) {
103-
return delegateLib.isSame(ptr, other);
104-
}
105-
10698
@ExportMessage(limit = "1")
10799
int identityHashCode(@CachedLibrary("this.getPtr()") InteropLibrary lib) throws UnsupportedMessageException {
108100
return lib.identityHashCode(ptr);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type/TypeNodes.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@
107107
import com.oracle.truffle.api.object.Shape;
108108
import com.oracle.truffle.api.profiles.ConditionProfile;
109109
import com.oracle.truffle.api.profiles.ValueProfile;
110-
import com.oracle.truffle.llvm.spi.ReferenceLibrary;
111110

112111
public abstract class TypeNodes {
113112

0 commit comments

Comments
 (0)