Top Fields Constructors Methods
org.jruby.ir.builder

public Class IRBuilderAST

extends IRBuilder<Node, DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
Class Inheritance
Imports
org.jcodings.Encoding, org.jruby.ParseResult, .Ruby, .RubyBignum, .RubyComplex, .RubyFixnum, .RubyRational, .RubySymbol, org.jruby.ast.*, org.jruby.ast.types.ILiteralNode, .INameNode, org.jruby.common.IRubyWarnings, org.jruby.compiler.NotCompilableException, org.jruby.ir.IRClosure, .IRFor, .IRManager, .IRMethod, .IRModuleBody, .IRScope, .IRScriptBody, .Tuple, org.jruby.ir.instructions.*, org.jruby.ir.instructions.defined.GetErrorInfoInstr, .RestoreErrorInfoInstr, org.jruby.ir.interpreter.InterpreterContext, org.jruby.ir.operands.Array, .Bignum, .ChilledString, .Complex, .Filename, .Float, .FrozenString, .Hash, .ImmutableLiteral, .Integer, .Label, .LocalVariable, .MutableString, .Nil, .NullBlock, .Operand, .Regexp, .SValue, .Splat, .Symbol, .SymbolProc, .UndefinedValue, .Variable, .WrappedIRClosure, org.jruby.parser.StaticScope, org.jruby.runtime.ArgumentType, .Helpers, .Signature, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.ByteList, .CommonByteLists, .DefinedMessage, .KeyValuePair, org.jruby.util.cli.Options, java.io.File, .FileInputStream, .IOException, java.util.*, java.util.function.Function, java.util.stream.Collectors, .Stream

Field Summary

Inherited from org.jruby.ir.builder.IRBuilder:
activeEnsureBlockStackactiveRescueBlockStackactiveRescuersafterPrologueIndexargumentDescriptionscoverageModeencodingensureBodyBuildStackevalTypeexecutesOnceflagsflipVariableCountinstructionslastProcessedLineNumloopStackmethodNameneedsLineNumInfoparentscopetemporaryVariableIndexU_NILunderscoreVariableSeenvariableBuilder

Constructor Summary

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

public
IRBuilderAST(IRManager manager, IRScope scope, IRBuilder<U, V, W, X, Y, Z> parent)

Method Summary

Modifier and TypeMethod and Description
private void
addArgReceiveInstr(Variable v, Variable keywords, int argIndex, Signature signature)

private void
protected boolean
protected boolean
private Node[]
asList(Node node)

protected Node
public Operand
public Operand
public Operand
build(Variable result, Node node)

Implements abstract org.jruby.ir.builder.IRBuilder.build.

public Operand
buildAlias(final AliasNode alias)

public Operand
public Operand
buildArgsCat(Variable result, ArgsCatNode argsCatNode)

public void
buildArgsMasgn(Node node, Operand argsArray, boolean isMasgnRoot, int preArgsCount, int postArgsCount, int index, boolean isSplat)

public Operand
public Operand
buildArray(ArrayNode node, boolean operandOnly)

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

Implements abstract org.jruby.ir.builder.IRBuilder.buildAssocs.

public static Node
buildAST(boolean isCommandLineScript, String arg)
Deprecated

private Operand
public Operand
protected Operand[]
buildAttrAssignCallArgs(Node args, Operand[] outValue, boolean containsAssignment)

Implements abstract org.jruby.ir.builder.IRBuilder.buildAttrAssignCallArgs.

public Operand
public Operand
buildBegin(BeginNode beginNode)

public Operand
public Operand
public void
buildBlockArgsAssignment(Node node, Operand argsArray, int argIndex, boolean isSplat)

public Operand
public Operand
buildCall(Variable aResult, CallNode callNode, Label lazyLabel, Label endLabel)

protected Operand[]
buildCallArgs(Node args, int[] flags)

Implements abstract org.jruby.ir.builder.IRBuilder.buildCallArgs.

protected Operand[]
buildCallArgsArray(ListNode args, int[] flags)

protected Operand
protected Operand
buildCallKeywordArguments(HashNode keywords, int[] flags)

public Operand
buildCase(CaseNode caseNode)

public Operand
buildClass(ClassNode node)

Build a new class and add it to the current scope (s).

public Operand
public Operand
public Operand
buildColon2(Variable result, final Colon2Node colon2)

protected Operand
public Operand
public Operand
public Operand
public Operand
public Operand
buildDAsgn(final DAsgnNode dasgnNode)

public Operand
public Operand
public Operand
buildDot(final DotNode node)

public Operand
public Operand
buildDStr(Variable result, DStrNode node)

public Operand
public Operand
public Operand
public Operand
public Operand
buildEnsureNode(final EnsureNode ensureNode)

