@Override public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block aBlock) { DynamicScope argsDynScope = currDynScope; // Find args that need to be passed into super while (!argsDynScope.getStaticScope().isArgumentScope()) argsDynScope = argsDynScope.getNextCapturedScope(); IRScope argsIRScope = ((IRStaticScope)argsDynScope.getStaticScope()).getIRScope(); Operand[] superArgs = (argsIRScope instanceof IRMethod) ? ((IRMethod)argsIRScope).getCallArgs() : ((IRClosure)argsIRScope).getBlockArgs(); // Prepare args -- but look up in 'argsDynScope', not 'currDynScope' IRubyObject[] args = prepareArguments(context, self, superArgs, argsDynScope, temp); // Prepare block -- fetching from the frame stack, if necessary Block block = prepareBlock(context, self, currDynScope, temp); if (block == null || !block.isGiven()) block = context.getFrameBlock(); return interpretSuper(context, self, args, block); }
@Override public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block aBlock) { DynamicScope argsDynScope = currDynScope; // Find args that need to be passed into super while (!argsDynScope.getStaticScope().isArgumentScope()) argsDynScope = argsDynScope.getNextCapturedScope(); IRScope argsIRScope = ((IRStaticScope)argsDynScope.getStaticScope()).getIRScope(); Operand[] superArgs = (argsIRScope instanceof IRMethod) ? ((IRMethod)argsIRScope).getCallArgs() : ((IRClosure)argsIRScope).getBlockArgs(); // Prepare args -- but look up in 'argsDynScope', not 'currDynScope' IRubyObject[] args = prepareArguments(context, self, superArgs, argsDynScope, temp); // Prepare block -- fetching from the frame stack, if necessary Block block = prepareBlock(context, self, currDynScope, temp); if (block == null || !block.isGiven()) block = context.getFrameBlock(); return interpretSuper(context, self, args, block); }