@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { Block block = (Block) getSource().retrieve(context, self, currScope, currDynScope, temp); return IRRuntimeHelpers.newProc(context.runtime, block); }
@Override public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, int ipc) { return ((Label)getJumpTarget().retrieve(context, self, currDynScope, temp)).getTargetPC(); }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { Block block = (Block) getSource().retrieve(context, self, currScope, currDynScope, temp); return IRRuntimeHelpers.newProc(context.runtime, block); }
@Override public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, int ipc) { return ((Label)getJumpTarget().retrieve(context, self, currDynScope, temp)).getTargetPC(); }
@Override public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block block) { IRubyObject object = (IRubyObject) receiver.retrieve(context, self, currDynScope, temp); if (object == null || object instanceof RubyFixnum || object instanceof RubySymbol) { throw context.runtime.newTypeError("no class to make alias"); } String newNameString = getNewName().retrieve(context, self, currDynScope, temp).toString(); String oldNameString = getOldName().retrieve(context, self, currDynScope, temp).toString(); RubyModule module = (object instanceof RubyModule) ? (RubyModule) object : object.getMetaClass(); module.defineAlias(newNameString, oldNameString); return null; }
@Override public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block block) { IRubyObject object = (IRubyObject) receiver.retrieve(context, self, currDynScope, temp); if (object == null || object instanceof RubyFixnum || object instanceof RubySymbol) { throw context.runtime.newTypeError("no class to make alias"); } String newNameString = getNewName().retrieve(context, self, currDynScope, temp).toString(); String oldNameString = getOldName().retrieve(context, self, currDynScope, temp).toString(); RubyModule module = (object instanceof RubyModule) ? (RubyModule) object : object.getMetaClass(); module.defineAlias(newNameString, oldNameString); return null; }
@Override public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) { BlockBody body = closure.getBlockBody(); closure.getStaticScope().determineModule(); // In non-inlining scenarios, this.self will always be %self. // However, in inlined scenarios, this.self will be the self in the original scope where the closure // was present before inlining. IRubyObject selfVal = (this.self instanceof Self) ? self : (IRubyObject)this.self.retrieve(context, self, currScope, currDynScope, temp); Binding binding = context.currentBinding(selfVal, currDynScope); return new Block(body, binding); }
@Override public Object retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) { BlockBody body = closure.getBlockBody(); closure.getStaticScope().determineModule(); // In non-inlining scenarios, this.self will always be %self. // However, in inlined scenarios, this.self will be the self in the original scope where the closure // was present before inlining. IRubyObject selfVal = (this.self instanceof Self) ? self : (IRubyObject)this.self.retrieve(context, self, currScope, currDynScope, temp); Binding binding = context.currentBinding(selfVal, currDynScope); return new Block(body, binding); }