Package gnu.expr
Class ConditionalTarget
- java.lang.Object
-
- gnu.expr.Target
-
- gnu.expr.ConditionalTarget
-
public class ConditionalTarget extends Target
This is the Target of a boolean expression, in a conditional context. If the expression evaluates to true, transfer to the ifTrue label; if false, transfer to the ifFalse label.
-
-
Field Summary
Fields Modifier and Type Field Description LabelifFalseLabelifTruestatic MethodisTrueMethodbooleantrueBranchComesFirstTrue if the ifTrue label comes before the ifFalse label.-
Fields inherited from class gnu.expr.Target
Ignore, pushObject
-
-
Constructor Summary
Constructors Constructor Description ConditionalTarget(Label ifTrue, Label ifFalse, Language language)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompileFromStack(Compilation comp, Type stackType)voidemitGotoFirstBranch(CodeAttr code)Goto whichever of IfTrue or ifFalse is specified by trueBranchComesFirst.TypegetType()
-
-
-
Field Detail
-
ifTrue
public Label ifTrue
-
ifFalse
public Label ifFalse
-
isTrueMethod
public static final Method isTrueMethod
-
trueBranchComesFirst
public boolean trueBranchComesFirst
True if the ifTrue label comes before the ifFalse label. This is used in the hope we can optimize away a branch followed by its target.
-
-
Method Detail
-
compileFromStack
public void compileFromStack(Compilation comp, Type stackType)
- Specified by:
compileFromStackin classTarget
-
emitGotoFirstBranch
public final void emitGotoFirstBranch(CodeAttr code)
Goto whichever of IfTrue or ifFalse is specified by trueBranchComesFirst. Normally, the goto should get optimized away as a no-op.
-
-