@Override public Instr clone(CloneInfo ii) { return new AliasInstr(getNewName().cloneForInlining(ii), getOldName().cloneForInlining(ii)); }
public Operand getNewName() { return getOperand1(); }
public Operand getOldName() { return getOperand2(); } }
@Override public Operand[] getOperands() { return new Operand[] {getReceiver(), getNewName(), getOldName()}; }
@Override public String toString() { return getOperation().toString() + "(" + getReceiver() + ", " + getNewName() + ", " + getOldName() + ")"; }
@Override public void simplifyOperands(Map<Operand, Operand> valueMap, boolean force) { oldName = getOldName().getSimplifiedOperand(valueMap, force); newName = getNewName().getSimplifiedOperand(valueMap, force); }
public static AliasInstr decode(IRReaderDecoder d) { return new AliasInstr(d.decodeOperand(), d.decodeOperand()); }
case ALIAS: return AliasInstr.decode(this); case ARG_SCOPE_DEPTH: return ArgScopeDepthInstr.decode(this); case ARRAY_DEREF: return ArrayDerefInstr.decode(this);
@Override public void simplifyOperands(Map<Operand, Operand> valueMap, boolean force) { oldName = getOldName().getSimplifiedOperand(valueMap, force); newName = getNewName().getSimplifiedOperand(valueMap, force); }
@Override public Operand[] getOperands() { return new Operand[] {getReceiver(), getNewName(), getOldName()}; }
@Override public String toString() { return getOperation().toString() + "(" + getReceiver() + ", " + getNewName() + ", " + getOldName() + ")"; }
public static AliasInstr decode(IRReaderDecoder d) { return new AliasInstr(d.decodeOperand(), d.decodeOperand()); }
case ALIAS: return AliasInstr.decode(this); case ARG_SCOPE_DEPTH: return ArgScopeDepthInstr.decode(this); case ARRAY_DEREF: return ArrayDerefInstr.decode(this);
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getNewName()); e.encode(getOldName()); }
@Override public Instr clone(CloneInfo ii) { return new AliasInstr(getNewName().cloneForInlining(ii), getOldName().cloneForInlining(ii)); }
@Override public void AliasInstr(AliasInstr aliasInstr) { IRBytecodeAdapter m = jvm.method(); m.loadLocal(0); m.loadLocal(getJVMLocalVarIndex(aliasInstr.getReceiver())); m.adapter.ldc(((StringLiteral) aliasInstr.getNewName()).string); m.adapter.ldc(((StringLiteral) aliasInstr.getOldName()).string); m.invokeHelper("defineAlias", IRubyObject.class, ThreadContext.class, IRubyObject.class, Object.class, Object.class); m.adapter.pop(); }
public Operand buildAlias(final AliasNode alias) { Operand newName = build(alias.getNewName()); Operand oldName = build(alias.getOldName()); addInstr(new AliasInstr(newName, oldName)); return manager.getNil(); }
public Operand getOldName() { return getOperand2(); } }
public Operand getNewName() { return getOperand1(); }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { IRubyObject newName = (IRubyObject) getNewName().retrieve(context, self, currScope, currDynScope, temp); IRubyObject oldName = (IRubyObject) getOldName().retrieve(context, self, currScope, currDynScope, temp); IRRuntimeHelpers.defineAlias(context, self, currDynScope, newName, oldName); return null; }