@Override public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block block) { IRubyObject value = (IRubyObject) getValue().retrieve(context, self, currDynScope, temp); RubyModule module = (RubyModule) getTarget().retrieve(context, self, currDynScope, temp); assert module != null : "MODULE should always be something"; module.setConstant(getRef(), value); return null; }
@Override public Object interpret(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, Block block) { IRubyObject value = (IRubyObject) getValue().retrieve(context, self, currDynScope, temp); RubyModule module = (RubyModule) getTarget().retrieve(context, self, currDynScope, temp); assert module != null : "MODULE should always be something"; module.setConstant(getRef(), value); return null; }
@Override public void PutConstInstr(PutConstInstr putconstinstr) { IRBytecodeAdapter m = jvm.method(); visit(putconstinstr.getTarget()); m.adapter.checkcast(p(RubyModule.class)); m.adapter.ldc(putconstinstr.getRef()); visit(putconstinstr.getValue()); m.adapter.invokevirtual(p(RubyModule.class), "setConstant", sig(IRubyObject.class, String.class, IRubyObject.class)); m.adapter.pop(); }
@Override public void PutConstInstr(PutConstInstr putconstinstr) { IRBytecodeAdapter m = jvm.method(); visit(putconstinstr.getTarget()); m.adapter.checkcast(p(RubyModule.class)); m.adapter.ldc(putconstinstr.getRef()); visit(putconstinstr.getValue()); m.adapter.invokevirtual(p(RubyModule.class), "setConstant", sig(IRubyObject.class, String.class, IRubyObject.class)); m.adapter.pop(); }