public Operand
public Operand
public Operand
public Operand
public Operand
public Operand
protected Operand
public Operand
pack-priv Operand
public Operand
buildHash(HashNode hashNode)

public Operand
buildIf(Variable result, final IfNode ifNode)

public Operand
public Operand
public Operand
buildIter(final IterNode iter)

public Operand
protected Operand
buildLazyWithOrder(CallNode node, Label lazyLabel, Label endLabel, boolean preserveOrder)

public Operand
public Operand
public Operand
public Operand
buildMatch(Variable result, MatchNode matchNode)

public Operand
buildMatch2(Variable result, Match2Node matchNode)

public Operand
buildMatch3(Variable result, Match3Node matchNode)

pack-priv Operand
public Operand
public void
buildMultipleAssignment(final MultipleAsgnNode multipleAsgnNode, Operand values)

public void
buildMultipleAssignment2(final MultipleAsgnNode multipleAsgnNode, List<Tuple<Node, ResultInstr>> assigns, Map<Node, Operand> reads, Variable values)

public void
buildMultipleAssignmentArgs(final MultipleAsgnNode multipleAsgnNode, Operand argsArray)

public Operand
buildNext(final NextNode nextNode)

public Operand
public Operand
public Operand
public Operand
public Operand
public Operand
public Operand
private Operand
buildOperand(Variable result, Node node)

private <T extends Node & ILiteralNode> Variable
buildOptimizedCaseWhen(CaseNode caseNode, Class<T> caseClass, Function<T, Long> caseFunction)

private void
buildOptimizedSwitch(Map<Integer, Tuple<Operand, Label>> jumpTable, Map.Entry<Integer, Tuple<Operand, Label>>[] jumpEntries, Label elseLabel, Operand value, Class<T> valueClass)

private Operand
public Operand
public Operand
protected Variable
buildPatternEach(Label testEnd, Variable result, Operand original, Variable deconstructed, Operand value, Node exprNodes, boolean inAlternation, boolean isSinglePattern, Variable errorString)

Implements abstract org.jruby.ir.builder.IRBuilder.buildPatternEach.

public Operand
public Operand
private InterpreterContext
public Operand
public Operand
buildRedo(RedoNode redoNode)

public Operand
public Operand
private Operand
buildRestKeywordArgs(HashNode keywordArgs, int[] flags)

public Operand
public Operand
buildReturn(ReturnNode returnNode)

public Operand
public Operand
buildSplat(Variable result, SplatNode splatNode)

private Variable
buildSplatForMultiAssign(Variable result, Operand argsArray, int preArgsCount, int postArgsCount, int index, boolean isSplat)

private Variable
buildStandardCaseWhen(CaseNode caseNode, Map<Node, Label> nodeBodies, Label endLabel, boolean hasElse, Label elseLabel, Operand value, Variable result)

public Operand
buildStr(StrNode strNode)

public Operand
public Operand
public Operand
public Operand
public Operand
public Operand
public Operand
buildVAlias(VAliasNode valiasNode)

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

Implements abstract org.jruby.ir.builder.IRBuilder.buildWhenArgs.

private void
buildWhenSplatValues(Variable eqqResult, Node node, Operand testValue, Label bodyLabel, Set<IRubyObject> seenLiterals, Map<IRubyObject, Integer> origLocs)

public Operand
public Operand
buildXStr(Variable result, XStrNode node)

public Operand
pack-priv Operand
buildYieldArgs(Node args, int[] flags)

public Operand
public Operand
protected boolean
canBeLazyMethod(DefNode
syntactical representation of the definition
node
)

Implements abstract org.jruby.ir.builder.IRBuilder.canBeLazyMethod.

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).

protected boolean
protected void
private void
debug(String message, Operand... operands)

protected int
dynamicPiece(Operand[] pieces, int i, Node pieceNode, Encoding _unused)

Implements abstract org.jruby.ir.builder.IRBuilder.dynamicPiece.

protected Node[]
protected Operand
private <T extends Node & ILiteralNode> Map<Integer, Tuple<Operand, Label>>
gatherLiteralWhenBodies(CaseNode caseNode, Map<Node, Label> nodeBodies, Function<T, Long> caseFunction)

protected LocalVariable
getArgVariable(RubySymbol name, int depth)

protected LocalVariable
protected Operand
protected Node
protected Node
protected int
public LocalVariable
private String
getVarNameFromScopeTree(IRScope scope, int depth, int offset)

protected IRubyObject
protected boolean
protected boolean
protected boolean
protected boolean
private boolean
protected boolean
protected boolean
public IRBuilderAST
newIRBuilder(IRManager manager, IRScope newScope)

private NotCompilableException
notCompilable(String message, Node node)

