Class CloneInfo
java.lang.Object
org.jruby.ir.transformations.inlining.CloneInfo
- Direct Known Subclasses:
InlineCloneInfo
,SimpleCloneInfo
Base class for cloning context object. Simple cloning and inline cloning both have
some common state and logic such as needing to maintain references to new constructed
replacement labels and variables.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncloneForCloningClosure
(IRClosure clonedClosure) getRenamedLabel
(Label label) Return a new instance of a label for the newly cloned scope.protected abstract Label
protected abstract Variable
How do we rename %self?getRenamedVariable
(Variable variable) Return a new instance of a variable for the newly cloned scope.protected abstract Variable
getRenamedVariableSimple
(Variable variable) How are typical variables renamed if they were not yet found in the variable renaming map?getScope()
-
Field Details
-
labelRenameMap
-
variableRenameMap
-
scope
-
-
Constructor Details
-
CloneInfo
-
-
Method Details
-
cloneForCloningClosure
-
getScope
- Returns:
- The IRScope this cloning operation is happening in (or is coming from).
-
getRenamedLabelSimple
-
getRenamedLabel
Return a new instance of a label for the newly cloned scope. Maps are maintained because Labels expect to share the same instance across a CFG.- Parameters:
label
- to be renamed.- Returns:
- the new Label
-
getRenamedSelfVariable
How do we rename %self?- Parameters:
self
- to be renamed- Returns:
- the new self or itself
-
getRenamedVariableSimple
How are typical variables renamed if they were not yet found in the variable renaming map?- Parameters:
variable
- to be renamed- Returns:
- the new variable
-
getRenamedVariable
Return a new instance of a variable for the newly cloned scope. Maps are maintained because Variables typically share the same instance across a CFG (of the same lexical depth).- Parameters:
variable
- to be renamed- Returns:
- the new Variable
-