Package org.jruby.ir.builder
Class IRBuilderAST
java.lang.Object
org.jruby.ir.builder.IRBuilder<Node,DefNode,WhenNode,RescueBodyNode,Colon3Node,HashNode>
org.jruby.ir.builder.IRBuilderAST
public class IRBuilderAST
extends IRBuilder<Node,DefNode,WhenNode,RescueBodyNode,Colon3Node,HashNode>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.ir.builder.IRBuilder
IRBuilder.BinaryType, IRBuilder.CodeBlock, IRBuilder.Consume2<T,U>, IRBuilder.RunIt, IRBuilder.VoidCodeBlock, IRBuilder.VoidCodeBlockOne -
Field Summary
Fields inherited from class org.jruby.ir.builder.IRBuilder
afterPrologueIndex, argumentDescriptions, coverageMode, encoding, evalType, executesOnce, flipVariableCount, instructions, parent, scope, underscoreVariableSeen, variableBuilder -
Constructor Summary
ConstructorsConstructorDescriptionIRBuilderAST(IRManager manager, IRScope scope, IRBuilder parent) IRBuilderAST(IRManager manager, IRScope scope, IRBuilder parent, IRBuilder variableBuilder, org.jcodings.Encoding encoding) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanalwaysFalse(Node node) protected booleanalwaysTrue(Node node) protected NodebodyFor(RescueBodyNode node) build(ParseResult result) buildAlias(AliasNode alias) buildArgsCat(Variable result, ArgsCatNode argsCatNode) voidbuildArgsMasgn(Node node, Operand argsArray, boolean isMasgnRoot, int preArgsCount, int postArgsCount, int index, boolean isSplat) buildArgsPush(Variable result, ArgsPushNode node) buildArray(ArrayNode node, boolean operandOnly) protected voidbuildAssignment(List<Tuple<Node, ResultInstr>> assigns, Map<Node, Operand> reads) protected voidbuildAssignment(Node node, Operand rhsVal) protected voidbuildAssocs(Label testEnd, Operand original, Variable result, HashNode assocs, boolean inAlteration, boolean isSinglePattern, Variable errorString, boolean hasRest, Variable d) static NodeDeprecated.buildAttrAssignAssignment(Node node, Operand value) protected Operand[]buildAttrAssignCallArgs(Node args, Operand[] outValue, boolean containsAssignment) buildBackref(Variable result, BackRefNode node) buildBegin(BeginNode beginNode) buildBignum(BignumNode node) buildBlock(BlockNode node) voidbuildBlockArgsAssignment(Node node, Operand argsArray, int argIndex, boolean isSplat) buildBreak(BreakNode node) protected Operand[]buildCallArgs(Node args, int[] flags) protected Operand[]buildCallArgsArray(ListNode args, int[] flags) protected OperandbuildCallArgsArrayForSplat(ListNode args, int[] flags) protected OperandbuildCallKeywordArguments(HashNode keywords, int[] flags) buildClass(ClassNode node) Build a new class and add it to the current scope (s).buildClassVar(Variable result, ClassVarNode node) buildColon2(Variable result, Colon2Node colon2) protected OperandbuildColon2ForConstAsgnDeclNode(Node lhs, Variable valueResult, boolean constMissing) buildColon3(Variable result, Colon3Node node) buildComplex(ComplexNode node) buildConstDecl(ConstDeclNode node) buildConstDeclAssignment(ConstDeclNode constDeclNode, IRBuilder.CodeBlock valueBuilder) buildDAsgn(DAsgnNode dasgnNode) buildDefn(MethodDefNode node) buildDRegexp(Variable result, DRegexpNode node) buildDSymbol(Variable result, DSymbolNode node) buildDXStr(Variable result, DXStrNode node) buildEncoding(EncodingNode node) buildEnsureNode(EnsureNode ensureNode) buildFCall(Variable result, FCallNode node) buildFixnum(FixnumNode node) buildFloat(FloatNode node) buildGetArgumentDefinition(Node node, String type) protected OperandbuildGetDefinition(Node node) buildInstAsgn(InstAsgnNode node) buildInstVar(InstVarNode node) buildLambda(LambdaNode node) protected OperandbuildLazyWithOrder(CallNode node, Label lazyLabel, Label endLabel, boolean preserveOrder) buildLiteral(LiteralNode literalNode) buildLocalAsgn(LocalAsgnNode localAsgnNode) buildLocalVar(LocalVarNode node) buildMatch(Variable result, MatchNode matchNode) buildMatch2(Variable result, Match2Node matchNode) buildMatch3(Variable result, Match3Node matchNode) buildMultipleAsgn(MultipleAsgnNode multipleAsgnNode) voidbuildMultipleAssignment(MultipleAsgnNode multipleAsgnNode, Operand values) voidbuildMultipleAssignment2(MultipleAsgnNode multipleAsgnNode, List<Tuple<Node, ResultInstr>> assigns, Map<Node, Operand> reads, Variable values) voidbuildMultipleAssignmentArgs(MultipleAsgnNode multipleAsgnNode, Operand argsArray) buildNil()buildNthRef(NthRefNode node) buildOpAsgn(OpAsgnNode node) buildOpAsgnAnd(OpAsgnAndNode node) buildOpAsgnOr(OpAsgnOrNode orNode) protected VariablebuildPatternEach(Label testEnd, Variable result, Operand original, Variable deconstructed, Operand value, Node exprNodes, boolean inAlternation, boolean isSinglePattern, Variable errorString) buildPostExe(PostExeNode postExeNode) buildPreExe(PreExeNode preExeNode) buildRational(RationalNode node) buildRegexp(RegexpNode reNode) buildRescue(RescueNode node) buildRetry(RetryNode node) buildReturn(ReturnNode returnNode) buildSClass(SClassNode node) buildSplat(Variable result, SplatNode splatNode) buildStrRaw(StrNode strNode) buildSuper(Variable result, SuperNode node) buildSValue(Variable result, SValueNode node) buildSymbol(SymbolNode node) buildUndef(UndefNode node) buildUntil(UntilNode node) buildVAlias(VAliasNode valiasNode) buildVCall(Variable result, VCallNode node) protected voidbuildWhenArgs(WhenNode whenNode, Operand testValue, Label bodyLabel, Set<IRubyObject> seenLiterals, Map<IRubyObject, Integer> origLocs) buildWhile(WhileNode node) buildYield(Variable result, YieldNode node) buildZArray(Variable result) buildZSuper(Variable result, ZSuperNode node) protected booleancanBeLazyMethod(DefNode node) Combination of whether it is feasible for a method being processed to be lazy (e.g.protected booleanprotected voidcreatePrefixFromArgs(ByteList prefix, Node args) protected intdynamicPiece(Operand[] pieces, int i, Node pieceNode, org.jcodings.Encoding _unused) protected Node[]protected Operandfrozen_string(Node node) protected LocalVariablegetArgVariable(RubySymbol name, int depth) protected LocalVariablegetBlockArgVariable(RubySymbol name, int depth) protected OperandgetContainerFromCPath(Node cpath) protected Nodeprotected NodegetInExpression(Node node) protected intgetLocalVariable(RubySymbol name, int scopeDepth) protected IRubyObjectgetWhenLiteral(Node node) protected booleanisBareStar(Node node) protected booleanisErrorInfoGlobal(Node body) protected booleanisLiteralString(Node node) protected booleanprotected booleanisSideEffectFree(Node node) protected booleanneedsDefinitionCheck(Node node) newIRBuilder(IRManager manager, IRScope newScope) protected RescueBodyNodeoptRescueFor(RescueBodyNode node) protected OperandputConstant(Colon3Node colonNode, IRBuilder.CodeBlock valueBuilder) protected OperandputConstant(Colon3Node colonNode, Operand value) Deprecated.voidreceiveArgs(ArgsNode argsNode) Process all arguments specified for this scope.protected voidreceiveBlockArg(ArgsNode 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 VariablereceiveBlockArg(Variable v, Operand argsArray, int argIndex, boolean isSplat) protected voidreceiveBlockArgs(Node args) protected voidreceiveForArgs(Node node) voidreceiveMethodArgs(ArgsNode argsNode) voidreceiveMethodArgs(DefNode defNode) protected voidreceiveNonBlockArgs(ArgsNode argsNode, Variable keywords) voidreceiveRequiredArg(Node node, Variable keywords, int argIndex, Signature signature) protected NodereferenceFor(RescueBodyNode node) protected OperandsetupCallClosure(Node _unused, Node node) protected NodeMethods inherited from class org.jruby.ir.builder.IRBuilder
_call, addArg, addArgumentDescription, addInstr, addInstrAtBeginning, addRaiseError, addResultInstr, argumentResult, as_fixnum, binaryType, buildAlias, buildAnd, buildArrayPattern, buildAttrAssign, buildBreak, buildCase, buildClass, buildClassVar, buildClassVarAsgn, buildClassVarGetDefinition, buildConditional, buildConditionalLoop, buildConstantGetDefinition, buildDefinitionCheck, buildDefn, buildDefnCheckIfThenPaths, buildDefs, buildDRegex, buildDStr, buildDStr, buildDSymbol, buildDXStr, buildEncoding, buildEnsureInternal, buildEvalRoot, buildFindPattern, buildFlip, buildFor, buildForIter, buildGlobalAsgn, buildGlobalVar, buildGlobalVarGetDefinition, buildHashPattern, buildInstAsgn, buildInstVar, buildInstVarGetDefinition, buildIter, buildIterInner, buildLambda, buildLambdaInner, buildLocalVariableAssign, buildMatch, buildModule, buildModuleOrClassBody, buildNext, buildNthRef, buildOpAsgn, buildOpAsgnAnd, buildOpAsgnConstDecl, buildOpAsgnConstDecl, buildOpAsgnConstDeclAnd, buildOpAsgnConstDeclOr, buildOpAsgnOr, buildOpAsgnOrWithDefined, buildOpElementAsgnWith, buildOpElementAsgnWithMethod, buildOr, buildPatternCase, buildPatternEachHash, buildPatternEachIf, buildPatternLocal, buildPatternMatch, buildPatternOr, buildPatternSetEQQError, buildPatternSetGeneralError, buildPostExe, buildPreExe, buildRange, buildRational, buildRedo, buildRescueBodyInternal, buildRescueInternal, buildRetry, buildReturn, buildRoot, buildRootInner, buildSClass, buildSelf, buildSuper, buildUndef, buildVAlias, buildWhenValue, buildWhenValues, buildWithOrder, buildZSuper, buildZSuper, buildZSuperIfNest, call, call, canBacktraceBeRemoved, classVarContainer, classVarDefinitionContainer, computeScopeFlagsFrom, cond, cond, cond_ne_false, cond_ne_nil, cond_ne_true, copy, copy, createArgumentDescriptor, createBranch, createCall, createCurrentModuleVariable, deconstructHashPatternKeys, defineMethodInner, defineNewMethod, determineIfMaybeRefined, determineIfWeNeedLineNumber, determineSuperInstr, determineZSuperCallArgs, emitEnsureBlocks, extractCallOperands, fals, fcall, fcall, findContainerModule, fix, for_loop, getCurrentLoop, getCurrentModuleVariable, getEncoding, getFileName, getManager, getName, getNewLabel, getNewLabel, getNewLocalVariable, getValueInTemporaryVariable, getYieldClosureVariable, getZSuperCallOperands, hackPostExeSource, handleBreakAndReturnsInLambdas, handleNonlocalReturnInMethod, hasListener, if_else, if_not, initFlipStateVariable, isTopLevel, isTopScope, jump, label, literalWhenCheck, maybeGenerateIsNotEmptyErrorString, methodNameFor, nil, outputExceptionCheck, processEnsureRescueBlocks, protectCodeWithRescue, putConstant, putConstant, receiveBreakException, removeArg, searchConst, searchModuleForConst, searchModuleForConstNoFrills, setupCallArgs, symbol, symbol, tap, temp, throwSyntaxError, times, tru, type_error
-
Constructor Details
-
IRBuilderAST
-
IRBuilderAST
-
-
Method Details
-
buildAST
Deprecated. -
build
- Specified by:
buildin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
newIRBuilder
-
build
- Specified by:
buildin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
build
- Specified by:
buildin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildLambda
-
buildEncoding
-
buildMultipleAsgn
-
buildAssignment
-
buildMultipleAssignment2
public void buildMultipleAssignment2(MultipleAsgnNode multipleAsgnNode, List<Tuple<Node, ResultInstr>> assigns, Map<Node, Operand> reads, Variable values) -
buildLazyWithOrder
-
buildAttrAssignCallArgs
protected Operand[] buildAttrAssignCallArgs(Node args, Operand[] outValue, boolean containsAssignment) - Specified by:
buildAttrAssignCallArgsin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildCallKeywordArguments
-
buildCallArgsArrayForSplat
-
buildCallArgsArray
-
buildCallArgs
- Specified by:
buildCallArgsin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildAssignment
- Specified by:
buildAssignmentin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
getBlockArgVariable
-
receiveBlockArg
-
buildBlockArgsAssignment
-
buildAlias
-
buildAnd
-
buildArray
-
buildArgsCat
-
buildArgsPush
-
buildAttrAssignAssignment
-
buildBackref
-
buildBegin
-
buildBignum
-
buildBlock
-
buildBreak
-
buildCall
-
isNilRest
- Specified by:
isNilRestin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildAssocs
protected void buildAssocs(Label testEnd, Operand original, Variable result, HashNode assocs, boolean inAlteration, boolean isSinglePattern, Variable errorString, boolean hasRest, Variable d) - Specified by:
buildAssocsin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildPatternEach
protected Variable buildPatternEach(Label testEnd, Variable result, Operand original, Variable deconstructed, Operand value, Node exprNodes, boolean inAlternation, boolean isSinglePattern, Variable errorString) - Specified by:
buildPatternEachin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
getInExpression
- Specified by:
getInExpressionin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
getInBody
- Specified by:
getInBodyin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
isBareStar
- Specified by:
isBareStarin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildPatternCase
-
buildCase
-
whenBody
- Specified by:
whenBodyin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
containsVariableAssignment
- Specified by:
containsVariableAssignmentin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
frozen_string
- Specified by:
frozen_stringin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
getLine
- Specified by:
getLinein classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildWhenArgs
protected void buildWhenArgs(WhenNode whenNode, Operand testValue, Label bodyLabel, Set<IRubyObject> seenLiterals, Map<IRubyObject, Integer> origLocs) - Specified by:
buildWhenArgsin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
getWhenLiteral
- Specified by:
getWhenLiteralin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
isLiteralString
- Specified by:
isLiteralStringin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildClass
Build a new class and add it to the current scope (s). -
buildSClass
-
buildClassVar
-
buildClassVarAsgn
-
buildConstDecl
-
buildConstDeclAssignment
public Operand buildConstDeclAssignment(ConstDeclNode constDeclNode, IRBuilder.CodeBlock valueBuilder) -
putConstant
- Specified by:
putConstantin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
putConstant
Deprecated.- Specified by:
putConstantin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildColon2
-
buildColon3
-
buildComplex
-
needsDefinitionCheck
- Specified by:
needsDefinitionCheckin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildGetDefinition
- Specified by:
buildGetDefinitionin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildGetArgumentDefinition
-
buildDAsgn
-
canBeLazyMethod
Description copied from class:IRBuilderCombination 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).- Specified by:
canBeLazyMethodin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode> - Parameters:
node- syntactical representation of the definition- Returns:
- true if can be lazy
-
receiveMethodArgs
- Specified by:
receiveMethodArgsin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildDefn
-
buildDefs
-
getArgVariable
-
receiveRequiredArg
-
receiveNonBlockArgs
-
receiveBlockArg
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.- Parameters:
argsNode- the arguments containing the block arg, if any
-
receiveArgs
Process all arguments specified for this scope. This includes pre args (required args at the beginning of the argument list), opt args (arguments with a default value), a rest arg (catch-all for argument list overflow), post args (required arguments after a rest arg) and a block arg (to reify an incoming block into a Proc object.- Parameters:
argsNode- the args node containing the specification for the arguments
-
buildArgsMasgn
-
buildMultipleAssignment
-
buildMultipleAssignmentArgs
-
receiveMethodArgs
-
receiveForArgs
- Specified by:
receiveForArgsin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
receiveBlockArgs
- Specified by:
receiveBlockArgsin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildDot
-
dynamicPiece
- Specified by:
dynamicPiecein classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildDRegexp
-
buildDStr
-
buildDSymbol
-
buildDVar
-
buildDXStr
-
buildEnsureNode
-
buildFCall
-
setupCallClosure
- Specified by:
setupCallClosurein classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildFixnum
-
buildFlip
-
buildFloat
-
buildFor
-
buildGlobalAsgn
-
buildHash
-
buildIf
-
buildInstAsgn
-
buildInstVar
-
buildIter
-
buildLiteral
-
buildLocalAsgn
-
buildLocalVar
-
buildMatch
-
buildMatch2
-
buildMatch3
-
getContainerFromCPath
- Specified by:
getContainerFromCPathin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildNext
-
buildNthRef
-
buildNil
-
buildOpAsgn
-
buildColon2ForConstAsgnDeclNode
protected Operand buildColon2ForConstAsgnDeclNode(Node lhs, Variable valueResult, boolean constMissing) - Specified by:
buildColon2ForConstAsgnDeclNodein classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildOpAsgnConstDeclNode
-
buildOpAsgnAnd
-
buildOpAsgnOr
-
buildOpElementAsgn
-
buildOr
-
buildPostExe
-
buildPreExe
-
buildRational
-
buildRedo
-
buildRegexp
-
buildRescue
-
isSideEffectFree
- Specified by:
isSideEffectFreein classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
isErrorInfoGlobal
- Specified by:
isErrorInfoGlobalin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
exceptionNodesFor
- Specified by:
exceptionNodesForin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
bodyFor
- Specified by:
bodyForin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
optRescueFor
- Specified by:
optRescueForin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
referenceFor
- Specified by:
referenceForin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
buildRetry
-
buildReturn
-
buildSplat
-
buildStr
-
buildStrRaw
-
buildSuper
-
buildSValue
-
buildSymbol
-
buildUndef
-
buildUntil
-
buildVAlias
-
buildVCall
-
buildWhile
-
buildXStr
-
buildYield
-
buildZArray
-
buildZSuper
-
alwaysFalse
- Specified by:
alwaysFalsein classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
alwaysTrue
- Specified by:
alwaysTruein classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
getLocalVariable
- Specified by:
getLocalVariablein classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-
createPrefixFromArgs
- Overrides:
createPrefixFromArgsin classIRBuilder<Node,DefNode, WhenNode, RescueBodyNode, Colon3Node, HashNode>
-