Skip to content

Commit 961700b

Browse files
committed
Cleanup: remove some dead code, use lib.asPointer in CreateFunctionNode
1 parent e682ac1 commit 961700b

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2087,7 +2087,7 @@ static PythonObject doNativeCallableWithWrapper(TruffleString name, Object calla
20872087
// PyTypeObject slot field
20882088
TpSlotPython newSlot = pythonSlot.forNewType(type);
20892089
try {
2090-
Object wrapper = context.getCApiContext().getClosureExecutable(InteropLibrary.getUncached().asPointer(callable));
2090+
Object wrapper = context.getCApiContext().getClosureExecutable(lib.asPointer(callable));
20912091
if (wrapper instanceof TpSlotWrapper slotWrapper) {
20922092
TpSlotWrapper newWrapper = newSlot != pythonSlot ? slotWrapper.cloneWith(newSlot) : slotWrapper;
20932093
newWrapper.toNative(SignatureLibrary.getUncached());

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,10 @@
116116
import com.oracle.truffle.api.interop.UnsupportedMessageException;
117117
import com.oracle.truffle.api.nodes.Node;
118118
import com.oracle.truffle.api.strings.TruffleString;
119-
import com.oracle.truffle.nfi.api.SignatureLibrary;
120119

121120
/**
122121
* Wraps fields that hold slot values, instances of {@link TpSlot}, such as {@link #tp_getattr()}.
123-
* This is GraalPython equivalent of the same fields in CPython's {@code PyTypeObject}.
122+
* This is GraalPy equivalent of the same fields in CPython's {@code PyTypeObject}.
124123
* <p>
125124
* Summary of the interactions:
126125
*
@@ -469,7 +468,6 @@ public static TpSlots createEmpty() {
469468
*/
470469
public static TpSlots fromNative(PythonAbstractNativeObject pythonClass, PythonContext ctx) {
471470
var builder = TpSlots.newBuilder();
472-
var signatureLib = SignatureLibrary.getUncached();
473471
for (TpSlotMeta def : TpSlotMeta.VALUES) {
474472
if (!def.hasNativeWrapperFactory()) {
475473
continue;
@@ -576,7 +574,7 @@ public static void inherit(PythonClass klass, MroSequenceStorage mro) {
576574
Builder klassSlots = newBuilder();
577575
for (int i = 0; i < mro.length(); i++) {
578576
PythonAbstractClass type = mro.getItemNormalized(i);
579-
TpSlots slots = GetTpSlotsNodeGen.getUncached().execute(null, type);
577+
TpSlots slots = GetTpSlotsNode.executeUncached(type);
580578
assert slots != null || type == klass;
581579
if (slots != null) {
582580
klassSlots.inherit(slots);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/util/PythonUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,6 @@ private PythonUtils() {
134134
*/
135135
public static final TruffleString.Encoding TS_ENCODING = TruffleString.Encoding.UTF_32;
136136

137-
public static final TruffleString EMPTY_TRUFFLESTRING = tsLiteral("");
138-
139137
public static final String[] EMPTY_STRING_ARRAY = new String[0];
140138
public static final TruffleString[] EMPTY_TRUFFLESTRING_ARRAY = new TruffleString[0];
141139
public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];

0 commit comments

Comments
 (0)