Skip to content

Commit 13b0af6

Browse files
committed
Make DispatchConfiguration the first argument for readability
1 parent e3d1cc9 commit 13b0af6

File tree

12 files changed

+64
-65
lines changed

12 files changed

+64
-65
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,15 @@ public Object sendWithoutCExtLock(VirtualFrame frame, Object receiver, RubySymbo
327327
MutexOperations.unlockInternal(lock);
328328
}
329329
try {
330-
return dispatchNode.callWithFrameAndBlock(frame, receiver, method.getString(), config, block,
330+
return dispatchNode.callWithFrameAndBlock(config, frame, receiver, method.getString(), block,
331331
descriptor, args);
332332
} finally {
333333
if (owned) {
334334
MutexOperations.internalLockEvenWithException(getContext(), lock, this);
335335
}
336336
}
337337
} else {
338-
return dispatchNode.callWithFrameAndBlock(frame, receiver, method.getString(), config, block,
338+
return dispatchNode.callWithFrameAndBlock(config, frame, receiver, method.getString(), block,
339339
descriptor, args);
340340
}
341341
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected RubyArray cast(Object object,
3333
@Cached ConditionProfile canCast,
3434
@Cached ArrayBuilderNode arrayBuilder,
3535
@Cached DispatchNode toArrayNode) {
36-
final Object result = toArrayNode.call(object, "to_ary", PRIVATE_RETURN_MISSING);
36+
final Object result = toArrayNode.call(PRIVATE_RETURN_MISSING, object, "to_ary");
3737
if (canCast.profile(result instanceof RubyArray)) {
3838
return (RubyArray) result;
3939
} else {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ private Object injectSymbolHelper(VirtualFrame frame, RubyArray array, String sy
14381438
int n = start;
14391439
try {
14401440
for (; loopProfile.inject(n < arraySizeProfile.profile(array.size)); n++) {
1441-
accumulator = dispatch.callWithFrame(frame, accumulator, symbol, PUBLIC, stores.read(store, n));
1441+
accumulator = dispatch.callWithFrame(PUBLIC, frame, accumulator, symbol, stores.read(store, n));
14421442
TruffleSafepoint.poll(this);
14431443
}
14441444
} finally {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected RubyHash castHash(RubyHash hash) {
3838
protected RubyHash cast(Object object,
3939
@Cached InlinedBranchProfile errorProfile,
4040
@Cached DispatchNode toHashNode) {
41-
final Object result = toHashNode.call(object, "to_hash", PRIVATE_RETURN_MISSING);
41+
final Object result = toHashNode.call(PRIVATE_RETURN_MISSING, object, "to_hash");
4242

4343
if (result == DispatchNode.MISSING) {
4444
errorProfile.enter(this);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private Object callToA(Object nil) {
121121
CompilerDirectives.transferToInterpreterAndInvalidate();
122122
toA = insert(DispatchNode.create());
123123
}
124-
return toA.call(nil, "to_a", PRIVATE_RETURN_MISSING);
124+
return toA.call(PRIVATE_RETURN_MISSING, nil, "to_a");
125125
}
126126

127127
private RubyArray executeDup(RubyArray array) {

src/main/java/org/truffleruby/core/format/convert/ToLongNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected static long toLong(VirtualFrame frame, Object object,
8282
@Cached InlinedBranchProfile noConversionAvailable,
8383
@Bind("this") Node node) {
8484

85-
Object result = toIntNode.call(object, "to_int", PRIVATE_RETURN_MISSING);
85+
Object result = toIntNode.call(PRIVATE_RETURN_MISSING, object, "to_int");
8686
if (result == DispatchNode.MISSING) {
8787
noConversionAvailable.enter(node);
8888
throw new CantConvertException("can't convert Object to Integer");

src/main/java/org/truffleruby/core/format/convert/ToStringNode.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected Object toStringString(Object string,
110110
@Cached @Shared RubyStringLibrary libString,
111111
@Cached @Exclusive RubyStringLibrary argLibString) {
112112
if ("inspect".equals(conversionMethod)) {
113-
final Object value = getToStrNode().call(string, conversionMethod, PRIVATE_RETURN_MISSING);
113+
final Object value = getToStrNode().call(PRIVATE_RETURN_MISSING, string, conversionMethod);
114114

115115
if (libString.isRubyString(value)) {
116116
return value;
@@ -129,7 +129,7 @@ protected Object toString(RubyArray array,
129129
toSNode = insert(DispatchNode.create());
130130
}
131131

132-
final Object value = toSNode.call(array, "to_s", PRIVATE_RETURN_MISSING);
132+
final Object value = toSNode.call(PRIVATE_RETURN_MISSING, array, "to_s");
133133

134134
if (libString.isRubyString(value)) {
135135
return value;
@@ -142,7 +142,7 @@ protected Object toString(RubyArray array,
142142
guards = { "isNotRubyString(object)", "!isRubyArray(object)", "!isForeignObject(object)" })
143143
protected Object toString(Object object,
144144
@Cached @Shared RubyStringLibrary libString) {
145-
final Object value = getToStrNode().call(object, conversionMethod, PRIVATE_RETURN_MISSING);
145+
final Object value = getToStrNode().call(PRIVATE_RETURN_MISSING, object, conversionMethod);
146146

147147
if (libString.isRubyString(value)) {
148148
return value;

src/main/java/org/truffleruby/language/ImmutableRubyObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public Object invokeMember(String name, Object[] arguments,
147147
@Shared @Cached BranchProfile errorProfile)
148148
throws UnknownIdentifierException {
149149
Object[] convertedArguments = foreignToRubyArgumentsNode.executeConvert(arguments);
150-
Object result = dispatchMember.call(this, name, PRIVATE_RETURN_MISSING, convertedArguments);
150+
Object result = dispatchMember.call(PRIVATE_RETURN_MISSING, this, name, convertedArguments);
151151
if (result == DispatchNode.MISSING) {
152152
errorProfile.enter();
153153
throw UnknownIdentifierException.create(name);

0 commit comments

Comments
 (0)