@Override public Instr clone(CloneInfo ii) { return new PutConstInstr(getTarget().cloneForInlining(ii), getName(), getValue().cloneForInlining(ii)); }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { IRubyObject value = (IRubyObject) getValue().retrieve(context, self, currScope, currDynScope, temp); RubyModule module = (RubyModule) getTarget().retrieve(context, self, currScope, currDynScope, temp); assert module != null : "MODULE should always be something"; module.setConstant(getId(), 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; }
private Operand putConstant(RubySymbol name, Operand value) { addInstr(new PutConstInstr(findContainerModule(), name, value)); return value; }
case PUSH_METHOD_BINDING: return PushMethodBindingInstr.decode(this); case PUSH_METHOD_FRAME: return PushMethodFrameInstr.decode(this); case PUT_CONST: return PutConstInstr.decode(this); case PUT_CVAR: return PutClassVariableInstr.decode(this); case PUT_FIELD: return PutFieldInstr.decode(this);
@Override public Instr cloneForInlining(InlinerInfo ii) { return new PutConstInstr(operands[TARGET].cloneForInlining(ii), ref, operands[VALUE].cloneForInlining(ii)); }
case PUSH_METHOD_BINDING: return PushMethodBindingInstr.decode(this); case PUSH_METHOD_FRAME: return PushMethodFrameInstr.decode(this); case PUT_CONST: return PutConstInstr.decode(this); case PUT_CVAR: return PutClassVariableInstr.decode(this); case PUT_FIELD: return PutFieldInstr.decode(this);
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { IRubyObject value = (IRubyObject) getValue().retrieve(context, self, currScope, currDynScope, temp); RubyModule module = (RubyModule) getTarget().retrieve(context, self, currScope, currDynScope, temp); assert module != null : "MODULE should always be something"; module.setConstant(getId(), 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 Instr clone(CloneInfo ii) { return new PutConstInstr(getTarget().cloneForInlining(ii), getName(), getValue().cloneForInlining(ii)); }
private Operand putConstant(RubySymbol name, Operand value) { addInstr(new PutConstInstr(findContainerModule(), name, value)); return value; }
@Override public void PutConstInstr(PutConstInstr putconstinstr) { IRBytecodeAdapter m = jvmMethod(); visit(putconstinstr.getTarget()); m.adapter.checkcast(p(RubyModule.class)); m.adapter.ldc(putconstinstr.getId()); 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(); }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new PutConstInstr(operands[TARGET].cloneForInlining(ii), ref, operands[VALUE].cloneForInlining(ii)); }
@Override public void PutConstInstr(PutConstInstr putconstinstr) { IRBytecodeAdapter m = jvmMethod(); visit(putconstinstr.getTarget()); m.adapter.checkcast(p(RubyModule.class)); m.adapter.ldc(putconstinstr.getId()); 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(); }
public static PutConstInstr decode(IRReaderDecoder d) { return new PutConstInstr(d.decodeOperand(), d.decodeSymbol(), d.decodeOperand()); }
public static PutConstInstr decode(IRReaderDecoder d) { return new PutConstInstr(d.decodeOperand(), d.decodeSymbol(), d.decodeOperand()); }
private Operand putConstant(Colon3Node node, Operand value) { addInstr(new PutConstInstr(new ObjectClass(), node.getName(), value)); return value; }
private Operand putConstant(Colon3Node node, Operand value) { addInstr(new PutConstInstr(new ObjectClass(), node.getName(), value)); return value; }