protected void lookup(VirtualFrame frame) {
CompilerAsserts.neverPartOfCompilation();
// TODO: this is wrong, we need the lexically enclosing method (or define_method)'s module
final RubyModule declaringModule = RubyCallStack.getCurrentMethod().getDeclaringModule();
final RubyClass selfMetaClass = getContext().getCoreLibrary().box(RubyArguments.getSelf(frame.getArguments())).getMetaClass();
method = ModuleOperations.lookupSuperMethod(declaringModule, name, selfMetaClass);
if (method == null || method.isUndefined()) {
method = null;
// TODO: should add " for #{receiver.inspect}" in error message
throw new RaiseException(getContext().getCoreLibrary().noMethodError("super: no superclass method `"+name+"'", this));
}
final DirectCallNode newCallNode = Truffle.getRuntime().createDirectCallNode(method.getCallTarget());
if (callNode == null) {
callNode = insert(newCallNode);
} else {
callNode.replace(newCallNode);
}
unmodifiedAssumption = declaringModule.getUnmodifiedAssumption();
}