Top Inners Fields Constructors Methods
org.jruby.ir.builder

public abstract Class IRBuilder<U, V, W, X, Y, Z>

extends Object
Class Inheritance
Known Direct Subclasses
org.jruby.ir.builder.IRBuilderAST
Imports
org.jcodings.Encoding, org.jcodings.specific.UTF8Encoding, org.jruby.EvalType, .ParseResult, .RubyInstanceConfig, .RubySymbol, org.jruby.ast.IterNode, .StrNode, org.jruby.common.IRubyWarnings, org.jruby.ext.coverage.CoverageData, org.jruby.ir.IRClassBody, .IRClosure, .IREvalScript, .IRFlags, .IRFor, .IRManager, .IRMetaClassBody, .IRMethod, .IRModuleBody, .IRScope, .IRScopeType, .IRScriptBody, org.jruby.ir.instructions.*, org.jruby.ir.interpreter.InterpreterContext, org.jruby.ir.operands.*, .Boolean, .Integer, org.jruby.parser.StaticScope, org.jruby.runtime.ArgumentDescriptor, .ArgumentType, .CallType, .RubyEvent, .Signature, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.ByteList, .CommonByteLists, .DefinedMessage, .KeyValuePair, .RegexpOptions, org.jruby.util.cli.Options, java.util.ArrayDeque, .ArrayList, .Deque, .EnumSet, .HashMap, .HashSet, .LinkedList, .List, .Map, .Set, java.util.function.Consumer

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
protected static interface
protected static interface
pack-priv static enum
protected static interface
protected static interface
protected static interface

Field Summary

Modifier and TypeField and Description
pack-priv final Deque<EnsureBlockInfo>
pack-priv final Deque<RescueBlockInfo>
pack-priv final Deque<Label>
protected int
protected List<Object>
protected int
private boolean
private Variable
protected Encoding
pack-priv final Deque<EnsureBlockInfo>
public EvalType
public boolean
pack-priv EnumSet<IRFlags>
protected int
protected final List<Instr>
pack-priv int
pack-priv final Deque<IRLoop>
private final IRManager
pack-priv RubySymbol
pack-priv IRBuilder.LineInfo
private boolean
protected final IRBuilder<U, V, W, X, Y, Z>
private boolean
protected final IRScope
private boolean
pack-priv int
pack-priv static final UnexecutableNil
public boolean
protected IRBuilder<U, V, W, X, Y, Z>
private TemporaryVariable

Constructor Summary

AccessConstructor and Description
public
IRBuilder(IRManager manager, IRScope scope, IRBuilder<U, V, W, X, Y, Z> parent, IRBuilder<U, V, W, X, Y, Z> variableBuilder, Encoding encoding)

Method Summary

Modifier and TypeMethod and Description
protected Variable
_call(Variable result, CallType type, Operand object, RubySymbol name, Operand... args)

public static Operand[]
addArg(Operand[] args, Operand extraArg)

public void
public void
addInstr(Instr instr)

public void
protected Operand
pack-priv Operand
protected Variable
private Operand[]
adjustVariableDepth(Operand[] args, int depthFromSuper)

protected abstract boolean
alwaysFalse(U node)

protected abstract boolean
alwaysTrue(U node)

protected Variable
protected Variable
protected IRBuilder.BinaryType
binaryType(U node)

protected abstract U
bodyFor(X node)

public abstract Operand
protected abstract Operand
build(Variable result, U node)

protected abstract Operand
build(U node)

protected Operand
buildAlias(Operand newName, Operand oldName)

protected Operand
protected void
buildArrayPattern(Label testEnd, Variable result, Variable deconstructed, U constant, U[] pre, U rest, U[] post, Operand obj, boolean inAlteration, boolean isSinglePattern, Variable errorString)

protected abstract void
buildAssignment(U reference, Operand rhs)

protected abstract void
buildAssocs(Label testEnd, Operand original, Variable result, Z assocs, boolean inAlteration, boolean isSinglePattern, Variable errorString, boolean hasRest, Variable d)

protected Operand
buildAttrAssign(Variable result, U receiver, U argsNode, U blockNode, RubySymbol name, boolean isLazy, boolean containsAssignment)

protected abstract Operand[]
buildAttrAssignCallArgs(U args, Operand[] rhs, boolean containsAssignment)

protected Operand
buildBreak(IRBuilder.CodeBlock value, int line)

protected abstract Operand[]
buildCallArgs(U args, int[] flags)

protected Operand
buildCase(U predicate, U[] arms, U elsey)

private Operand
protected Operand
buildClass(ByteList className, U superNode, U cpath, U bodyNode, StaticScope scope, int line, int endLine)

protected Operand
protected Operand
buildClassVarAsgn(RubySymbol name, U valueNode)

