Skip to content

Commit ca1e41c

Browse files
committed
Remove @NodeChild where not needed anymore
1 parent 116356a commit ca1e41c

File tree

10 files changed

+58
-238
lines changed

10 files changed

+58
-238
lines changed

src/main/java/org/truffleruby/cext/CExtNodes.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import org.truffleruby.annotations.Primitive;
3535
import org.truffleruby.annotations.Visibility;
3636
import org.truffleruby.builtins.CoreMethodArrayArgumentsNode;
37-
import org.truffleruby.builtins.CoreMethodNode;
3837
import org.truffleruby.builtins.PrimitiveArrayArgumentsNode;
3938
import org.truffleruby.cext.UnwrapNode.UnwrapCArrayNode;
4039
import org.truffleruby.core.MarkingService.ExtensionCallStack;
@@ -87,7 +86,6 @@
8786
import org.truffleruby.language.RubyBaseNode;
8887
import org.truffleruby.language.RubyDynamicObject;
8988
import org.truffleruby.language.RubyGuards;
90-
import org.truffleruby.language.RubyNode;
9189
import org.truffleruby.language.RubyRootNode;
9290
import org.truffleruby.language.WarnNode;
9391
import org.truffleruby.language.arguments.ArgumentsDescriptor;
@@ -127,7 +125,6 @@
127125
import com.oracle.truffle.api.dsl.Cached;
128126
import com.oracle.truffle.api.dsl.Cached.Shared;
129127
import com.oracle.truffle.api.dsl.Fallback;
130-
import com.oracle.truffle.api.dsl.NodeChild;
131128
import com.oracle.truffle.api.dsl.ReportPolymorphism;
132129
import com.oracle.truffle.api.dsl.Specialization;
133130
import com.oracle.truffle.api.frame.Frame;
@@ -994,9 +991,7 @@ protected ImmutableRubyString rbStrUnlockTmpImmutable(ImmutableRubyString string
994991
}
995992

