Skip to content

Commit bd8b36f

Browse files
committed
Remove redundant ConditionProfile
1 parent 28b1e62 commit bd8b36f

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/main/java/org/truffleruby/language/dispatch/DispatchNode.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public static DispatchNode getUncached() {
7878
@Child protected ToSymbolNode toSymbol;
7979

8080
protected final ConditionProfile methodMissing;
81-
protected final ConditionProfile isForeignCall;
8281
protected final BranchProfile methodMissingMissing;
8382

8483
protected DispatchNode(
@@ -87,14 +86,12 @@ protected DispatchNode(
8786
LookupMethodNode methodLookup,
8887
CallInternalMethodNode callNode,
8988
ConditionProfile methodMissing,
90-
ConditionProfile isForeignCall,
9189
BranchProfile methodMissingMissing) {
9290
this.config = config;
9391
this.metaclassNode = metaclassNode;
9492
this.methodLookup = methodLookup;
9593
this.callNode = callNode;
9694
this.methodMissing = methodMissing;
97-
this.isForeignCall = isForeignCall;
9895
this.methodMissingMissing = methodMissingMissing;
9996
}
10097

@@ -105,7 +102,6 @@ protected DispatchNode(DispatchConfiguration config) {
105102
LookupMethodNode.create(),
106103
CallInternalMethodNode.create(),
107104
ConditionProfile.create(),
108-
ConditionProfile.create(),
109105
BranchProfile.create());
110106
}
111107

@@ -131,7 +127,8 @@ public Object execute(VirtualFrame frame, Object receiver, String methodName, Ru
131127
case RETURN_MISSING:
132128
return MISSING;
133129
case CALL_METHOD_MISSING:
134-
if (isForeignCall.profile(metaclass == getContext().getCoreLibrary().truffleInteropForeignClass)) {
130+
// Both branches implicitly profile through lazy node creation
131+
if (metaclass == getContext().getCoreLibrary().truffleInteropForeignClass) {
135132
return callForeign(receiver, methodName, block, arguments);
136133
} else {
137134
return callMethodMissing(frame, receiver, methodName, block, arguments);
@@ -239,7 +236,6 @@ protected Uncached(DispatchConfiguration config) {
239236
LookupMethodNodeGen.getUncached(),
240237
CallInternalMethodNodeGen.getUncached(),
241238
ConditionProfile.getUncached(),
242-
ConditionProfile.getUncached(),
243239
BranchProfile.getUncached());
244240
}
245241

0 commit comments

Comments
 (0)