protected Variable
protected abstract Operand
buildColon2ForConstAsgnDeclNode(U lhs, Variable valueResult, boolean constMissing)

protected Operand
buildConditional(Variable result, U predicate, U statements, U consequent)

protected Operand
buildConditionalLoop(U conditionNode, U bodyNode, boolean isWhile, boolean isLoopHeadCondition)

protected Variable
protected Variable
buildDefinitionCheck(ResultInstr definedInstr, String definedReturnValue)

protected Operand
protected Variable
protected Operand
buildDefs(U receiver, IRMethod method)

protected Operand
buildDRegex(Variable result, U[] children, RegexpOptions options)

protected Operand
buildDStr(Variable result, U[] nodePieces, Encoding encoding, boolean isFrozen, int line)
Deprecated

protected Operand
buildDStr(Variable result, U[] nodePieces, Encoding encoding, StringStyle stringStyle, int line)

protected Operand
buildDSymbol(Variable result, U[] nodePieces, Encoding encoding, int line)

public Operand
buildDXStr(Variable result, U[] nodePieces, Encoding encoding, int line)

protected Operand
protected Operand
buildEnsureInternal(U body, U elseNode, U[] exceptions, U rescueBody, X optRescue, boolean isModifier, U ensureNode, boolean isRescue, U reference)

public InterpreterContext
protected void
buildFindPattern(Label testEnd, Variable result, Variable deconstructed, U constant, U pre, U[] args, U post, Operand obj, boolean inAlteration, boolean isSinglePattern, Variable errorString)

protected Operand
buildFlip(U begin, U end, boolean isExclusive)

protected Operand
buildFor(U receiverNode, U var, U body, StaticScope staticScope, Signature signature, int line, int endLine)

protected Operand
buildForIter(U var, U body, StaticScope staticScope, Signature signature, int line, int endLine)

protected abstract Operand
protected Operand
buildGlobalAsgn(RubySymbol name, U valueNode)

protected Operand
protected Variable
protected void
buildHashPattern(Label testEnd, Variable result, Variable deconstructed, U constant, Z assocs, U[] assocsKeys, U rest, Operand obj, boolean inAlteration, boolean isSinglePattern, Variable errorString)

protected Operand
buildInstAsgn(RubySymbol name, U valueNode)

protected Operand
protected Operand
protected Operand
buildIter(U var, U body, StaticScope staticScope, Signature signature, int line, int endLine)

protected void
buildIterInner(RubySymbol methodName, U var, U body, int endLine)

public Operand
buildLambda(U args, U body, StaticScope staticScope, Signature signature, int line)

protected void
buildLambdaInner(U blockArgs, U body)

protected Operand
buildLocalVariableAssign(RubySymbol name, int depth, U valueNode)

public Operand
buildMatch(Variable result, Operand regexp)

protected Operand
buildModule(ByteList name, U cpath, U bodyNode, StaticScope scope, int line, int endLine)

protected void
buildModuleOrClassBody(U body, int startLine, int endLine)

protected Operand
buildNext(final Operand rv, int line)

protected Operand
buildNthRef(int matchNumber)

protected Operand
buildOpAsgn(U receiver, U value, RubySymbol reader, RubySymbol writer, RubySymbol operator, boolean isLazy)

protected Operand
protected Operand
buildOpAsgnConstDecl(Y left, U right, RubySymbol operator)
Deprecated

protected Operand
buildOpAsgnConstDecl(Y left, RubySymbol name, U right, RubySymbol operator)

protected Operand
buildOpAsgnConstDeclAnd(U left, U right, RubySymbol leftName)

protected Operand
buildOpAsgnConstDeclOr(U left, U right, RubySymbol leftName)

protected Operand
protected Operand
buildOpAsgnOrWithDefined(final U first, U second)

protected Operand
buildOpElementAsgnWith(U receiver, U args, U block, U value, Boolean truthy)

protected Operand
buildOpElementAsgnWithMethod(U receiver, U args, U block, U value, RubySymbol operator)

protected Operand
private void
buildPatternArrayLengthCheck(Label testEnd, Variable result, Variable deconstructed, boolean isSinglePattern, Variable errorString, Variable length, Operand minArgsCount, boolean hasRest)

protected Operand
buildPatternCase(U test, U[] cases, U consequent)

private void
buildPatternConstant(Label testEnd, Variable result, U constant, Operand obj, boolean isSinglePattern, Variable errorString)

private void
buildPatternDeconstructRespondTo(Label testEnd, Variable result, Operand obj, boolean isSinglePattern, Variable errorString, String methodName)

protected abstract Variable
buildPatternEach(Label testEnd, Variable result, Operand original, Variable deconstructed, Operand value, U exprNodes, boolean inAlternation, boolean isSinglePattern, Variable errorString)

