org.jetbrains.kotlin.codegen.when
Class SwitchCodegen
java.lang.Object
org.jetbrains.kotlin.codegen.when.SwitchCodegen
- Direct Known Subclasses:
- EnumSwitchCodegen, IntegralConstantsSwitchCodegen, StringSwitchCodegen
public abstract class SwitchCodegen
- extends java.lang.Object
Method Summary |
void |
generate()
Generates bytecode for entire when expression |
protected void |
generateEntries()
|
protected void |
generateNullCheckIfNeeded()
|
protected void |
generateSubject()
Should generate int subject on top of the stack
Default implementation just run codegen for actual subject of expression
May also gen nullability check if needed |
protected abstract void |
processConstant( constant,
org.jetbrains.org.objectweb.asm.Label entryLabel)
|
protected void |
putTransitionOnce(int value,
org.jetbrains.org.objectweb.asm.Label entryLabel)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
expression
protected final JetWhenExpression expression
isStatement
protected final boolean isStatement
codegen
protected final ExpressionCodegen codegen
bindingContext
protected final BindingContext bindingContext
subjectType
protected final org.jetbrains.org.objectweb.asm.Type subjectType
resultType
protected final org.jetbrains.org.objectweb.asm.Type resultType
v
protected final org.jetbrains.org.objectweb.asm.commons.InstructionAdapter v
transitionsTable
protected final java.util.NavigableMap<java.lang.Integer,org.jetbrains.org.objectweb.asm.Label> transitionsTable
entryLabels
protected final java.util.List<org.jetbrains.org.objectweb.asm.Label> entryLabels
elseLabel
protected org.jetbrains.org.objectweb.asm.Label elseLabel
endLabel
protected org.jetbrains.org.objectweb.asm.Label endLabel
defaultLabel
protected org.jetbrains.org.objectweb.asm.Label defaultLabel
SwitchCodegen
public SwitchCodegen(@NotNull
JetWhenExpression expression,
boolean isStatement,
@NotNull
ExpressionCodegen codegen)
generate
public void generate()
- Generates bytecode for entire when expression
processConstant
protected abstract void processConstant(@NotNull
constant,
@NotNull
org.jetbrains.org.objectweb.asm.Label entryLabel)
putTransitionOnce
protected void putTransitionOnce(int value,
@NotNull
org.jetbrains.org.objectweb.asm.Label entryLabel)
generateSubject
protected void generateSubject()
- Should generate int subject on top of the stack
Default implementation just run codegen for actual subject of expression
May also gen nullability check if needed
generateNullCheckIfNeeded
protected void generateNullCheckIfNeeded()
generateEntries
protected void generateEntries()