protected EQQInstr(IRScope scope, Variable result, Operand v1, Operand v2, boolean splattedValue, CallSite callSite, long callSiteID) { super(scope, Operation.EQQ, CallType.FUNCTIONAL, result, scope.getManager().getRuntime().newSymbol("==="), v1, new Operand[] { v2 }, null, false, callSite, callSiteID); this.splattedValue = splattedValue; }
protected EQQInstr(IRScope scope, Variable result, Operand v1, Operand v2, boolean splattedValue, CallSite callSite, long callSiteID) { super(scope, Operation.EQQ, CallType.FUNCTIONAL, result, scope.getManager().getRuntime().newSymbol("==="), v1, new Operand[] { v2 }, null, false, callSite, callSiteID); this.splattedValue = splattedValue; }
public UnresolvedSuperInstr(IRScope scope, Operation op, Variable result, Operand receiver, Operand[] args, Operand closure, boolean isPotentiallyRefined, CallSite callSite, long callSiteId) { super(scope, op, CallType.SUPER, result, scope.getManager().getRuntime().newSymbol(UNKNOWN_SUPER_TARGET), receiver, args, closure, isPotentiallyRefined, callSite, callSiteId); }
public EQQInstr(IRScope scope, Variable result, Operand v1, Operand v2, boolean splattedValue) { super(scope, Operation.EQQ, CallType.FUNCTIONAL, result, scope.getManager().getRuntime().newSymbol("==="), v1, new Operand[] { v2 }, null, false); assert result != null: "EQQInstr result is null"; this.splattedValue = splattedValue; }
public UnresolvedSuperInstr(IRScope scope, Operation op, Variable result, Operand receiver, Operand[] args, Operand closure, boolean isPotentiallyRefined) { super(scope, op, CallType.SUPER, result, scope.getManager().getRuntime().newSymbol(UNKNOWN_SUPER_TARGET), receiver, args, closure, isPotentiallyRefined); }
public ArrayDerefInstr(IRScope scope, Variable result, Operand obj, FrozenString arg0, CallSite callSite, long callSiteId) { super(scope, Operation.ARRAY_DEREF, CallType.FUNCTIONAL, result, scope.getManager().getRuntime().newSymbol(AREF), obj, new Operand[] {arg0}, false, callSite, callSiteId); key = arg0; }
public UnresolvedSuperInstr(IRScope scope, Operation op, Variable result, Operand receiver, Operand[] args, Operand closure, boolean isPotentiallyRefined) { super(scope, op, CallType.SUPER, result, scope.getManager().getRuntime().newSymbol(UNKNOWN_SUPER_TARGET), receiver, args, closure, isPotentiallyRefined); }
public ArrayDerefInstr(IRScope scope, Variable result, Operand obj, FrozenString arg0, CallSite callSite, long callSiteId) { super(scope, Operation.ARRAY_DEREF, CallType.FUNCTIONAL, result, scope.getManager().getRuntime().newSymbol(AREF), obj, new Operand[] {arg0}, false, callSite, callSiteId); key = arg0; }
public EQQInstr(IRScope scope, Variable result, Operand v1, Operand v2, boolean splattedValue) { super(scope, Operation.EQQ, CallType.FUNCTIONAL, result, scope.getManager().getRuntime().newSymbol("==="), v1, new Operand[] { v2 }, null, false); assert result != null: "EQQInstr result is null"; this.splattedValue = splattedValue; }
@Override public RubySymbol decodeSymbol() { return currentScope.getManager().getRuntime().newSymbol(decodeByteList()); }
protected IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix) { super(manager, lexicalParent, null, lineNumber, staticScope); this.startLabel = getNewLabel(prefix + "START"); this.endLabel = getNewLabel(prefix + "END"); this.closureId = lexicalParent.getNextClosureId(); ByteList name = prefix.dup(); name.append(Integer.toString(closureId).getBytes()); setName(manager.getRuntime().newSymbol(name)); this.body = null; }
private static Map<RubySymbol, LocalVariable> decodeScopeLocalVariables(IRReaderDecoder decoder, IRScope scope) { int size = decoder.decodeInt(); Map<RubySymbol, LocalVariable> localVariables = new HashMap(size); for (int i = 0; i < size; i++) { RubySymbol name = scope.getManager().getRuntime().newSymbol(decoder.decodeByteList()); int offset = decoder.decodeInt(); localVariables.put(name, scope instanceof IRClosure ? // SSS FIXME: do we need to read back locallyDefined boolean? new ClosureLocalVariable(name, 0, offset) : new LocalVariable(name, 0, offset)); } return localVariables; }
protected IRClosure(IRManager manager, IRScope lexicalParent, int lineNumber, StaticScope staticScope, ByteList prefix) { super(manager, lexicalParent, null, lineNumber, staticScope); this.startLabel = getNewLabel(prefix + "START"); this.endLabel = getNewLabel(prefix + "END"); this.closureId = lexicalParent.getNextClosureId(); ByteList name = prefix.dup(); name.append(Integer.toString(closureId).getBytes()); setName(manager.getRuntime().newSymbol(name)); this.body = null; }
private static Map<RubySymbol, LocalVariable> decodeScopeLocalVariables(IRReaderDecoder decoder, IRScope scope) { int size = decoder.decodeInt(); Map<RubySymbol, LocalVariable> localVariables = new HashMap(size); for (int i = 0; i < size; i++) { RubySymbol name = scope.getManager().getRuntime().newSymbol(decoder.decodeByteList()); int offset = decoder.decodeInt(); localVariables.put(name, scope instanceof IRClosure ? // SSS FIXME: do we need to read back locallyDefined boolean? new ClosureLocalVariable(name, 0, offset) : new LocalVariable(name, 0, offset)); } return localVariables; }
@Override public LocalVariable getNewFlipStateVariable() { ByteList flipVarName = new ByteList(("%flip_" + allocateNextPrefixedName("%flip")).getBytes()); RubySymbol name = getManager().getRuntime().newSymbol(flipVarName); LocalVariable v = lookupExistingLVar(name); return v == null ? getNewLocalVariable(name, 0) : v; }
@Override public LocalVariable getNewFlipStateVariable() { ByteList flipVarName = new ByteList(("%flip_" + allocateNextPrefixedName("%flip")).getBytes()); RubySymbol name = getManager().getRuntime().newSymbol(flipVarName); LocalVariable v = lookupExistingLVar(name); return v == null ? getNewLocalVariable(name, 0) : v; }
public LocalVariable getNewFlipStateVariable() { ByteList flip = FLIP.dup(); flip.append(allocateNextPrefixedName("%flip")); return getLocalVariable(getManager().getRuntime().newSymbol(flip) , 0); }
public Operand buildXStr(XStrNode node) { return addResultInstr(CallInstr.create(scope, CallType.FUNCTIONAL, createTemporaryVariable(), manager.getRuntime().newSymbol("`"), Self.SELF, new Operand[] { new FrozenString(node.getValue(), node.getCodeRange(), scope.getFile(), node.getLine()) }, null)); }
@Override public void setName(RubySymbol name) { ByteList newName = getLexicalParent().getName().getBytes().dup(); newName.append(name.getBytes()); super.setName(getManager().getRuntime().newSymbol(newName)); }
public Operand buildDXStr(Variable result, DXStrNode node) { Node[] nodePieces = node.children(); Operand[] pieces = new Operand[nodePieces.length]; for (int i = 0; i < pieces.length; i++) { pieces[i] = dynamicPiece(nodePieces[i]); } Variable stringResult = createTemporaryVariable(); if (result == null) result = createTemporaryVariable(); boolean debuggingFrozenStringLiteral = manager.getInstanceConfig().isDebuggingFrozenStringLiteral(); addInstr(new BuildCompoundStringInstr(stringResult, pieces, node.getEncoding(), false, debuggingFrozenStringLiteral, getFileName(), node.getLine())); return addResultInstr(CallInstr.create(scope, CallType.FUNCTIONAL, result, manager.getRuntime().newSymbol("`"), Self.SELF, new Operand[] { stringResult }, null)); }