@Override public Operand getSimplifiedOperand(Map<Operand, Operand> valueMap, boolean force) { Operand newArray = array.getSimplifiedOperand(valueMap, force); return (newArray == array) ? this : new Splat(newArray); }
@Override public Operand getSimplifiedOperand(Map<Operand, Operand> valueMap, boolean force) { Operand newArray = array.getSimplifiedOperand(valueMap, force); /* * SSS FIXME: Cannot convert this to an Array operand! * if (_array instanceof Variable) { _array = ((Variable)_array).getValue(valueMap); } */ return (newArray == array) ? this : new Splat(newArray); }
/** When fixing up splats in nested closure we need to tweak the operand if it is a LocalVariable */ public Operand cloneForDepth(int n) { return array instanceof LocalVariable ? new Splat(((LocalVariable) array).cloneForDepth(n)) : this; }
@Override public Operand getSimplifiedOperand(Map<Operand, Operand> valueMap, boolean force) { Operand newArray = array.getSimplifiedOperand(valueMap, force); return (newArray == array) ? this : new Splat(newArray); }
/** When fixing up splats in nested closure we need to tweak the operand if it is a LocalVariable */ public Operand cloneForDepth(int n) { return array instanceof LocalVariable ? new Splat(((LocalVariable) array).cloneForDepth(n)) : this; }
@Override public Operand getSimplifiedOperand(Map<Operand, Operand> valueMap, boolean force) { Operand newArray = array.getSimplifiedOperand(valueMap, force); /* * SSS FIXME: Cannot convert this to an Array operand! * if (_array instanceof Variable) { _array = ((Variable)_array).getValue(valueMap); } */ return (newArray == array) ? this : new Splat(newArray); }
public static Splat decode(IRReaderDecoder d) { return new Splat(d.decodeOperand()); }
public static Splat decode(IRReaderDecoder d) { return new Splat(d.decodeOperand()); }
public Operand buildSplat(SplatNode splatNode, IRScope s) { // SSS: Since splats can only occur in call argument lists, no need to copyAndReturnValue(...) // Verify with Tom / Charlie return new Splat(build(splatNode.getValue(), s)); }
public Operand buildSplat(SplatNode splatNode, IRScope s) { // SSS: Since splats can only occur in call argument lists, no need to copyAndReturnValue(...) // Verify with Tom / Charlie return new Splat(build(splatNode.getValue(), s)); }
@Override public void addInstr(Instr i) { // Accumulate call arguments if (i instanceof ReceiveRestArgInstr) callArgs.add(new Splat(((ReceiveRestArgInstr)i).getResult())); else if (i instanceof ReceiveArgBase) callArgs.add(((ReceiveArgBase) i).getResult()); super.addInstr(i); }
@Override public void addInstr(Instr i) { // Accumulate block arguments if (i instanceof ReceiveRestArgInstr) blockArgs.add(new Splat(((ReceiveRestArgInstr)i).getResult())); else if (i instanceof ReceiveArgBase) blockArgs.add(((ReceiveArgBase) i).getResult()); super.addInstr(i); }
@Override public Operand cloneForInlining(InlinerInfo ii) { return hasKnownValue() ? this : new Splat(array.cloneForInlining(ii)); }
@Override public Operand cloneForInlining(InlinerInfo ii) { return hasKnownValue() ? this : new Splat(array.cloneForInlining(ii)); }
@Override public void addInstr(Instr i) { // Accumulate block arguments if (i instanceof ReceiveRestArgInstr) blockArgs.add(new Splat(((ReceiveRestArgInstr)i).getResult())); else if (i instanceof ReceiveArgBase) blockArgs.add(((ReceiveArgBase) i).getResult()); super.addInstr(i); }
@Override public void addInstr(Instr i) { // Accumulate call arguments if (i instanceof ReceiveRestArgInstr) callArgs.add(new Splat(((ReceiveRestArgInstr)i).getResult())); else if (i instanceof ReceiveArgBase) callArgs.add(((ReceiveArgBase) i).getResult()); super.addInstr(i); }
@Override public Operand cloneForInlining(CloneInfo ii) { return hasKnownValue() ? this : new Splat(array.cloneForInlining(ii)); }
@Override public Operand cloneForInlining(CloneInfo ii) { return hasKnownValue() ? this : new Splat(array.cloneForInlining(ii)); }
private static void extractCallOperands(List<Operand> callArgs, List<KeyValuePair<Operand, Operand>> keywordArgs, Instr instr) { if (instr instanceof ReceiveKeywordRestArgInstr) { // Always add the keyword rest arg to the beginning keywordArgs.add(0, new KeyValuePair<Operand, Operand>(Symbol.KW_REST_ARG_DUMMY, ((ReceiveArgBase) instr).getResult())); } else if (instr instanceof ReceiveKeywordArgInstr) { ReceiveKeywordArgInstr receiveKwargInstr = (ReceiveKeywordArgInstr) instr; keywordArgs.add(new KeyValuePair<Operand, Operand>(new Symbol(receiveKwargInstr.getKey()), receiveKwargInstr.getResult())); } else if (instr instanceof ReceiveRestArgInstr) { callArgs.add(new Splat(((ReceiveRestArgInstr) instr).getResult())); } else if (instr instanceof ReceiveArgBase) { callArgs.add(((ReceiveArgBase) instr).getResult()); } }
private static void extractCallOperands(List<Operand> callArgs, List<KeyValuePair<Operand, Operand>> keywordArgs, Instr instr) { if (instr instanceof ReceiveKeywordRestArgInstr) { // Always add the keyword rest arg to the beginning keywordArgs.add(0, new KeyValuePair<Operand, Operand>(Symbol.KW_REST_ARG_DUMMY, ((ReceiveArgBase) instr).getResult())); } else if (instr instanceof ReceiveKeywordArgInstr) { ReceiveKeywordArgInstr receiveKwargInstr = (ReceiveKeywordArgInstr) instr; keywordArgs.add(new KeyValuePair<Operand, Operand>(new Symbol(receiveKwargInstr.getKey()), receiveKwargInstr.getResult())); } else if (instr instanceof ReceiveRestArgInstr) { callArgs.add(new Splat(((ReceiveRestArgInstr) instr).getResult())); } else if (instr instanceof ReceiveArgBase) { callArgs.add(((ReceiveArgBase) instr).getResult()); } }