Skip to content

Commit 6a15c45

Browse files
author
Michal Medvecky
committed
made CopyDictWithoutKeysNode proxyable
1 parent a75db41 commit 6a15c45

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/CopyDictWithoutKeysNode.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import com.oracle.graal.python.nodes.PNodeWithContext;
4848
import com.oracle.graal.python.runtime.object.PFactory;
4949
import com.oracle.truffle.api.CompilerAsserts;
50+
import com.oracle.truffle.api.bytecode.OperationProxy;
5051
import com.oracle.truffle.api.dsl.Bind;
5152
import com.oracle.truffle.api.dsl.Cached;
5253
import com.oracle.truffle.api.dsl.Cached.Shared;
@@ -59,11 +60,12 @@
5960
import com.oracle.truffle.api.nodes.Node;
6061

6162
@GenerateInline(false) // used in BCI root node
63+
@OperationProxy.Proxyable
6264
public abstract class CopyDictWithoutKeysNode extends PNodeWithContext {
6365
public abstract PDict execute(Frame frame, Object subject, Object[] keys);
6466

6567
@Specialization(guards = {"keys.length == keysLength", "keysLength <= 32"}, limit = "1")
66-
static PDict copy(VirtualFrame frame, Object subject, @NeverDefault @SuppressWarnings("unused") Object[] keys,
68+
public static PDict copy(VirtualFrame frame, Object subject, @NeverDefault @SuppressWarnings("unused") Object[] keys,
6769
@Bind("this") Node inliningTarget,
6870
@Cached("keys.length") int keysLength,
6971
@Bind PythonLanguage language,
@@ -84,7 +86,7 @@ private static void deleteKeys(VirtualFrame frame, Node inliningTarget, Object[]
8486
}
8587

8688
@Specialization(guards = "keys.length > 32")
87-
static PDict copy(VirtualFrame frame, Object subject, Object[] keys,
89+
public static PDict copy(VirtualFrame frame, Object subject, Object[] keys,
8890
@Bind("this") Node inliningTarget,
8991
@Bind PythonLanguage language,
9092
@Shared @Cached DictNodes.UpdateNode updateNode,

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode_dsl/PBytecodeDSLRootNode.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@
306306
@OperationProxy(GetYieldFromIterNode.class)
307307
@OperationProxy(GetAwaitableNode.class)
308308
@OperationProxy(SetupAnnotationsNode.class)
309+
@OperationProxy(value = CopyDictWithoutKeysNode.class, name = "CopyDictWithoutKeys")
309310
@OperationProxy(value = PyObjectIsTrueNode.class, name = "Yes")
310311
@OperationProxy(value = PyObjectIsNotTrueNode.class, name = "Not")
311312
@OperationProxy(value = ListNodes.AppendNode.class, name = "ListAppend")
@@ -1135,14 +1136,6 @@ public static boolean perform(VirtualFrame frame, LocalAccessor values, Object m
11351136
}
11361137
}
11371138

1138-
@Operation
1139-
public static final class CopyDictWithoutKeys {
1140-
@Specialization
1141-
public static PDict perform(VirtualFrame frame, Object map, Object[] keys, @Cached CopyDictWithoutKeysNode node) {
1142-
return node.execute(frame, map, keys);
1143-
}
1144-
}
1145-
11461139
@Operation
11471140
@ConstantOperand(type = LocalAccessor.class)
11481141
public static final class MatchClass {

0 commit comments

Comments
 (0)