996993
@CoreMethod(names = "rb_const_get", onSingleton = true, required = 2)
997-
@NodeChild(value = "module", type = RubyNode.class)
998-
@NodeChild(value = "name", type = RubyNode.class)
999-
public abstract static class RbConstGetNode extends CoreMethodNode {
994+
public abstract static class RbConstGetNode extends CoreMethodArrayArgumentsNode {
1000995

1001996
@Child private LookupConstantNode lookupConstantNode = LookupConstantNode.create(true, true);
1002997

@@ -1013,9 +1008,7 @@ protected Object rbConstGet(RubyModule module, Object name,
10131008
}
10141009

10151010
@CoreMethod(names = "rb_const_get_from", onSingleton = true, required = 2)
1016-
@NodeChild(value = "module", type = RubyNode.class)
1017-
@NodeChild(value = "name", type = RubyNode.class)
1018-
public abstract static class RbConstGetFromNode extends CoreMethodNode {
1011+
public abstract static class RbConstGetFromNode extends CoreMethodArrayArgumentsNode {
10191012

10201013
@Child private LookupConstantNode lookupConstantNode = LookupConstantNode.create(true, false);
10211014

@@ -1032,10 +1025,7 @@ protected Object rbConstGetFrom(RubyModule module, Object name,
10321025
}
10331026

10341027
@CoreMethod(names = "rb_const_set", onSingleton = true, required = 3)
1035-
@NodeChild(value = "module", type = RubyNode.class)
1036-
@NodeChild(value = "name", type = RubyNode.class)
1037-
@NodeChild(value = "value", type = RubyNode.class)
1038-
public abstract static class RbConstSetNode extends CoreMethodNode {
1028+
public abstract static class RbConstSetNode extends CoreMethodArrayArgumentsNode {
10391029

10401030

10411031
@Specialization

src/main/java/org/truffleruby/core/array/ArrayNodes.java

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import com.oracle.truffle.api.dsl.GenerateCached;
2020
import com.oracle.truffle.api.dsl.GenerateInline;
2121
import com.oracle.truffle.api.dsl.NeverDefault;
22+
import com.oracle.truffle.api.dsl.NodeChild;
2223
import com.oracle.truffle.api.nodes.Node;
2324
import com.oracle.truffle.api.object.Shape;
2425
import com.oracle.truffle.api.profiles.InlinedBranchProfile;
@@ -104,7 +105,6 @@
104105
import com.oracle.truffle.api.dsl.Cached.Shared;
105106
import com.oracle.truffle.api.dsl.Cached.Exclusive;
106107
import com.oracle.truffle.api.dsl.ImportStatic;
107-
import com.oracle.truffle.api.dsl.NodeChild;
108108
import com.oracle.truffle.api.dsl.ReportPolymorphism;
109109
import com.oracle.truffle.api.dsl.Specialization;
110110
import com.oracle.truffle.api.frame.VirtualFrame;
@@ -132,11 +132,9 @@ protected RubyArray allocate(RubyClass rubyClass) {
132132
}
133133

134134
@CoreMethod(names = "+", required = 1)
135-
@NodeChild(value = "a", type = RubyNode.class)
136-
@NodeChild(value = "b", type = RubyBaseNodeWithExecute.class)
137135
@ImportStatic(ArrayGuards.class)
138136
@ReportPolymorphism
139-
public abstract static class AddNode extends CoreMethodNode {
137+
public abstract static class AddNode extends CoreMethodArrayArgumentsNode {
140138

141139
@Specialization(
142140
limit = "storageStrategyLimit()")
@@ -760,11 +758,9 @@ public void checkFrozen(Object object) {
760758
}
761759

762760
@CoreMethod(names = "delete_at", required = 1, raiseIfFrozenSelf = true, lowerFixnum = 1)
763-
@NodeChild(value = "array", type = RubyNode.class)
764-
@NodeChild(value = "index", type = RubyBaseNodeWithExecute.class)
765761
@ImportStatic(ArrayGuards.class)
766762
@ReportPolymorphism
767-
public abstract static class DeleteAtNode extends CoreMethodNode {
763+
public abstract static class DeleteAtNode extends CoreMethodArrayArgumentsNode {
768764

769765
@Specialization(limit = "storageStrategyLimit()")
770766
protected static Object doDelete(RubyArray array, Object indexObject,
@@ -1293,10 +1289,8 @@ protected Object callToAry(Object object) {
12931289
}
12941290

12951291
@CoreMethod(names = "initialize_copy", required = 1, raiseIfFrozenSelf = true)
1296-
@NodeChild(value = "self", type = RubyNode.class)
1297-
@NodeChild(value = "from", type = RubyBaseNodeWithExecute.class)
12981292
@ImportStatic(ArrayGuards.class)
1299-
public abstract static class InitializeCopyNode extends CoreMethodNode {
1293+
public abstract static class InitializeCopyNode extends CoreMethodArrayArgumentsNode {
13001294

13011295
@Specialization
13021296
protected RubyArray initializeCopy(RubyArray self, Object fromObject,
@@ -1517,11 +1511,9 @@ public void accept(Node node, CallBlockNode yieldNode, RubyArray array, Object s
15171511

15181512
}
15191513

1520-
@NodeChild(value = "array", type = RubyNode.class)
1521-
@NodeChild(value = "format", type = RubyBaseNodeWithExecute.class)
15221514
@CoreMethod(names = "pack", required = 1)
15231515
@ReportPolymorphism
1524-
public abstract static class ArrayPackNode extends CoreMethodNode {
1516+
public abstract static class ArrayPackNode extends CoreMethodArrayArgumentsNode {
15251517

15261518
@Specialization
15271519
protected RubyString pack(RubyArray array, Object format,

src/main/java/org/truffleruby/core/binding/BindingNodes.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,12 @@
3131
import org.truffleruby.annotations.Primitive;
3232
import org.truffleruby.annotations.Visibility;
3333
import org.truffleruby.builtins.CoreMethodArrayArgumentsNode;
34-
import org.truffleruby.builtins.CoreMethodNode;
3534
import org.truffleruby.builtins.PrimitiveArrayArgumentsNode;
3635
import org.truffleruby.core.array.ArrayHelpers;
3736
import org.truffleruby.core.array.RubyArray;
3837
import org.truffleruby.core.cast.NameToJavaStringNode;
3938
import org.truffleruby.core.klass.RubyClass;
4039
import org.truffleruby.language.RubyBaseNode;
41-
import org.truffleruby.language.RubyBaseNodeWithExecute;
42-
import org.truffleruby.language.RubyNode;
4340
import org.truffleruby.language.arguments.RubyArguments;
4441
import org.truffleruby.language.control.RaiseException;
4542
import org.truffleruby.language.locals.FindDeclarationVariableNodes;
@@ -51,7 +48,6 @@
5148
import com.oracle.truffle.api.Truffle;
5249
import com.oracle.truffle.api.dsl.Cached;
5350
import com.oracle.truffle.api.dsl.ImportStatic;
54-
import com.oracle.truffle.api.dsl.NodeChild;
5551
import com.oracle.truffle.api.dsl.ReportPolymorphism;
5652
import com.oracle.truffle.api.dsl.Specialization;
5753
import com.oracle.truffle.api.frame.Frame;
@@ -214,9 +210,7 @@ protected int getCacheLimit() {
214210

215211
@ImportStatic({ BindingNodes.class, FindDeclarationVariableNodes.class })
216212
@CoreMethod(names = "local_variable_defined?", required = 1)
217-
@NodeChild(value = "bindingNode", type = RubyNode.class)
218-
@NodeChild(value = "nameNode", type = RubyBaseNodeWithExecute.class)
219-
public abstract static class BindingLocalVariableDefinedNode extends CoreMethodNode {
213+
public abstract static class BindingLocalVariableDefinedNode extends CoreMethodArrayArgumentsNode {
220214

221215
@Specialization
222216
protected boolean localVariableDefined(RubyBinding binding, Object nameObject,
@@ -268,10 +262,8 @@ protected int getCacheLimit() {
268262
}
269263

270264
@CoreMethod(names = "local_variable_get", required = 1)
271-
@NodeChild(value = "bindingNode", type = RubyNode.class)
272-
@NodeChild(value = "nameNode", type = RubyBaseNodeWithExecute.class)
273265
@ImportStatic(BindingNodes.class)
274-
public abstract static class BindingLocalVariableGetNode extends CoreMethodNode {
266+
public abstract static class BindingLocalVariableGetNode extends CoreMethodArrayArgumentsNode {
275267

276268
@Specialization
277269
protected Object localVariableGet(RubyBinding binding, Object nameObject,
@@ -314,10 +306,7 @@ protected static Object localVariableGetLastLine(Node node, RubyBinding binding,
314306

315307
@ReportPolymorphism
316308
@CoreMethod(names = "local_variable_set", required = 2)
317-
@NodeChild(value = "bindingNode", type = RubyNode.class)
318-
@NodeChild(value = "nameNode", type = RubyBaseNodeWithExecute.class)
319-
@NodeChild(value = "valueNode", type = RubyNode.class)
320-
public abstract static class BindingLocalVariableSetNode extends CoreMethodNode {
309+
public abstract static class BindingLocalVariableSetNode extends CoreMethodArrayArgumentsNode {
321310

322311
@Specialization
323312
protected Object localVariableSet(RubyBinding binding, Object nameObject, Object value,

src/main/java/org/truffleruby/core/kernel/KernelNodes.java

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.truffleruby.RubyContext;
3737
import org.truffleruby.annotations.CoreMethod;
3838
import org.truffleruby.builtins.CoreMethodArrayArgumentsNode;
39-
import org.truffleruby.builtins.CoreMethodNode;
4039
import org.truffleruby.annotations.CoreModule;
4140
import org.truffleruby.builtins.NonStandard;
4241
import org.truffleruby.annotations.Primitive;
@@ -99,7 +98,6 @@
9998
import org.truffleruby.language.Nil;
10099
import org.truffleruby.language.NotProvided;
101100
import org.truffleruby.language.RubyBaseNode;
102-
import org.truffleruby.language.RubyBaseNodeWithExecute;
103101
import org.truffleruby.language.RubyContextSourceNode;
104102
import org.truffleruby.language.RubyDynamicObject;
105103
import org.truffleruby.language.RubyGuards;
@@ -1237,9 +1235,7 @@ protected RubyMethod method(Frame callerFrame, Object self, Object[] rubyArgs, R
12371235
}
12381236

12391237
@CoreMethod(names = "methods", optional = 1)
1240-
@NodeChild(value = "object", type = RubyNode.class)
1241-
@NodeChild(value = "regular", type = RubyBaseNodeWithExecute.class)
1242-
public abstract static class KernelMethodsNode extends CoreMethodNode {
1238+
public abstract static class KernelMethodsNode extends CoreMethodArrayArgumentsNode {
12431239

12441240
@Specialization
12451241
protected RubyArray doMethods(Object self, Object maybeRegular,
@@ -1307,9 +1303,7 @@ private void print(Object inspected) {
13071303
}
13081304

13091305
@CoreMethod(names = "private_methods", optional = 1)
1310-
@NodeChild(value = "object", type = RubyNode.class)
1311-
@NodeChild(value = "includeAncestors", type = RubyBaseNodeWithExecute.class)
1312-
public abstract static class PrivateMethodsNode extends CoreMethodNode {
1306+
public abstract static class PrivateMethodsNode extends CoreMethodArrayArgumentsNode {
13131307

13141308
@TruffleBoundary
13151309
@Specialization
@@ -1339,9 +1333,7 @@ protected RubyProc proc(VirtualFrame frame, Object maybeBlock,
13391333
}
13401334

13411335
@CoreMethod(names = "protected_methods", optional = 1)
1342-
@NodeChild(value = "object", type = RubyNode.class)
1343-
@NodeChild(value = "includeAncestors", type = RubyBaseNodeWithExecute.class)
1344-
public abstract static class ProtectedMethodsNode extends CoreMethodNode {
1336+
public abstract static class ProtectedMethodsNode extends CoreMethodArrayArgumentsNode {
13451337

13461338
@TruffleBoundary
13471339
@Specialization
@@ -1375,9 +1367,7 @@ protected RubyMethod method(Frame callerFrame, Object self, Object[] rubyArgs, R
13751367
}
13761368

13771369
@CoreMethod(names = "public_methods", optional = 1)
1378-
@NodeChild(value = "object", type = RubyNode.class)
1379-
@NodeChild(value = "includeAncestors", type = RubyBaseNodeWithExecute.class)
1380-
public abstract static class PublicMethodsNode extends CoreMethodNode {
1370+
public abstract static class PublicMethodsNode extends CoreMethodArrayArgumentsNode {
13811371

13821372
@TruffleBoundary
13831373
@Specialization
@@ -1507,9 +1497,7 @@ protected RubyClass singletonClass(Object self,
15071497
}
15081498

15091499
@CoreMethod(names = "singleton_method", required = 1)
1510-
@NodeChild(value = "object", type = RubyNode.class)
1511-
@NodeChild(value = "name", type = RubyBaseNodeWithExecute.class)
1512-
public abstract static class SingletonMethodNode extends CoreMethodNode {
1500+
public abstract static class SingletonMethodNode extends CoreMethodArrayArgumentsNode {
15131501

15141502
@Specialization
15151503
protected RubyMethod singletonMethod(Object self, Object nameObject,
@@ -1543,9 +1531,7 @@ protected RubyMethod singletonMethod(Object self, Object nameObject,
15431531
}
15441532

15451533
@CoreMethod(names = "singleton_methods", optional = 1)
1546-
@NodeChild(value = "object", type = RubyNode.class)
1547-
@NodeChild(value = "includeAncestors", type = RubyBaseNodeWithExecute.class)
1548-
public abstract static class KernelSingletonMethodsNode extends CoreMethodNode {
1534+
public abstract static class KernelSingletonMethodsNode extends CoreMethodArrayArgumentsNode {
15491535

15501536
@Specialization
15511537
protected RubyArray singletonMethods(Object self, Object maybeIncludeAncestors,
@@ -1643,9 +1629,7 @@ public static long sleepFor(RubyContext context, RubyThread thread, long duratio
16431629

16441630
@CoreMethod(names = { "format", "sprintf" }, isModuleFunction = true, rest = true, required = 1)
16451631
@ReportPolymorphism
1646-
@NodeChild(value = "format", type = RubyBaseNodeWithExecute.class)
1647-
@NodeChild(value = "arguments", type = RubyBaseNodeWithExecute.class)
1648-
public abstract static class SprintfNode extends CoreMethodNode {
1632+
public abstract static class SprintfNode extends CoreMethodArrayArgumentsNode {
16491633

16501634
@Child private ReadGlobalVariableNode readDebugGlobalNode = ReadGlobalVariableNodeGen.create("$DEBUG");
16511635

@@ -1858,8 +1842,7 @@ protected String toHexString(RubyBignum value) {
18581842
}
18591843

18601844
@CoreMethod(names = { "to_s", "inspect" }) // Basic #inspect, refined later in core
1861-
@NodeChild(value = "selfNode", type = RubyNode.class)
1862-
public abstract static class KernelToSNode extends CoreMethodNode {
1845+
public abstract static class KernelToSNode extends CoreMethodArrayArgumentsNode {
18631846

18641847
@Specialization
18651848
protected RubyString toS(Object self,

0 commit comments

Comments
 (0)