protected RescueBodyNode
private void
processReads(Variable rhsVal, List<Tuple<Node, ResultInstr>> assigns, Map<Node, Operand> reads, Node node)

protected Operand
protected Operand
putConstant(Colon3Node colonNode, Operand value)

Implements abstract org.jruby.ir.builder.IRBuilder.putConstant.

Deprecated

public void
receiveArgs(final ArgsNode
the args node containing the specification for the arguments
argsNode
)

Process all arguments specified for this scope.

protected Variable
receiveBlockArg(Variable v, Operand argsArray, int argIndex, boolean isSplat)

protected void
receiveBlockArg(final ArgsNode
the arguments containing the block arg, if any
argsNode
)

Reify the implicit incoming block into a full Proc, for use as "block arg", but only if a block arg is specified in this scope's arguments.

protected void
protected void
public void
public void
protected void
receiveNonBlockArgs(final ArgsNode argsNode, Variable keywords)

public void
receiveRequiredArg(Node node, Variable keywords, int argIndex, Signature signature)

protected Node
protected Operand
private static Map.Entry<Integer, Tuple<Operand, Label>>[]
protected Node
Inherited from org.jruby.ir.builder.IRBuilder:
_calladdArgaddArgumentDescriptionaddInstraddInstrAtBeginningaddRaiseErroraddRaiseErroraddResultInstrargumentResultas_fixnumbinaryTypebuildAliasbuildAndbuildArrayPatternbuildAttrAssignbuildBreakbuildCasebuildClassbuildClassVarbuildClassVarAsgnbuildClassVarGetDefinitionbuildConditionalbuildConditionalLoopbuildConstantGetDefinitionbuildDefinitionCheckbuildDefnbuildDefnCheckIfThenPathsbuildDefsbuildDRegexbuildDStrbuildDStrbuildDSymbolbuildDXStrbuildEncodingbuildEnsureInternalbuildEvalRootbuildFindPatternbuildFlipbuildForbuildForIterbuildGlobalAsgnbuildGlobalVarbuildGlobalVarGetDefinitionbuildHashPatternbuildInstAsgnbuildInstVarbuildInstVarGetDefinitionbuildIterbuildIterInnerbuildLambdabuildLambdaInnerbuildLocalVariableAssignbuildMatchbuildModulebuildModuleOrClassBodybuildNextbuildNthRefbuildOpAsgnbuildOpAsgnAndbuildOpAsgnConstDeclbuildOpAsgnConstDeclbuildOpAsgnConstDeclAndbuildOpAsgnConstDeclOrbuildOpAsgnOrbuildOpAsgnOrWithDefinedbuildOpElementAsgnWithbuildOpElementAsgnWithMethodbuildOrbuildPatternCasebuildPatternEachHashbuildPatternEachIfbuildPatternLocalbuildPatternMatchbuildPatternOrbuildPatternSetEQQErrorbuildPatternSetGeneralErrorbuildPostExebuildRangebuildRationalbuildRedobuildRescueBodyInternalbuildRescueInternalbuildRetrybuildReturnbuildRootbuildRootInnerbuildSClassbuildSelfbuildSuperbuildUndefbuildVAliasbuildWhenValuebuildWhenValuesbuildWithOrderbuildZSuperbuildZSuperIfNestcallcallcanBacktraceBeRemovedclassVarContainerclassVarDefinitionContainercomputeScopeFlagsFromcondcondcond_ne_falsecond_ne_nilcond_ne_truecopycopycreateArgumentDescriptorcreateBranchcreateCallcreateCurrentModuleVariabledeconstructHashPatternKeysdefineMethodInnerdefineNewMethoddetermineIfMaybeRefineddetermineIfWeNeedLineNumberdetermineSuperInstrdetermineZSuperCallArgsemitEnsureBlocksextractCallOperandsfalsfcallfcallfindContainerModulefixfor_loopgetCurrentLoopgetCurrentModuleVariablegetEncodinggetFileNamegetManagergetNamegetNewLabelgetNewLabelgetNewLocalVariablegetValueInTemporaryVariablegetYieldClosureVariablegetZSuperCallOperandshackPostExeSourcehandleBreakAndReturnsInLambdashandleNonlocalReturnInMethodhasListenerif_elseif_notinitFlipStateVariableisTopLevelisTopScopejumplabelliteralWhenCheckmaybeGenerateIsNotEmptyErrorStringmethodNameForniloutputExceptionCheckprocessEnsureRescueBlocksprotectCodeWithRescueputConstantputConstantreceiveBreakExceptionremoveArgsearchConstsearchModuleForConstsearchModuleForConstNoFrillssetupCallArgssymbolsymboltaptempthrowSyntaxErrortimestrutype_error