Skip to content

Commit ffb5939

Browse files
author
Nicolas Laurent
committed
[GR-25975] Remove redundant branches in RubyCallNode.
PullRequest: truffleruby/2015
2 parents c947b35 + 69b48ff commit ffb5939

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.truffleruby.language.RubyBaseNode;
2222
import org.truffleruby.language.RubyContextSourceNode;
2323
import org.truffleruby.language.RubyNode;
24-
import org.truffleruby.language.arguments.RubyArguments;
2524
import org.truffleruby.language.methods.BlockDefinitionNode;
2625
import org.truffleruby.language.methods.InternalMethod;
2726

@@ -189,8 +188,6 @@ private class DefinedNode extends RubyBaseNode {
189188
private final BranchProfile allArgumentsDefinedProfile = BranchProfile.create();
190189
private final BranchProfile receiverExceptionProfile = BranchProfile.create();
191190
private final ConditionProfile methodNotFoundProfile = ConditionProfile.create();
192-
private final ConditionProfile methodUndefinedProfile = ConditionProfile.create();
193-
private final ConditionProfile methodNotVisibleProfile = ConditionProfile.create();
194191

195192
@ExplodeLoop
196193
public Object isDefined(VirtualFrame frame, RubyContext context) {
@@ -217,26 +214,16 @@ public Object isDefined(VirtualFrame frame, RubyContext context) {
217214
}
218215

219216
final InternalMethod method = lookupMethodNode.lookup(frame, receiverObject, methodName, dispatchConfig);
220-
final Object self = RubyArguments.getSelf(frame);
221217

222218
if (methodNotFoundProfile.profile(method == null)) {
223219
final Object r = respondToMissing.call(receiverObject, "respond_to_missing?", methodNameSymbol, false);
224220

225221
if (r != DispatchNode.MISSING && !respondToMissingCast.executeToBoolean(r)) {
226222
return nil;
227223
}
228-
} else if (methodUndefinedProfile.profile(method.isUndefined())) {
229-
return nil;
230-
} else if (methodNotVisibleProfile
231-
.profile(!dispatchConfig.ignoreVisibility && !isVisibleTo(method, self))) {
232-
return nil;
233224
}
234225

235226
return coreStrings().METHOD.createInstance(context);
236227
}
237-
238-
private boolean isVisibleTo(InternalMethod method, Object self) {
239-
return method.isVisibleTo(coreLibrary().getMetaClass(self));
240-
}
241228
}
242229
}

0 commit comments

Comments
 (0)