@Override public Object dispatch(VirtualFrame frame, RubyProc block, Object[] argumentsObjects) { final RubyMethod method = block.getMethod(); return callNode.call( frame, method.getCallTarget(), RubyArguments.pack( method.getDeclarationFrame(), block.getSelfCapturedInScope(), block.getBlockCapturedInScope(), argumentsObjects)); }
@Specialization(guards = "guardName") public Object dispatch( VirtualFrame frame, RubyNilClass methodReceiverObject, LexicalScope lexicalScope, RubySymbol receiverObject, Object methodName, Object blockObject, Object argumentsObjects, Dispatch.DispatchAction dispatchAction) { CompilerAsserts.compilationConstant(dispatchAction); // Check the class has not been modified try { unmodifiedAssumption.check(); } catch (InvalidAssumptionException e) { return resetAndDispatch( frame, methodReceiverObject, lexicalScope, receiverObject, methodName, CompilerDirectives.unsafeCast(blockObject, RubyProc.class, true, false), argumentsObjects, dispatchAction, "class modified"); } if (dispatchAction == Dispatch.DispatchAction.CALL_METHOD) { return callNode.call( frame, RubyArguments.pack( method, method.getDeclarationFrame(), receiverObject, CompilerDirectives.unsafeCast(blockObject, RubyProc.class, true, false), CompilerDirectives.unsafeCast(argumentsObjects, Object[].class, true))); } else if (dispatchAction == Dispatch.DispatchAction.RESPOND_TO_METHOD) { return true; } else if (dispatchAction == Dispatch.DispatchAction.READ_CONSTANT) { return value; } else { throw new UnsupportedOperationException(); } }