Skip to content

Commit 51e9cd8

Browse files
committed
Use 'Python(U|Bi|Ter)naryBuiltinNode' where possible.
1 parent dab0a3f commit 51e9cd8

File tree

1 file changed

+10
-10
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/dict

1 file changed

+10
-10
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/dict/DictBuiltins.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public Object setDefault(PDict dict, Object key, Object defaultValue,
152152
// pop(key[, default])
153153
@Builtin(name = "pop", minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 3)
154154
@GenerateNodeFactory
155-
public abstract static class PopNode extends PythonBuiltinNode {
155+
public abstract static class PopNode extends PythonTernaryBuiltinNode {
156156
@Child private HashingStorageNodes.GetItemNode getItemNode;
157157
@Child private HashingStorageNodes.DelItemNode delItemNode;
158158

@@ -193,7 +193,7 @@ public Object popDefault(PDict dict, Object key, Object defaultValue) {
193193
// popitem()
194194
@Builtin(name = "popitem", fixedNumOfPositionalArgs = 1)
195195
@GenerateNodeFactory
196-
public abstract static class PopItemNode extends PythonBuiltinNode {
196+
public abstract static class PopItemNode extends PythonUnaryBuiltinNode {
197197

198198
@Specialization
199199
@TruffleBoundary
@@ -233,7 +233,7 @@ public PDictView items(PDict self) {
233233
// get(key[, default])
234234
@Builtin(name = "get", minNumOfPositionalArgs = 2, maxNumOfPositionalArgs = 3)
235235
@GenerateNodeFactory
236-
public abstract static class GetNode extends PythonBuiltinNode {
236+
public abstract static class GetNode extends PythonTernaryBuiltinNode {
237237
@Child private HashingStorageNodes.GetItemNode getItemNode;
238238

239239
@Specialization(guards = "!isNoValue(defaultValue)")
@@ -274,7 +274,7 @@ Object getItem(PDict self, Object key,
274274

275275
@Builtin(name = __MISSING__, fixedNumOfPositionalArgs = 2)
276276
@GenerateNodeFactory
277-
public abstract static class MissingNode extends PythonBuiltinNode {
277+
public abstract static class MissingNode extends PythonBinaryBuiltinNode {
278278
@SuppressWarnings("unused")
279279
@Specialization
280280
Object run(Object self, PString key) {
@@ -312,7 +312,7 @@ Object run(PDict self, Object key, Object value,
312312

313313
@Builtin(name = __DELITEM__, fixedNumOfPositionalArgs = 2)
314314
@GenerateNodeFactory
315-
public abstract static class DelItemNode extends PythonBuiltinNode {
315+
public abstract static class DelItemNode extends PythonBinaryBuiltinNode {
316316
@Specialization
317317
Object run(PDict self, Object key,
318318
@Cached("create()") HashingStorageNodes.DelItemNode delItemNode) {
@@ -334,7 +334,7 @@ Object run(PDict self) {
334334

335335
@Builtin(name = __EQ__, fixedNumOfPositionalArgs = 2)
336336
@GenerateNodeFactory
337-
public abstract static class EqNode extends PythonBuiltinNode {
337+
public abstract static class EqNode extends PythonBinaryBuiltinNode {
338338
@Specialization
339339
Object doDictDict(PDict self, PDict other,
340340
@Cached("create()") HashingStorageNodes.EqualsNode equalsNode) {
@@ -350,7 +350,7 @@ PNotImplemented doGeneric(Object self, Object other) {
350350

351351
@Builtin(name = __CONTAINS__, fixedNumOfPositionalArgs = 2)
352352
@GenerateNodeFactory
353-
public abstract static class ContainsNode extends PythonBuiltinNode {
353+
public abstract static class ContainsNode extends PythonBinaryBuiltinNode {
354354
@Child private HashingStorageNodes.ContainsKeyNode containsKeyNode;
355355

356356
@SuppressWarnings("unused")
@@ -391,7 +391,7 @@ public int len(PDict self,
391391
// copy()
392392
@Builtin(name = "copy", fixedNumOfPositionalArgs = 1)
393393
@GenerateNodeFactory
394-
public abstract static class CopyNode extends PythonBuiltinNode {
394+
public abstract static class CopyNode extends PythonUnaryBuiltinNode {
395395

396396
@Specialization
397397
public PDict copy(PDict dict,
@@ -403,7 +403,7 @@ public PDict copy(PDict dict,
403403
// clear()
404404
@Builtin(name = "clear", fixedNumOfPositionalArgs = 1)
405405
@GenerateNodeFactory
406-
public abstract static class ClearNode extends PythonBuiltinNode {
406+
public abstract static class ClearNode extends PythonUnaryBuiltinNode {
407407

408408
@Specialization
409409
public PDict copy(PDict dict) {
@@ -425,7 +425,7 @@ public PDictView values(PDict self) {
425425

426426
@Builtin(name = __HASH__, fixedNumOfPositionalArgs = 1)
427427
@GenerateNodeFactory
428-
public abstract static class HashNode extends PythonBuiltinNode {
428+
public abstract static class HashNode extends PythonUnaryBuiltinNode {
429429
@Specialization
430430
Object doGeneric(Object self) {
431431
throw raise(TypeError, "unhashable type: '%p'", self);

0 commit comments

Comments
 (0)