protected void
buildPatternEachHash(Label testEnd, Variable result, Operand original, Variable deconstructed, Operand value, U key, U assocValue, boolean inAlternation, boolean isSinglePattern, Variable errorString)

protected void
buildPatternEachIf(Variable result, Operand original, Variable deconstructed, Operand value, U condition, U thenBody, U elseBody, boolean inAlternation, boolean isSinglePattern, Variable errorString)

protected void
buildPatternLocal(Operand value, RubySymbol name, int line, int depth, boolean inAlternation)

protected void
buildPatternMatch(Variable result, Operand original, Variable deconstructed, U arg, Operand obj, boolean inAlternation, boolean isSinglePattern, Variable errorString)

protected void
buildPatternOr(Label testEnd, Operand original, Variable result, Variable deconstructed, Operand value, U left, U right, boolean isSinglePattern, Variable errorString)

protected void
buildPatternSetEQQError(Variable errorString, Variable result, Operand obj, Operand expression, Operand value)

protected void
buildPatternSetGeneralError(Variable errorString, Variable result, Operand... args)

protected Operand
buildPostExe(U body, int line)

protected Operand
buildPreExe(U body)

private List<Instr>
private void
protected Operand
buildRange(U beginNode, U endNode, boolean isExclusive)

protected Operand
buildRational(U numerator, U denominator)

protected Operand
buildRedo(int line)

protected void
buildRescueBodyInternal(U[] exceptions, U body, X consequent, Variable rv, Variable exc, Label endLabel, U reference)

protected Operand
buildRescueInternal(U bodyNode, U elseNode, U[] exceptions, U rescueBody, X optRescue, boolean isModifier, EnsureBlockInfo ensure, U reference)

protected Operand
buildRetry(int line)

protected Operand
buildReturn(Operand value, int line)

public static InterpreterContext
buildRoot(IRManager manager, ParseResult rootNode)

protected InterpreterContext
protected Operand
buildSClass(U receiverNode, U bodyNode, StaticScope scope, int line, int endLine)

protected Variable
protected Operand
buildSuper(Variable aResult, U iterNode, U argsNode, int line, boolean isNewline)

protected Operand
public Operand
protected abstract void
buildWhenArgs(W whenNode, Operand testValue, Label bodyLabel, Set<IRubyObject> seenLiterals, Map<IRubyObject, Integer> origLocs)

protected void
buildWhenValue(Variable eqqResult, Operand testValue, Label bodyLabel, U node, Set<IRubyObject> seenLiterals, Map<IRubyObject, Integer> origLocs, boolean needsSplat)

protected void
buildWhenValues(Variable eqqResult, U[] exprValues, Operand testValue, Label bodyLabel, Set<IRubyObject> seenLiterals, Map<IRubyObject, Integer> origLocs)

protected Operand
buildWithOrder(U node, boolean preserveOrder)

protected Operand
buildZSuper(Variable result, U iter)

protected Operand
buildZSuper(Variable result, Operand block)

protected Operand
buildZSuperIfNest(Variable result, final Operand block)

private void
protected Variable
call(Variable result, Operand object, String name, Operand... args)

protected Variable
call(Variable result, Operand object, RubySymbol name, Operand... args)

protected boolean
canBacktraceBeRemoved(U[] exceptions, U rescueBody, X optRescue, U elseNode, boolean isModifier)

protected abstract boolean

Returns:

true if can be lazy
canBeLazyMethod
(V
syntactical representation of the definition
defNode
)

Combination of whether it is feasible for a method being processed to be lazy (e.g. methods containing break/next cannot for syntax error purposes) or whether it is enabled as an option (feature does not exist yet).

private void
public Operand
classVarContainer(boolean declContext)

public Operand
private boolean
public void
protected void
cond(Label label, Operand value, Operand test)

protected void
cond(Label endLabel, Operand value, Operand test, IRBuilder.RunIt body)

protected void
cond_ne_false(Label label, Operand value)

protected void
cond_ne_nil(Label endLabel, Operand value, IRBuilder.RunIt body)

protected void
cond_ne_true(Label label, Operand value)

protected abstract boolean
public Variable
copy(Operand value)

public Variable
copy(Variable result, Operand value)

protected ArgumentDescriptor[]
public static Instr
createBranch(Operand v1, Operand v2, Label jmpTarget)

protected Variable
createCall(Variable result, Operand receiver, CallType callType, RubySymbol name, U argsNode, U iter, int line, boolean isNewline)

public Variable
private TemporaryVariable
private ByteList
private ByteList
protected void
private TemporaryVariable
protected Variable
deconstructHashPatternKeys(Label testEnd, Variable errorString, U constantNode, U[] keyNodes, U rest, Variable result, Operand obj, boolean isSinglePattern)

