Skip to content

Commit 484a614

Browse files
committed
Rename BooleanCastNode execute*() methods to just execute()
1 parent a695fb1 commit 484a614

28 files changed

+65
-65
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,7 @@ protected Object reject(RubyArray array, RubyProc block,
17901790
for (; loopProfile.inject(n < arraySizeProfile.profile(array.size)); n++) {
17911791
final Object value = stores.read(store, n);
17921792

1793-
if (!booleanCastNode.executeToBoolean(callBlock(block, value))) {
1793+
if (!booleanCastNode.execute(callBlock(block, value))) {
17941794
arrayBuilder.appendValue(state, selectedSize, value);
17951795
selectedSize++;
17961796
}
@@ -1856,7 +1856,7 @@ private Object rejectInPlaceInternal(RubyArray array, RubyProc block, ArrayStore
18561856
try {
18571857
for (; loop1Profile.inject(n < arraySizeProfile.profile(array.size)); n++) {
18581858
final Object value = stores.read(store, n);
1859-
if (booleanCastNode.executeToBoolean(callBlock(block, value))) {
1859+
if (booleanCastNode.execute(callBlock(block, value))) {
18601860
continue;
18611861
}
18621862

@@ -2080,7 +2080,7 @@ protected Object select(RubyArray array, RubyProc block,
20802080
for (; loopProfile.inject(n < arraySizeProfile.profile(array.size)); n++) {
20812081
final Object value = stores.read(store, n);
20822082

2083-
if (booleanCastNode.executeToBoolean(callBlock(block, value))) {
2083+
if (booleanCastNode.execute(callBlock(block, value))) {
20842084
arrayBuilder.appendValue(state, selectedSize, value);
20852085
selectedSize++;
20862086
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public abstract static class NotNode extends UnaryCoreMethodNode {
9090
@Specialization
9191
protected boolean not(Object value,
9292
@Cached BooleanCastNode cast) {
93-
return !cast.executeToBoolean(value);
93+
return !cast.execute(value);
9494
}
9595

9696
}
@@ -103,7 +103,7 @@ public abstract static class NotEqualNode extends CoreMethodArrayArgumentsNode {
103103

104104
@Specialization
105105
protected boolean equal(VirtualFrame frame, Object a, Object b) {
106-
return !booleanCastNode.executeToBoolean(equalNode.call(a, "==", b));
106+
return !booleanCastNode.execute(equalNode.call(a, "==", b));
107107
}
108108

109109
}

src/main/java/org/truffleruby/core/bool/FalseClassNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public abstract static class OrXorNode extends UnaryCoreMethodNode {
3535
@Specialization
3636
protected boolean orXor(Object other,
3737
@Cached BooleanCastNode cast) {
38-
return cast.executeToBoolean(other);
38+
return cast.execute(other);
3939
}
4040

4141
}

src/main/java/org/truffleruby/core/bool/TrueClassNodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public abstract static class AndNode extends UnaryCoreMethodNode {
2727
@Specialization
2828
protected boolean and(Object other,
2929
@Cached BooleanCastNode cast) {
30-
return cast.executeToBoolean(other);
30+
return cast.execute(other);
3131
}
3232
}
3333

@@ -46,7 +46,7 @@ public abstract static class XorNode extends UnaryCoreMethodNode {
4646
@Specialization
4747
protected boolean xor(Object other,
4848
@Cached BooleanCastNode cast) {
49-
return !cast.executeToBoolean(other);
49+
return !cast.execute(other);
5050
}
5151
}
5252

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public static BooleanCastNode create() {
3636
}
3737

3838
/** Execute with child node */
39-
public abstract boolean executeBoolean(VirtualFrame frame);
39+
public abstract boolean execute(VirtualFrame frame);
4040

4141
/** Execute with given value */
42-
public abstract boolean executeToBoolean(Object value);
42+
public abstract boolean execute(Object value);
4343

4444
@Specialization
4545
protected boolean doNil(Nil nil) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected boolean doDefault(NotProvided value) {
3939
@Fallback
4040
protected boolean fallback(Object value,
4141
@Cached BooleanCastNode booleanCastNode) {
42-
return booleanCastNode.executeToBoolean(value);
42+
return booleanCastNode.execute(value);
4343
}
4444

4545
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ protected int cmpObject(Object value, Object receiver, Object other,
8484
@Cached BooleanCastNode gtCastNode,
8585
@Cached BooleanCastNode ltCastNode) {
8686

87-
if (gtCastNode.executeToBoolean(gtNode.call(value, ">", 0))) {
87+
if (gtCastNode.execute(gtNode.call(value, ">", 0))) {
8888
return 1;
8989
}
9090

91-
if (ltCastNode.executeToBoolean(ltNode.call(value, "<", 0))) {
91+
if (ltCastNode.execute(ltNode.call(value, "<", 0))) {
9292
return -1;
9393
}
9494

src/main/java/org/truffleruby/core/hash/library/PackedHashStoreLibrary.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ private boolean callEqual(Object receiver, Object key) {
546546
booleanCastNode = insert(BooleanCastNode.create());
547547
}
548548

549-
return booleanCastNode.executeToBoolean(equalNode.call(receiver, "eql?", key));
549+
return booleanCastNode.execute(equalNode.call(receiver, "eql?", key));
550550
}
551551
}
552552

src/main/java/org/truffleruby/core/inlined/InlinedNotNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public InlinedNotNode(RubyLanguage language, RubyCallNodeParameters callNodePara
3333
protected boolean not(VirtualFrame frame, Object self,
3434
@Cached LookupMethodOnSelfNode lookupNode,
3535
@Cached BooleanCastNode booleanCastNode) {
36-
return !booleanCastNode.executeToBoolean(self);
36+
return !booleanCastNode.execute(self);
3737
}
3838

3939
@Specialization

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private boolean areEqual(Object left, Object right) {
202202
booleanCastNode = insert(BooleanCastNode.create());
203203
}
204204

205-
return booleanCastNode.executeToBoolean(equalNode.call(left, "==", right));
205+
return booleanCastNode.execute(equalNode.call(left, "==", right));
206206
}
207207

208208
}
@@ -244,7 +244,7 @@ protected boolean refEqualOrEql(Object a, Object b,
244244
@Cached ReferenceEqualNode referenceEqual,
245245
@Cached DispatchNode eql,
246246
@Cached BooleanCastNode booleanCast) {
247-
return referenceEqual.executeReferenceEqual(a, b) || booleanCast.executeToBoolean(eql.call(a, "eql?", b));
247+
return referenceEqual.executeReferenceEqual(a, b) || booleanCast.execute(eql.call(a, "eql?", b));
248248
}
249249
}
250250

@@ -1452,7 +1452,7 @@ protected boolean doesRespondTo(Frame callerFrame, Object self, Object[] rubyArg
14521452
final Object name = RubyArguments.getArgument(rubyArgs, 0);
14531453
final int nArgs = RubyArguments.getPositionalArgumentsCount(rubyArgs, false);
14541454
final boolean includeProtectedAndPrivate = nArgs >= 2 &&
1455-
castArgumentNode.executeToBoolean(RubyArguments.getArgument(rubyArgs, 1));
1455+
castArgumentNode.execute(RubyArguments.getArgument(rubyArgs, 1));
14561456

14571457
if (!RubyGuards.isRubySymbolOrString(name)) {
14581458
notSymbolOrStringProfile.enter();
@@ -1473,7 +1473,7 @@ protected boolean doesRespondTo(Frame callerFrame, Object self, Object[] rubyArg
14731473
return true;
14741474
} else if (respondToMissingProfile
14751475
.profile(dispatchRespondToMissing.execute(callerFrame, self, "respond_to_missing?"))) {
1476-
return castMissingResultNode.executeToBoolean(respondToMissingNode.call(self, "respond_to_missing?",
1476+
return castMissingResultNode.execute(respondToMissingNode.call(self, "respond_to_missing?",
14771477
toSymbolNode.execute(name), includeProtectedAndPrivate));
14781478
} else {
14791479
return false;
@@ -1709,7 +1709,7 @@ protected RubyString formatUncached(VirtualFrame frame, Object format, Object[]
17091709
@Cached IndirectCallNode callPackNode,
17101710
@CachedLibrary(limit = "LIBSTRING_CACHE") RubyStringLibrary libFormat) {
17111711
final BytesResult result;
1712-
final boolean isDebug = readDebugGlobalNode.executeBoolean(frame);
1712+
final boolean isDebug = readDebugGlobalNode.execute(frame);
17131713
try {
17141714
result = (BytesResult) callPackNode.call(
17151715
compileFormat(format, arguments, isDebug, libFormat),
@@ -1752,7 +1752,7 @@ protected RootCallTarget compileFormat(Object format, Object[] arguments, boolea
17521752
}
17531753

17541754
protected boolean isDebug(VirtualFrame frame) {
1755-
return readDebugGlobalNode.executeBoolean(frame);
1755+
return readDebugGlobalNode.execute(frame);
17561756
}
17571757

17581758
}

0 commit comments

Comments
 (0)