public static ToAryInstr decode(IRReaderDecoder d) { return new ToAryInstr(d.decodeVariable(), d.decodeOperand()); }
@Override public void ToAryInstr(ToAryInstr toaryinstr) { jvm.method().loadContext(); visit(toaryinstr.getArrayArg()); jvm.method().adapter.ldc(toaryinstr.dontToAryArrays()); jvm.method().invokeHelper("irToAry", IRubyObject.class, ThreadContext.class, IRubyObject.class, boolean.class); jvmStoreLocal(toaryinstr.getResult()); }
@Override public Operand simplifyAndGetResult(IRScope scope, Map<Operand, Operand> valueMap) { simplifyOperands(valueMap, false); Operand a = getArray().getValue(valueMap); return a instanceof Array ? a : null; }
@Override public Instr clone(CloneInfo ii) { return new ToAryInstr((Variable) result.cloneForInlining(ii), getArray().cloneForInlining(ii)); }
@Override public Operand simplifyAndGetResult(IRScope scope, Map<Operand, Operand> valueMap) { simplifyOperands(valueMap, false); return dontToAryArrays.isTrue() && (array.getValue(valueMap) instanceof Array) ? array : null; }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getArray()); }
public Operand getArray() { return getOperand1(); }
case THREAD_POLL: return ThreadPollInstr.decode(this); case THROW: return ThrowExceptionInstr.decode(this); case TO_ARY: return ToAryInstr.decode(this); case TOGGLE_BACKTRACE: return ToggleBacktraceInstr.decode(this); case UNDEF_METHOD: return UndefMethodInstr.decode(this);
@Override public Instr clone(CloneInfo ii) { return new ToAryInstr((Variable) result.cloneForInlining(ii), getArray().cloneForInlining(ii)); }
@Override public Operand simplifyAndGetResult(IRScope scope, Map<Operand, Operand> valueMap) { simplifyOperands(valueMap, false); return dontToAryArrays.isTrue() && (array.getValue(valueMap) instanceof Array) ? array : null; }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { return IRRuntimeHelpers.irToAry(context, (IRubyObject) getArray().retrieve(context, self, currScope, currDynScope, temp)); }
public Operand getArray() { return getOperand1(); }
case THREAD_POLL: return ThreadPollInstr.decode(this); case THROW: return ThrowExceptionInstr.decode(this); case TO_ARY: return ToAryInstr.decode(this); case TOGGLE_BACKTRACE: return ToggleBacktraceInstr.decode(this); case UNDEF_METHOD: return UndefMethodInstr.decode(this);
public static ToAryInstr decode(IRReaderDecoder d) { return new ToAryInstr(d.decodeVariable(), d.decodeOperand()); }
@Override public void ToAryInstr(ToAryInstr toaryinstr) { jvm.method().loadContext(); visit(toaryinstr.getArrayArg()); jvm.method().adapter.ldc(toaryinstr.dontToAryArrays()); jvm.method().invokeHelper("irToAry", IRubyObject.class, ThreadContext.class, IRubyObject.class, boolean.class); jvmStoreLocal(toaryinstr.getResult()); }
@Override public Operand simplifyAndGetResult(IRScope scope, Map<Operand, Operand> valueMap) { simplifyOperands(valueMap, false); Operand a = getArray().getValue(valueMap); return a instanceof Array ? a : null; }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getArray()); }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new ToAryInstr((Variable) result.cloneForInlining(ii), array.cloneForInlining(ii), (BooleanLiteral) dontToAryArrays.cloneForInlining(ii)); }