public void
defineMethodInner(LazyMethodDefinition<U, V, W, X, Y, Z> defNode, IRScope parent, int coverageMode)

protected IRMethod
defineNewMethod(LazyMethodDefinition<U, V, W, X, Y, Z> defn, ByteList name, int line, StaticScope scope, boolean isInstanceMethod)

protected void
protected void
determineIfWeNeedLineNumber(int line, boolean isNewline, boolean implicitNil, boolean def)

protected CallInstr
determineSuperInstr(Variable result, Operand[] args, Operand block, int flags, boolean inClassBody, boolean isInstanceMethod)

public void
determineZSuperCallArgs(IRScope scope, IRBuilder<U, V, W, X, Y, Z> builder, List<Operand> callArgs, List<KeyValuePair<Operand, Operand>> keywordArgs)

protected abstract int
dynamicPiece(Operand[] pieces, int index, U piece, Encoding encoding)

protected void
protected abstract U[]
protected static void
protected Boolean
fals()

protected Variable
fcall(Variable result, Operand object, String name, Operand... args)

protected Variable
fcall(Variable result, Operand object, RubySymbol name, Operand... args)

protected Operand
protected Fixnum
fix(long value)

protected void
protected abstract Operand
frozen_string(U node)

protected abstract Operand
protected IRLoop
public Variable
protected Encoding
protected String
protected abstract U
getInBody(U node)

protected abstract U
protected abstract int
getLine(U node)

public abstract LocalVariable
getLocalVariable(RubySymbol name, int scopeDepth)

public IRManager
public RubySymbol
private IRBuilder<U, V, W, X, Y, Z>
private Variable
protected Label
protected Label
getNewLabel(String labelName)

public LocalVariable
getNewLocalVariable(RubySymbol name, int scopeDepth)

protected Variable
protected abstract IRubyObject
public TemporaryVariable
getYieldClosureVariable()

Get the variable for accessing the "yieldable" closure in this scope.

protected static Operand[]
getZSuperCallOperands(IRScope scope, List<Operand> callArgs, List<KeyValuePair<Operand, Operand>> keywordArgs, int[] flags)

protected void
hackPostExeSource(IRBuilder<U, V, W, X, Y, Z> builder)

protected void
protected void
protected boolean
private boolean
hasNamedRest(U rest)

protected void
if_else(Operand
what we will test against testValue
testVariable
,
Operand
what we want to testVariable to NOT be equal to.
testValue
,
IRBuilder.VoidCodeBlock
the code if test values do NOT match
ifBlock
,
IRBuilder.VoidCodeBlock
the code to execute otherwise.
elseBlock
)

Generate if testVariable NEQ testValue { ifBlock } else { elseBlock }.

protected void
if_not(Operand testVariable, Operand testValue, IRBuilder.VoidCodeBlock ifBlock)

public void
private Variable
protected abstract boolean
isBareStar(U node)

private boolean
protected abstract boolean
isErrorInfoGlobal(final U body)

protected abstract boolean
protected abstract boolean
isNilRest(U rest)

private static boolean
protected abstract boolean
isSideEffectFree(final U node)

protected boolean
protected boolean
protected void
jump(Label label)

protected void
label(String labelName, Consumer<Label> block)

protected boolean
literalWhenCheck(U value, Set<IRubyObject> seenLiterals, Map<IRubyObject, Integer> origLocs)

protected void
protected RubySymbol
protected abstract boolean
protected Nil
nil()

protected abstract X
optRescueFor(X node)

protected void
outputExceptionCheck(Operand excType, Operand excObj, Label caughtLabel)

private void
private void
protected Operand
protected Operand
protected Operand
protected Operand
putConstant(Operand parent, RubySymbol name, Operand value)

protected abstract Operand
putConstant(Y constant, Operand value)
Deprecated

protected abstract Operand
putConstant(Y constant, IRBuilder.CodeBlock value)

protected abstract void
protected void
receiveBreakException(Operand block, final CallInstr callInstr)

private void
protected abstract void
protected abstract void
receiveMethodArgs(V defNode)

protected abstract U
referenceFor(X node)

public static Operand[]
protected Operand
protected Operand
searchModuleForConst(Variable result, Operand startingModule, RubySymbol name)

protected Operand
protected Operand[]
setupCallArgs(U args, int[] flags)

protected abstract Operand
setupCallClosure(U args, U iter)

protected RubySymbol
protected RubySymbol
symbol(ByteList bytelist)

protected Operand
tap(Operand value, Consumer<Operand> block)

protected Variable
temp()

protected void
throwSyntaxError(int line, String message)

protected void
times(int times, IRBuilder.Consume2<Label, Integer> body)

protected Boolean
tru()

protected void
type_error(String message)

protected abstract U
whenBody(W arm)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait