protected Variable getValueInTemporaryVariable(Operand val) { if (val != null && val instanceof TemporaryVariable) return (Variable) val; return copyAndReturnValue(val); }
protected Operand buildLazyWithOrder(CallNode node, Label lazyLabel, Label endLabel, boolean preserveOrder) { Operand value = buildCall(null, node, lazyLabel, endLabel); // We need to preserve order in cases (like in presence of assignments) except that immutable // literals can never change value so we can still emit these out of order. return preserveOrder && !(value instanceof ImmutableLiteral) ? copyAndReturnValue(value) : value; }
protected Operand buildLazyWithOrder(CallNode node, Label lazyLabel, Label endLabel, boolean preserveOrder) { Operand value = buildCall(null, node, lazyLabel, endLabel); // We need to preserve order in cases (like in presence of assignments) except that immutable // literals can never change value so we can still emit these out of order. return preserveOrder && !(value instanceof ImmutableLiteral) ? copyAndReturnValue(value) : value; }
protected Operand buildWithOrder(Node node, boolean preserveOrder) { Operand value = build(node); // We need to preserve order in cases (like in presence of assignments) except that immutable // literals can never change value so we can still emit these out of order. return preserveOrder && !(value instanceof ImmutableLiteral) ? copyAndReturnValue(value) : value; }
protected Operand buildWithOrder(Node node, boolean preserveOrder) { Operand value = build(node); // We need to preserve order in cases (like in presence of assignments) except that immutable // literals can never change value so we can still emit these out of order. return preserveOrder && !(value instanceof ImmutableLiteral) ? copyAndReturnValue(value) : value; }
public Operand buildDXStr(final DXStrNode dstrNode, IRScope s) { List<Operand> strPieces = new ArrayList<Operand>(); for (Node nextNode : dstrNode.childNodes()) { strPieces.add(dynamicPiece(nextNode, s)); } return copyAndReturnValue(s, new BacktickString(strPieces)); }
public Operand buildArray(Node node, IRScope s) { List<Operand> elts = new ArrayList<Operand>(); for (Node e: node.childNodes()) elts.add(build(e, s)); return copyAndReturnValue(s, new Array(elts)); }
public Operand buildArray(Node node, IRScope s) { List<Operand> elts = new ArrayList<Operand>(); for (Node e: node.childNodes()) elts.add(build(e, s)); return copyAndReturnValue(s, new Array(elts)); }
public Operand buildDXStr(final DXStrNode dstrNode, IRScope s) { List<Operand> strPieces = new ArrayList<Operand>(); for (Node nextNode : dstrNode.childNodes()) { strPieces.add(dynamicPiece(nextNode, s)); } return copyAndReturnValue(s, new BacktickString(strPieces)); }
public Operand buildDStr(DStrNode dstrNode, IRScope s) { List<Operand> strPieces = new ArrayList<Operand>(); for (Node n : dstrNode.childNodes()) { strPieces.add(dynamicPiece(n, s)); } return copyAndReturnValue(s, new CompoundString(strPieces, dstrNode.getEncoding())); }
public Operand buildDStr(DStrNode dstrNode, IRScope s) { List<Operand> strPieces = new ArrayList<Operand>(); for (Node n : dstrNode.childNodes()) { strPieces.add(dynamicPiece(n, s)); } return copyAndReturnValue(s, new CompoundString(strPieces, dstrNode.getEncoding())); }
public Operand buildRegexp(RegexpNode reNode) { // SSS FIXME: Rather than throw syntax error at runtime, we should detect // regexp syntax errors at build time and add an exception-throwing instruction instead return copyAndReturnValue(new Regexp(reNode.getValue(), reNode.getOptions())); }
public Operand buildRegexp(RegexpNode reNode) { // SSS FIXME: Rather than throw syntax error at runtime, we should detect // regexp syntax errors at build time and add an exception-throwing instruction instead return copyAndReturnValue(new Regexp(reNode.getValue(), reNode.getOptions())); }
public Operand buildSValue(SValueNode node) { // SSS FIXME: Required? Verify with Tom/Charlie return copyAndReturnValue(new SValue(build(node.getValue()))); }
public Operand buildDRegexp(DRegexpNode dregexpNode, IRScope s) { List<Operand> strPieces = new ArrayList<Operand>(); for (Node n : dregexpNode.childNodes()) { strPieces.add(dynamicPiece(n, s)); } return copyAndReturnValue(s, new Regexp(new CompoundString(strPieces), dregexpNode.getOptions())); }
public Operand buildDRegexp(DRegexpNode dregexpNode, IRScope s) { List<Operand> strPieces = new ArrayList<Operand>(); for (Node n : dregexpNode.childNodes()) { strPieces.add(dynamicPiece(n, s)); } return copyAndReturnValue(s, new Regexp(new CompoundString(strPieces), dregexpNode.getOptions())); }
public Operand buildArray(ArrayNode node, boolean operandOnly) { Node[] nodes = node.children(); Operand[] elts = new Operand[nodes.length]; boolean containsAssignments = node.containsVariableAssignment(); for (int i = 0; i < nodes.length; i++) { elts[i] = buildWithOrder(nodes[i], containsAssignments); } Operand array = new Array(elts); return operandOnly ? array : copyAndReturnValue(array); }
public Operand buildArray(ArrayNode node, boolean operandOnly) { Node[] nodes = node.children(); Operand[] elts = new Operand[nodes.length]; boolean containsAssignments = node.containsVariableAssignment(); for (int i = 0; i < nodes.length; i++) { elts[i] = buildWithOrder(nodes[i], containsAssignments); } Operand array = new Array(elts); return operandOnly ? array : copyAndReturnValue(array); }
public Operand buildDSymbol(Variable result, DSymbolNode node) { Node[] nodePieces = node.children(); Operand[] pieces = new Operand[nodePieces.length]; for (int i = 0; i < pieces.length; i++) { pieces[i] = dynamicPiece(nodePieces[i]); } if (result == null) result = createTemporaryVariable(); boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral(); addInstr(new BuildCompoundStringInstr(result, pieces, node.getEncoding(), false, debuggingFrozenStringLiteral, getFileName(), node.getLine())); return copyAndReturnValue(new DynamicSymbol(result)); }
public Operand buildDSymbol(Variable result, DSymbolNode node) { Node[] nodePieces = node.children(); Operand[] pieces = new Operand[nodePieces.length]; for (int i = 0; i < pieces.length; i++) { pieces[i] = dynamicPiece(nodePieces[i]); } if (result == null) result = createTemporaryVariable(); boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral(); addInstr(new BuildCompoundStringInstr(result, pieces, node.getEncoding(), false, debuggingFrozenStringLiteral, getFileName(), node.getLine())); return copyAndReturnValue(new DynamicSymbol(result)); }