Skip to content

Commit 7a6651b

Browse files
committed
Replace PInteropSubscriptNode with PyObjectGetItem
1 parent f52e5d7 commit 7a6651b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/PythonAbstractObject.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
import com.oracle.graal.python.lib.GetNextNode;
109109
import com.oracle.graal.python.lib.PyCallableCheckNode;
110110
import com.oracle.graal.python.lib.PyMappingCheckNode;
111+
import com.oracle.graal.python.lib.PyObjectGetItem;
111112
import com.oracle.graal.python.lib.PyObjectGetIter;
112113
import com.oracle.graal.python.lib.PyObjectLookupAttr;
113114
import com.oracle.graal.python.lib.PyObjectSetAttr;
@@ -694,7 +695,7 @@ public Object getMembers(boolean includeInternal,
694695
// GR-44020: make shared:
695696
@Exclusive @Cached PyObjectLookupAttr lookupKeys,
696697
@Cached CallNode callKeys,
697-
@Cached PInteropSubscriptNode getItemNode,
698+
@Cached PyObjectGetItem getItemNode,
698699
@Cached SequenceNodes.LenNode lenNode,
699700
@Cached TypeNodes.GetMroNode getMroNode,
700701
@Cached TruffleString.CodePointLengthNode codePointLengthNode,
@@ -723,7 +724,7 @@ public Object getMembers(boolean includeInternal,
723724
PList mapKeys = castToList.executeWithGlobalState(callKeys.execute(keysMethod));
724725
int len = lenNode.execute(inliningTarget, mapKeys);
725726
for (int i = 0; i < len; i++) {
726-
Object key = getItemNode.execute(mapKeys, i);
727+
Object key = getItemNode.execute(null, inliningTarget, mapKeys, i);
727728
TruffleString tsKey = null;
728729
if (key instanceof TruffleString) {
729730
tsKey = (TruffleString) key;

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
6464
import com.oracle.graal.python.builtins.objects.PNone;
6565
import com.oracle.graal.python.builtins.objects.PythonAbstractObject;
66-
import com.oracle.graal.python.builtins.objects.PythonAbstractObject.PInteropSubscriptNode;
6766
import com.oracle.graal.python.builtins.objects.cext.PythonAbstractNativeObject;
6867
import com.oracle.graal.python.builtins.objects.cext.PythonNativeObject;
6968
import com.oracle.graal.python.builtins.objects.cext.capi.CExtNodes.CreateFunctionNode;
@@ -127,6 +126,7 @@
127126
import com.oracle.graal.python.builtins.objects.type.TypeNodes.HasSameConstructorNode;
128127
import com.oracle.graal.python.builtins.objects.type.TypeNodes.IsTypeNode;
129128
import com.oracle.graal.python.lib.PyObjectCallMethodObjArgs;
129+
import com.oracle.graal.python.lib.PyObjectGetItem;
130130
import com.oracle.graal.python.lib.PyObjectIsTrueNode;
131131
import com.oracle.graal.python.nodes.BuiltinNames;
132132
import com.oracle.graal.python.nodes.ErrorMessages;
@@ -2913,11 +2913,11 @@ public abstract static class RecursiveExceptionMatches extends Node {
29132913
static int tuple(GraalHPyContext context, Object err, PTuple exc,
29142914
@Bind("this") Node inliningTarget,
29152915
@Shared @Cached RecursiveExceptionMatches recExcMatch,
2916-
@Exclusive @Cached PInteropSubscriptNode getItemNode,
2916+
@Exclusive @Cached PyObjectGetItem getItemNode,
29172917
@Exclusive @Cached InlinedLoopConditionProfile loopProfile) {
29182918
int len = exc.getSequenceStorage().length();
29192919
for (int i = 0; loopProfile.profile(inliningTarget, i < len); i++) {
2920-
Object e = getItemNode.execute(exc, i);
2920+
Object e = getItemNode.execute(null, inliningTarget, exc, i);
29212921
if (recExcMatch.execute(context, err, e) != 0) {
29222922
return 1;
29232923
}
@@ -2934,11 +2934,11 @@ static int subtuple(GraalHPyContext context, Object err, Object exc,
29342934
@Shared @Cached ReadAttributeFromObjectNode readAttr,
29352935
@Shared @Cached CallNode callNode,
29362936
@Cached CastToJavaIntExactNode cast,
2937-
@Exclusive @Cached PInteropSubscriptNode getItemNode,
2937+
@Exclusive @Cached PyObjectGetItem getItemNode,
29382938
@Exclusive @Cached InlinedLoopConditionProfile loopProfile) {
29392939
int len = cast.execute(inliningTarget, callBuiltinFunction(context, BuiltinNames.T_LEN, new Object[]{exc}, readAttr, callNode));
29402940
for (int i = 0; loopProfile.profile(inliningTarget, i < len); i++) {
2941-
Object e = getItemNode.execute(exc, i);
2941+
Object e = getItemNode.execute(null, inliningTarget, exc, i);
29422942
if (recExcMatch.execute(context, err, e) != 0) {
29432943
return 1;
29442944
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/jni/GraalHPyJNIContext.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
7171
import com.oracle.graal.python.builtins.objects.PNone;
7272
import com.oracle.graal.python.builtins.objects.PNotImplemented;
73-
import com.oracle.graal.python.builtins.objects.PythonAbstractObject.PInteropSubscriptNode;
7473
import com.oracle.graal.python.builtins.objects.bytes.PBytes;
7574
import com.oracle.graal.python.builtins.objects.capsule.PyCapsule;
7675
import com.oracle.graal.python.builtins.objects.cext.common.CExtCommonNodesFactory.AsNativePrimitiveNodeGen;
@@ -1883,7 +1882,7 @@ public long ctxGetItemi(long hCollection, long lidx) {
18831882
}
18841883
// TODO: other storages...
18851884
}
1886-
Object result = PInteropSubscriptNode.getUncached().execute(receiver, lidx);
1885+
Object result = PyObjectGetItem.executeUncached(receiver, lidx);
18871886
return GraalHPyBoxing.boxHandle(context.getHPyHandleForObject(result));
18881887
} catch (PException e) {
18891888
HPyTransformExceptionToNativeNode.executeUncached(context, e);

0 commit comments

Comments
 (0)