Skip to content

Commit d82e230

Browse files
author
Nicolas Laurent
committed
rename NewDispatchHeadNode to DispatchNode
1 parent 3288b87 commit d82e230

File tree

81 files changed

+431
-430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+431
-430
lines changed

src/main/java/org/truffleruby/builtins/EnumeratorSizeNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import org.truffleruby.language.RubyContextSourceNode;
1515
import org.truffleruby.language.RubyNode;
1616
import org.truffleruby.language.arguments.RubyArguments;
17-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
17+
import org.truffleruby.language.dispatch.DispatchNode;
1818

1919
import com.oracle.truffle.api.CompilerDirectives;
2020
import com.oracle.truffle.api.frame.VirtualFrame;
@@ -25,7 +25,7 @@
2525
public class EnumeratorSizeNode extends RubyContextSourceNode {
2626

2727
@Child private RubyNode method;
28-
@Child private NewDispatchHeadNode toEnumWithSize;
28+
@Child private DispatchNode toEnumWithSize;
2929

3030
private final ConditionProfile noBlockProfile = ConditionProfile.create();
3131

@@ -45,7 +45,7 @@ public Object execute(VirtualFrame frame) {
4545
if (noBlockProfile.profile(block == null)) {
4646
if (toEnumWithSize == null) {
4747
CompilerDirectives.transferToInterpreterAndInvalidate();
48-
toEnumWithSize = insert(NewDispatchHeadNode.create(PRIVATE));
48+
toEnumWithSize = insert(DispatchNode.create(PRIVATE));
4949
}
5050

5151
final Object self = RubyArguments.getSelf(frame);

src/main/java/org/truffleruby/builtins/ReturnEnumeratorIfNoBlockNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.truffleruby.language.RubyContextSourceNode;
1616
import org.truffleruby.language.RubyNode;
1717
import org.truffleruby.language.arguments.RubyArguments;
18-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
18+
import org.truffleruby.language.dispatch.DispatchNode;
1919

2020
import com.oracle.truffle.api.CompilerDirectives;
2121
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
@@ -28,7 +28,7 @@ public class ReturnEnumeratorIfNoBlockNode extends RubyContextSourceNode {
2828

2929
private final String methodName;
3030
@Child private RubyNode method;
31-
@Child private NewDispatchHeadNode toEnumNode;
31+
@Child private DispatchNode toEnumNode;
3232
@CompilationFinal private RubySymbol methodSymbol;
3333
private final ConditionProfile noBlockProfile = ConditionProfile.create();
3434

@@ -44,7 +44,7 @@ public Object execute(VirtualFrame frame) {
4444
if (noBlockProfile.profile(block == null)) {
4545
if (toEnumNode == null) {
4646
CompilerDirectives.transferToInterpreterAndInvalidate();
47-
toEnumNode = insert(NewDispatchHeadNode.create(PRIVATE));
47+
toEnumNode = insert(DispatchNode.create(PRIVATE));
4848
}
4949

5050
if (methodSymbol == null) {

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
import org.truffleruby.language.control.BreakException;
8282
import org.truffleruby.language.control.BreakID;
8383
import org.truffleruby.language.control.RaiseException;
84-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
84+
import org.truffleruby.language.dispatch.DispatchNode;
8585
import org.truffleruby.language.methods.DeclarationContext;
8686
import org.truffleruby.language.methods.InternalMethod;
8787
import org.truffleruby.language.objects.AllocateHelperNode;
@@ -1094,14 +1094,14 @@ protected int write(RubyString string, int index, int value,
10941094
@CoreMethod(names = "rb_class_new", onSingleton = true, required = 1)
10951095
public abstract static class ClassNewNode extends CoreMethodArrayArgumentsNode {
10961096

1097-
@Child private NewDispatchHeadNode allocateNode;
1097+
@Child private DispatchNode allocateNode;
10981098
@Child private InitializeClassNode initializeClassNode;
10991099

11001100
@Specialization
11011101
protected RubyClass classNew(RubyClass superclass) {
11021102
if (allocateNode == null) {
11031103
CompilerDirectives.transferToInterpreterAndInvalidate();
1104-
allocateNode = insert(NewDispatchHeadNode.create(PRIVATE));
1104+
allocateNode = insert(DispatchNode.create(PRIVATE));
11051105
initializeClassNode = insert(InitializeClassNodeGen.create(false));
11061106
}
11071107

@@ -1115,7 +1115,7 @@ protected RubyClass classNew(RubyClass superclass) {
11151115
@CoreMethod(names = "rb_tr_debug", onSingleton = true, rest = true)
11161116
public abstract static class DebugNode extends CoreMethodArrayArgumentsNode {
11171117

1118-
@Child NewDispatchHeadNode toSCall;
1118+
@Child DispatchNode toSCall;
11191119

11201120
@TruffleBoundary
11211121
@Specialization
@@ -1154,7 +1154,7 @@ protected Object debug(Object... objects) {
11541154
private RubyString callToS(Object object) {
11551155
if (toSCall == null) {
11561156
CompilerDirectives.transferToInterpreterAndInvalidate();
1157-
toSCall = insert(NewDispatchHeadNode.create(PRIVATE));
1157+
toSCall = insert(DispatchNode.create(PRIVATE));
11581158
}
11591159

11601160
return (RubyString) toSCall.call(object, "to_s");

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import static org.truffleruby.core.array.ArrayHelpers.setSize;
1313
import static org.truffleruby.core.array.ArrayHelpers.setStoreAndSize;
14-
import static org.truffleruby.language.dispatch.NewDispatchHeadNode.PUBLIC;
14+
import static org.truffleruby.language.dispatch.DispatchNode.PUBLIC;
1515
import static org.truffleruby.language.dispatch.DispatchConfiguration.PRIVATE;
1616

1717
import java.util.Arrays;
@@ -70,7 +70,7 @@
7070
import org.truffleruby.language.RubyNode;
7171
import org.truffleruby.language.Visibility;
7272
import org.truffleruby.language.control.RaiseException;
73-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
73+
import org.truffleruby.language.dispatch.DispatchNode;
7474
import org.truffleruby.language.library.RubyLibrary;
7575
import org.truffleruby.language.objects.AllocateHelperNode;
7676
import org.truffleruby.language.objects.PropagateTaintNode;
@@ -969,13 +969,13 @@ protected Object value(Object[] args) {
969969

970970
@Specialization
971971
protected Object fillFallback(VirtualFrame frame, RubyArray array, Object[] args, NotProvided block,
972-
@Cached(parameters = "PRIVATE") NewDispatchHeadNode callFillInternal) {
972+
@Cached(parameters = "PRIVATE") DispatchNode callFillInternal) {
973973
return callFillInternal.call(array, "fill_internal", args);
974974
}
975975

976976
@Specialization
977977
protected Object fillFallback(VirtualFrame frame, RubyArray array, Object[] args, RubyProc block,
978-
@Cached(parameters = "PRIVATE") NewDispatchHeadNode callFillInternal) {
978+
@Cached(parameters = "PRIVATE") DispatchNode callFillInternal) {
979979
return callFillInternal.callWithBlock(array, "fill_internal", block, args);
980980
}
981981

@@ -990,7 +990,7 @@ public abstract static class HashNode extends ArrayCoreMethodNode {
990990
@Specialization(limit = "storageStrategyLimit()")
991991
protected long hash(VirtualFrame frame, RubyArray array,
992992
@CachedLibrary("array.store") ArrayStoreLibrary stores,
993-
@Cached(parameters = "PRIVATE") NewDispatchHeadNode toHashNode,
993+
@Cached(parameters = "PRIVATE") DispatchNode toHashNode,
994994
@Cached ToLongNode toLongNode,
995995
@Cached("createCountingProfile()") LoopConditionProfile loopProfile) {
996996
final int size = array.size;
@@ -1047,7 +1047,7 @@ protected boolean include(RubyArray array, Object value,
10471047
public abstract static class InitializeNode extends YieldingCoreMethodNode {
10481048

10491049
@Child private ToIntNode toIntNode;
1050-
@Child private NewDispatchHeadNode toAryNode;
1050+
@Child private DispatchNode toAryNode;
10511051
@Child private KernelNodes.RespondToNode respondToToAryNode;
10521052

10531053
protected abstract RubyArray executeInitialize(RubyArray array, Object size, Object fillingValue,
@@ -1215,7 +1215,7 @@ public boolean respondToToAry(Object object) {
12151215
protected Object callToAry(Object object) {
12161216
if (toAryNode == null) {
12171217
CompilerDirectives.transferToInterpreterAndInvalidate();
1218-
toAryNode = insert(NewDispatchHeadNode.create(PRIVATE));
1218+
toAryNode = insert(DispatchNode.create(PRIVATE));
12191219
}
12201220
return toAryNode.call(object, "to_ary");
12211221
}
@@ -1258,7 +1258,7 @@ protected RubyArray initializeCopy(RubyArray self, RubyArray from,
12581258
@ReportPolymorphism
12591259
public abstract static class InjectNode extends YieldingCoreMethodNode {
12601260

1261-
@Child private NewDispatchHeadNode dispatch = NewDispatchHeadNode.create(PUBLIC);
1261+
@Child private DispatchNode dispatch = DispatchNode.create(PUBLIC);
12621262

12631263
// With block
12641264

@@ -2094,7 +2094,7 @@ protected RubyArray sortEmpty(RubyArray array, Object unusedBlock) {
20942094
protected RubyArray sortVeryShort(VirtualFrame frame, RubyArray array, NotProvided block,
20952095
@CachedLibrary("array.store") ArrayStoreLibrary originalStores,
20962096
@CachedLibrary(limit = "1") ArrayStoreLibrary stores,
2097-
@Cached(parameters = "PRIVATE") NewDispatchHeadNode compareDispatchNode,
2097+
@Cached(parameters = "PRIVATE") DispatchNode compareDispatchNode,
20982098
@Cached CmpIntNode cmpIntNode) {
20992099
final Object originalStore = array.store;
21002100
final Object store = originalStores
@@ -2156,13 +2156,13 @@ protected Object sortPrimitiveArrayNoBlock(RubyArray array, NotProvided block,
21562156
limit = "storageStrategyLimit()")
21572157
protected Object sortArrayWithoutBlock(RubyArray array, NotProvided block,
21582158
@CachedLibrary("array.store") ArrayStoreLibrary stores,
2159-
@Cached(parameters = "PRIVATE") NewDispatchHeadNode fallbackNode) {
2159+
@Cached(parameters = "PRIVATE") DispatchNode fallbackNode) {
21602160
return fallbackNode.call(array, "sort_fallback");
21612161
}
21622162

21632163
@Specialization(guards = "!isEmptyArray(array)")
21642164
protected Object sortGenericWithBlock(RubyArray array, RubyProc block,
2165-
@Cached(parameters = "PRIVATE") NewDispatchHeadNode fallbackNode) {
2165+
@Cached(parameters = "PRIVATE") DispatchNode fallbackNode) {
21662166
return fallbackNode.callWithBlock(array, "sort_fallback", block);
21672167
}
21682168

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
import org.truffleruby.language.RubyDynamicObject;
1515
import org.truffleruby.language.RubyGuards;
16-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
16+
import org.truffleruby.language.dispatch.DispatchNode;
1717
import org.truffleruby.language.library.RubyLibrary;
1818
import org.truffleruby.language.objects.ObjectGraph;
1919
import org.truffleruby.language.objects.ObjectGraphNode;
@@ -61,7 +61,7 @@ public long getArraySize() {
6161
@ExportMessage
6262
public Object readArrayElement(long index,
6363
@Cached @Shared("error") BranchProfile errorProfile,
64-
@Cached @Exclusive NewDispatchHeadNode dispatch) throws InvalidArrayIndexException {
64+
@Cached @Exclusive DispatchNode dispatch) throws InvalidArrayIndexException {
6565
if (inBounds(index)) {
6666
// FIXME (pitr 11-Feb-2020): use ArrayReadNormalizedNode
6767
// @Cached ArrayReadNormalizedNode readNode
@@ -76,7 +76,7 @@ public Object readArrayElement(long index,
7676
@ExportMessage
7777
public void writeArrayElement(long index, Object value,
7878
@Cached @Shared("error") BranchProfile errorProfile,
79-
@Cached @Exclusive NewDispatchHeadNode dispatch) throws InvalidArrayIndexException {
79+
@Cached @Exclusive DispatchNode dispatch) throws InvalidArrayIndexException {
8080
if (index >= 0 && RubyGuards.fitsInInteger(index)) {
8181
// FIXME (pitr 11-Feb-2020): use ArrayWriteNormalizedNode
8282
// @Cached ArrayWriteNormalizedNode writeNode
@@ -90,7 +90,7 @@ public void writeArrayElement(long index, Object value,
9090

9191
@ExportMessage
9292
public void removeArrayElement(long index,
93-
@Cached @Exclusive NewDispatchHeadNode dispatch,
93+
@Cached @Exclusive DispatchNode dispatch,
9494
@Cached @Shared("error") BranchProfile errorProfile) throws InvalidArrayIndexException {
9595
if (inBounds(index)) {
9696
// FIXME (pitr 11-Feb-2020): use delete-at node directly

src/main/java/org/truffleruby/core/basicobject/BasicObjectNodes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
import org.truffleruby.language.arguments.ReadCallerFrameNode;
4141
import org.truffleruby.language.arguments.RubyArguments;
4242
import org.truffleruby.language.control.RaiseException;
43-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
43+
import org.truffleruby.language.dispatch.DispatchNode;
4444
import org.truffleruby.language.dispatch.RubyCallNode;
4545
import org.truffleruby.language.eval.CreateEvalSourceNode;
4646
import org.truffleruby.language.loader.CodeLoader;
@@ -96,7 +96,7 @@ protected boolean not(Object value,
9696
@CoreMethod(names = "!=", required = 1)
9797
public abstract static class NotEqualNode extends CoreMethodArrayArgumentsNode {
9898

99-
@Child private NewDispatchHeadNode equalNode = NewDispatchHeadNode.create(PRIVATE);
99+
@Child private DispatchNode equalNode = DispatchNode.create(PRIVATE);
100100
@Child private BooleanCastNode booleanCastNode = BooleanCastNode.create();
101101

102102
@Specialization
@@ -584,7 +584,7 @@ private boolean lastCallWasVCall(FrameAndCallNode callerFrame) {
584584
@CoreMethod(names = "__send__", needsBlock = true, rest = true, required = 1)
585585
public abstract static class SendNode extends CoreMethodArrayArgumentsNode {
586586

587-
@Child private NewDispatchHeadNode dispatchNode = NewDispatchHeadNode.create(NewDispatchHeadNode.PRIVATE);
587+
@Child private DispatchNode dispatchNode = DispatchNode.create(DispatchNode.PRIVATE);
588588
@Child private ReadCallerFrameNode readCallerFrame = ReadCallerFrameNode.create();
589589

590590
@Specialization

src/main/java/org/truffleruby/core/cast/ArrayCastNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.truffleruby.language.RubyGuards;
1919
import org.truffleruby.language.RubyNode;
2020
import org.truffleruby.language.control.RaiseException;
21-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
21+
import org.truffleruby.language.dispatch.DispatchNode;
2222
import com.oracle.truffle.api.CompilerDirectives;
2323
import com.oracle.truffle.api.dsl.Cached;
2424
import com.oracle.truffle.api.dsl.NodeChild;
@@ -38,7 +38,7 @@ public abstract class ArrayCastNode extends RubyContextSourceNode {
3838

3939
private final SplatCastNode.NilBehavior nilBehavior;
4040

41-
@Child private NewDispatchHeadNode toArrayNode = NewDispatchHeadNode.create(PRIVATE_RETURN_MISSING);
41+
@Child private DispatchNode toArrayNode = DispatchNode.create(PRIVATE_RETURN_MISSING);
4242

4343
public static ArrayCastNode create() {
4444
return ArrayCastNodeGen.create(null);
@@ -112,7 +112,7 @@ protected Object cast(RubyDynamicObject object,
112112
return nil;
113113
}
114114

115-
if (result == NewDispatchHeadNode.MISSING) {
115+
if (result == DispatchNode.MISSING) {
116116
return nil;
117117
}
118118

src/main/java/org/truffleruby/core/cast/CmpIntNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import org.truffleruby.language.Nil;
2727
import org.truffleruby.language.RubyContextNode;
2828
import org.truffleruby.language.control.RaiseException;
29-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
29+
import org.truffleruby.language.dispatch.DispatchNode;
3030

3131
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
3232
import com.oracle.truffle.api.dsl.Cached;
@@ -79,8 +79,8 @@ private String formatMessage(Object receiver, Object other) {
7979

8080
@Specialization(guards = { "!isRubyInteger(value)", "!isNil(value)" })
8181
protected int cmpObject(Object value, Object receiver, Object other,
82-
@Cached(parameters = "PRIVATE") NewDispatchHeadNode gtNode,
83-
@Cached(parameters = "PRIVATE") NewDispatchHeadNode ltNode,
82+
@Cached(parameters = "PRIVATE") DispatchNode gtNode,
83+
@Cached(parameters = "PRIVATE") DispatchNode ltNode,
8484
@Cached BooleanCastNode gtCastNode,
8585
@Cached BooleanCastNode ltCastNode) {
8686

src/main/java/org/truffleruby/core/cast/HashCastNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.truffleruby.language.RubyGuards;
1818
import org.truffleruby.language.RubyNode;
1919
import org.truffleruby.language.control.RaiseException;
20-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
20+
import org.truffleruby.language.dispatch.DispatchNode;
2121
import com.oracle.truffle.api.dsl.Cached;
2222
import com.oracle.truffle.api.dsl.NodeChild;
2323
import com.oracle.truffle.api.dsl.Specialization;
@@ -31,7 +31,7 @@
3131
@NodeChild(value = "child", type = RubyNode.class)
3232
public abstract class HashCastNode extends RubyContextSourceNode {
3333

34-
@Child private NewDispatchHeadNode toHashNode = NewDispatchHeadNode.create(PRIVATE_RETURN_MISSING);
34+
@Child private DispatchNode toHashNode = DispatchNode.create(PRIVATE_RETURN_MISSING);
3535

3636
protected abstract RubyNode getChild();
3737

@@ -75,7 +75,7 @@ protected Object cast(RubyDynamicObject object,
7575
@Cached BranchProfile errorProfile) {
7676
final Object result = toHashNode.call(object, "to_hash");
7777

78-
if (result == NewDispatchHeadNode.MISSING) {
78+
if (result == DispatchNode.MISSING) {
7979
return nil;
8080
}
8181

src/main/java/org/truffleruby/core/cast/NameToJavaStringNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.truffleruby.language.RubyNode;
2121
import org.truffleruby.language.RubySourceNode;
2222
import org.truffleruby.language.control.RaiseException;
23-
import org.truffleruby.language.dispatch.NewDispatchHeadNode;
23+
import org.truffleruby.language.dispatch.DispatchNode;
2424
import org.truffleruby.utils.Utils;
2525

2626
import com.oracle.truffle.api.dsl.Cached;
@@ -74,7 +74,7 @@ protected String nameToJavaString(String value) {
7474
protected String nameToJavaString(Object object,
7575
@CachedContext(RubyLanguage.class) RubyContext context,
7676
@Cached BranchProfile errorProfile,
77-
@Cached NewDispatchHeadNode toStr) {
77+
@Cached DispatchNode toStr) {
7878
final Object coerced;
7979

8080
try {

0 commit comments

Comments
 (0)