Skip to content

Commit 3598680

Browse files
committed
more sharing in PyObjectDelItem
1 parent 6999bfc commit 3598680

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/lib/PyObjectDelItem.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
import com.oracle.graal.python.nodes.call.special.LookupSpecialMethodSlotNode;
5252
import com.oracle.graal.python.nodes.object.GetClassNode;
5353
import com.oracle.truffle.api.dsl.Cached;
54+
import com.oracle.truffle.api.dsl.Cached.Shared;
5455
import com.oracle.truffle.api.dsl.GenerateUncached;
5556
import com.oracle.truffle.api.dsl.ImportStatic;
5657
import com.oracle.truffle.api.dsl.Specialization;
@@ -68,10 +69,10 @@ public abstract class PyObjectDelItem extends Node {
6869

6970
@Specialization
7071
static void doWithFrame(VirtualFrame frame, Object primary, Object index,
71-
@Cached GetClassNode getClassNode,
72+
@Shared("getclass") @Cached GetClassNode getClassNode,
7273
@Cached("create(DelItem)") LookupSpecialMethodSlotNode lookupDelitem,
73-
@Cached PRaiseNode raise,
74-
@Cached CallBinaryMethodNode callDelitem) {
74+
@Shared("raiseNode") @Cached PRaiseNode raise,
75+
@Shared("callNode") @Cached CallBinaryMethodNode callDelitem) {
7576
Object delitem = lookupDelitem.execute(frame, getClassNode.execute(primary), primary);
7677
if (delitem == PNone.NO_VALUE) {
7778
throw raise.raise(TypeError, ErrorMessages.OBJ_DOESNT_SUPPORT_DELETION, primary);
@@ -81,10 +82,10 @@ static void doWithFrame(VirtualFrame frame, Object primary, Object index,
8182

8283
@Specialization(replaces = "doWithFrame")
8384
static void doGeneric(Object primary, Object index,
84-
@Cached GetClassNode getClassNode,
85+
@Shared("getclass") @Cached GetClassNode getClassNode,
8586
@Cached(parameters = "DelItem") LookupCallableSlotInMRONode lookupDelitem,
86-
@Cached PRaiseNode raise,
87-
@Cached CallBinaryMethodNode callDelitem) {
87+
@Shared("raiseNode") @Cached PRaiseNode raise,
88+
@Shared("callNode") @Cached CallBinaryMethodNode callDelitem) {
8889
Object setitem = lookupDelitem.execute(getClassNode.execute(primary));
8990
if (setitem == PNone.NO_VALUE) {
9091
throw raise.raise(TypeError, ErrorMessages.OBJ_DOESNT_SUPPORT_DELETION, primary);

0 commit comments

Comments
 (0)