org.jetbrains.kotlin.cfg
Class JetControlFlowBuilderAdapter
java.lang.Object
org.jetbrains.kotlin.cfg.JetControlFlowBuilderAdapter
- All Implemented Interfaces:
- JetControlFlowBuilder
- Direct Known Subclasses:
- JetControlFlowInstructionsGenerator
public abstract class JetControlFlowBuilderAdapter
- extends java.lang.Object
- implements JetControlFlowBuilder
Method Summary |
void |
bindLabel(Label label)
|
void |
bindValue(PseudoValue value,
JetElement element)
|
CallInstruction |
call(JetElement valueElement,
ResolvedCall<?> resolvedCall,
java.util.Map<PseudoValue,ReceiverValue> receiverValues,
java.util.Map<PseudoValue,ValueParameterDescriptor> arguments)
|
InstructionWithValue |
createAnonymousObject(JetObjectLiteralExpression expression)
|
InstructionWithValue |
createFunctionLiteral(JetFunctionLiteralExpression expression)
|
Label |
createUnboundLabel()
|
Label |
createUnboundLabel(java.lang.String name)
|
void |
declareFunction(JetElement subroutine,
Pseudocode pseudocode)
|
void |
declareParameter(JetParameter parameter)
|
void |
declareVariable(JetVariableDeclaration property)
|
void |
enterLexicalScope(JetElement element)
|
LoopInfo |
enterLoop(JetLoopExpression expression)
|
void |
enterLoopBody(JetLoopExpression expression)
|
void |
enterSubroutine(JetElement subroutine)
|
void |
enterTryFinally(GenerationTrigger trigger)
|
void |
exitLexicalScope(JetElement element)
|
void |
exitLoopBody(JetLoopExpression expression)
|
Pseudocode |
exitSubroutine(JetElement subroutine)
|
void |
exitTryFinally()
|
PseudoValue |
getBoundValue(JetElement element)
|
Label |
getConditionEntryPoint(JetElement labelElement)
|
JetLoopExpression |
getCurrentLoop()
|
JetElement |
getCurrentSubroutine()
|
protected abstract JetControlFlowBuilder |
getDelegateBuilder()
|
Label |
getEntryPoint(JetElement labelElement)
|
Label |
getExitPoint(JetElement labelElement)
|
JetElement |
getReturnSubroutine()
|
void |
jump(Label label,
JetElement element)
|
void |
jumpOnFalse(Label label,
JetElement element,
PseudoValue conditionValue)
|
void |
jumpOnTrue(Label label,
JetElement element,
PseudoValue conditionValue)
|
void |
jumpToError(JetElement element)
|
InstructionWithValue |
loadConstant(JetExpression expression,
CompileTimeConstant<?> constant)
|
InstructionWithValue |
loadStringTemplate(JetStringTemplateExpression expression,
java.util.List<PseudoValue> inputValues)
|
void |
loadUnit(JetExpression expression)
|
MagicInstruction |
magic(JetElement instructionElement,
JetElement valueElement,
java.util.List<PseudoValue> inputValues,
java.util.Map<PseudoValue,TypePredicate> expectedTypes,
MagicKind kind)
|
void |
mark(JetElement element)
|
MergeInstruction |
merge(JetExpression expression,
java.util.List<PseudoValue> inputValues)
|
PseudoValue |
newValue(JetElement element)
|
void |
nondeterministicJump(Label label,
JetElement element,
PseudoValue inputValue)
|
void |
nondeterministicJump(java.util.List<Label> labels,
JetElement element)
|
OperationInstruction |
predefinedOperation(JetExpression expression,
JetControlFlowBuilder.PredefinedOperation operation,
java.util.List<PseudoValue> inputValues)
|
ReadValueInstruction |
readVariable(JetExpression expression,
ResolvedCall<?> resolvedCall,
java.util.Map<PseudoValue,ReceiverValue> receiverValues)
|
void |
repeatPseudocode(Label startLabel,
Label finishLabel)
|
void |
returnNoValue(JetReturnExpression returnExpression,
JetElement subroutine)
|
void |
returnValue(JetExpression returnExpression,
PseudoValue returnValue,
JetElement subroutine)
|
void |
throwException(JetThrowExpression throwExpression,
PseudoValue thrownValue)
|
void |
write(JetElement assignment,
JetElement lValue,
PseudoValue rValue,
AccessTarget target,
java.util.Map<PseudoValue,ReceiverValue> receiverValues)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JetControlFlowBuilderAdapter
public JetControlFlowBuilderAdapter()
getDelegateBuilder
@NotNull
protected abstract JetControlFlowBuilder getDelegateBuilder()
loadUnit
public void loadUnit(@NotNull
JetExpression expression)
- Specified by:
loadUnit
in interface JetControlFlowBuilder
loadConstant
@NotNull
public InstructionWithValue loadConstant(@NotNull
JetExpression expression,
@Nullable
CompileTimeConstant<?> constant)
- Specified by:
loadConstant
in interface JetControlFlowBuilder
createAnonymousObject
@NotNull
public InstructionWithValue createAnonymousObject(@NotNull
JetObjectLiteralExpression expression)
- Specified by:
createAnonymousObject
in interface JetControlFlowBuilder
createFunctionLiteral
@NotNull
public InstructionWithValue createFunctionLiteral(@NotNull
JetFunctionLiteralExpression expression)
- Specified by:
createFunctionLiteral
in interface JetControlFlowBuilder
loadStringTemplate
@NotNull
public InstructionWithValue loadStringTemplate(@NotNull
JetStringTemplateExpression expression,
@NotNull
java.util.List<PseudoValue> inputValues)
- Specified by:
loadStringTemplate
in interface JetControlFlowBuilder
magic
@NotNull
public MagicInstruction magic(@NotNull
JetElement instructionElement,
@Nullable
JetElement valueElement,
@NotNull
java.util.List<PseudoValue> inputValues,
@NotNull
java.util.Map<PseudoValue,TypePredicate> expectedTypes,
@NotNull
MagicKind kind)
- Specified by:
magic
in interface JetControlFlowBuilder
merge
@NotNull
public MergeInstruction merge(@NotNull
JetExpression expression,
@NotNull
java.util.List<PseudoValue> inputValues)
- Specified by:
merge
in interface JetControlFlowBuilder
readVariable
@NotNull
public ReadValueInstruction readVariable(@NotNull
JetExpression expression,
@NotNull
ResolvedCall<?> resolvedCall,
@NotNull
java.util.Map<PseudoValue,ReceiverValue> receiverValues)
- Specified by:
readVariable
in interface JetControlFlowBuilder
call
@NotNull
public CallInstruction call(@NotNull
JetElement valueElement,
@NotNull
ResolvedCall<?> resolvedCall,
@NotNull
java.util.Map<PseudoValue,ReceiverValue> receiverValues,
@NotNull
java.util.Map<PseudoValue,ValueParameterDescriptor> arguments)
- Specified by:
call
in interface JetControlFlowBuilder
predefinedOperation
@NotNull
public OperationInstruction predefinedOperation(@NotNull
JetExpression expression,
@NotNull
JetControlFlowBuilder.PredefinedOperation operation,
@NotNull
java.util.List<PseudoValue> inputValues)
- Specified by:
predefinedOperation
in interface JetControlFlowBuilder
createUnboundLabel
@NotNull
public Label createUnboundLabel()
- Specified by:
createUnboundLabel
in interface JetControlFlowBuilder
createUnboundLabel
@NotNull
public Label createUnboundLabel(@NotNull
java.lang.String name)
- Specified by:
createUnboundLabel
in interface JetControlFlowBuilder
bindLabel
public void bindLabel(@NotNull
Label label)
- Specified by:
bindLabel
in interface JetControlFlowBuilder
jump
public void jump(@NotNull
Label label,
@NotNull
JetElement element)
- Specified by:
jump
in interface JetControlFlowBuilder
jumpOnFalse
public void jumpOnFalse(@NotNull
Label label,
@NotNull
JetElement element,
@Nullable
PseudoValue conditionValue)
- Specified by:
jumpOnFalse
in interface JetControlFlowBuilder
jumpOnTrue
public void jumpOnTrue(@NotNull
Label label,
@NotNull
JetElement element,
@Nullable
PseudoValue conditionValue)
- Specified by:
jumpOnTrue
in interface JetControlFlowBuilder
nondeterministicJump
public void nondeterministicJump(@NotNull
Label label,
@NotNull
JetElement element,
@Nullable
PseudoValue inputValue)
- Specified by:
nondeterministicJump
in interface JetControlFlowBuilder
nondeterministicJump
public void nondeterministicJump(@NotNull
java.util.List<Label> labels,
@NotNull
JetElement element)
- Specified by:
nondeterministicJump
in interface JetControlFlowBuilder
jumpToError
public void jumpToError(@NotNull
JetElement element)
- Specified by:
jumpToError
in interface JetControlFlowBuilder
throwException
public void throwException(@NotNull
JetThrowExpression throwExpression,
@NotNull
PseudoValue thrownValue)
- Specified by:
throwException
in interface JetControlFlowBuilder
getEntryPoint
@NotNull
public Label getEntryPoint(@NotNull
JetElement labelElement)
- Specified by:
getEntryPoint
in interface JetControlFlowBuilder
getExitPoint
@NotNull
public Label getExitPoint(@NotNull
JetElement labelElement)
- Specified by:
getExitPoint
in interface JetControlFlowBuilder
getConditionEntryPoint
@NotNull
public Label getConditionEntryPoint(@NotNull
JetElement labelElement)
- Specified by:
getConditionEntryPoint
in interface JetControlFlowBuilder
enterLoop
@NotNull
public LoopInfo enterLoop(@NotNull
JetLoopExpression expression)
- Specified by:
enterLoop
in interface JetControlFlowBuilder
enterLoopBody
public void enterLoopBody(@NotNull
JetLoopExpression expression)
- Specified by:
enterLoopBody
in interface JetControlFlowBuilder
exitLoopBody
public void exitLoopBody(@NotNull
JetLoopExpression expression)
- Specified by:
exitLoopBody
in interface JetControlFlowBuilder
getCurrentLoop
@Nullable
public JetLoopExpression getCurrentLoop()
- Specified by:
getCurrentLoop
in interface JetControlFlowBuilder
enterTryFinally
public void enterTryFinally(@NotNull
GenerationTrigger trigger)
- Specified by:
enterTryFinally
in interface JetControlFlowBuilder
exitTryFinally
public void exitTryFinally()
- Specified by:
exitTryFinally
in interface JetControlFlowBuilder
enterSubroutine
public void enterSubroutine(@NotNull
JetElement subroutine)
- Specified by:
enterSubroutine
in interface JetControlFlowBuilder
exitSubroutine
@NotNull
public Pseudocode exitSubroutine(@NotNull
JetElement subroutine)
- Specified by:
exitSubroutine
in interface JetControlFlowBuilder
getCurrentSubroutine
@NotNull
public JetElement getCurrentSubroutine()
- Specified by:
getCurrentSubroutine
in interface JetControlFlowBuilder
getReturnSubroutine
@Nullable
public JetElement getReturnSubroutine()
- Specified by:
getReturnSubroutine
in interface JetControlFlowBuilder
returnValue
public void returnValue(@NotNull
JetExpression returnExpression,
@NotNull
PseudoValue returnValue,
@NotNull
JetElement subroutine)
- Specified by:
returnValue
in interface JetControlFlowBuilder
returnNoValue
public void returnNoValue(@NotNull
JetReturnExpression returnExpression,
@NotNull
JetElement subroutine)
- Specified by:
returnNoValue
in interface JetControlFlowBuilder
write
public void write(@NotNull
JetElement assignment,
@NotNull
JetElement lValue,
@NotNull
PseudoValue rValue,
@NotNull
AccessTarget target,
@NotNull
java.util.Map<PseudoValue,ReceiverValue> receiverValues)
- Specified by:
write
in interface JetControlFlowBuilder
declareParameter
public void declareParameter(@NotNull
JetParameter parameter)
- Specified by:
declareParameter
in interface JetControlFlowBuilder
declareVariable
public void declareVariable(@NotNull
JetVariableDeclaration property)
- Specified by:
declareVariable
in interface JetControlFlowBuilder
declareFunction
public void declareFunction(@NotNull
JetElement subroutine,
@NotNull
Pseudocode pseudocode)
- Specified by:
declareFunction
in interface JetControlFlowBuilder
repeatPseudocode
public void repeatPseudocode(@NotNull
Label startLabel,
@NotNull
Label finishLabel)
- Specified by:
repeatPseudocode
in interface JetControlFlowBuilder
mark
public void mark(@NotNull
JetElement element)
- Specified by:
mark
in interface JetControlFlowBuilder
getBoundValue
@Nullable
public PseudoValue getBoundValue(@Nullable
JetElement element)
- Specified by:
getBoundValue
in interface JetControlFlowBuilder
bindValue
public void bindValue(@NotNull
PseudoValue value,
@NotNull
JetElement element)
- Specified by:
bindValue
in interface JetControlFlowBuilder
newValue
@NotNull
public PseudoValue newValue(@Nullable
JetElement element)
- Specified by:
newValue
in interface JetControlFlowBuilder
enterLexicalScope
public void enterLexicalScope(@NotNull
JetElement element)
- Specified by:
enterLexicalScope
in interface JetControlFlowBuilder
exitLexicalScope
public void exitLexicalScope(@NotNull
JetElement element)
- Specified by:
exitLexicalScope
in interface JetControlFlowBuilder