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, transfer to the ifTrue label; if false, tranfer to the ifFalse label.


Field Summary
 Label ifFalse
           
 Label ifTrue
           
 boolean trueBranchComesFirst
          True if the ifTrue label comes before the ifFalse label.
 
Fields inherited from class gnu.expr.Target
Ignore, pushObject, returnObject
 
Constructor Summary
ConditionalTarget(Label ifTrue, Label ifFalse)
           
 
Method Summary
 void compileFromStack(Compilation comp, Type stackType)
           
 Type getType()
           
 
Methods inherited from class gnu.expr.Target
pushValue, returnValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ifTrue

public Label ifTrue

ifFalse

public Label ifFalse

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.
Constructor Detail

ConditionalTarget

public ConditionalTarget(Label ifTrue,
                         Label ifFalse)
Parameters:
ifTrue - label to jump to if this evaluates to true
ifFalse - label to jump to if true
Method Detail

getType

public Type getType()
Overrides:
getType in class Target

compileFromStack

public void compileFromStack(Compilation comp,
                             Type stackType)
Overrides:
compileFromStack in class Target