protected static DynamicObject getCallerClass( RubyContext context, VirtualFrame callingFrame, boolean ignoreVisibility, boolean onlyLookupPublic) { if (ignoreVisibility || onlyLookupPublic) { return null; // No need to check visibility } else { InternalMethod method = RubyArguments.getMethod(callingFrame); if (!context.getCoreLibrary().isSend(method)) { return context.getCoreLibrary().getMetaClass(RubyArguments.getSelf(callingFrame)); } else { FrameInstance instance = context.getCallStack().getCallerFrameIgnoringSend(); Frame callerFrame = instance.getFrame(FrameInstance.FrameAccess.READ_ONLY, true); return context.getCoreLibrary().getMetaClass(RubyArguments.getSelf(callerFrame)); } } }
protected InternalMethod getCurrentMethod(VirtualFrame frame) { return RubyArguments.getMethod(frame.getArguments()); }