Class ShortCircuitBlock

java.lang.Object
org.ek9lang.compiler.phase7.support.ShortCircuitBlock

public final class ShortCircuitBlock extends Object
THE short-circuit Boolean block: a LOGICAL_AND_BLOCK or LOGICAL_OR_BLOCK built from an already evaluated LEFT operand (with its primitive), a RIGHT operand evaluated only when LEFT does not decide, and the result computation left._and(right) / left._or(right). It owns the result CALL, its memory management (the result is a +1 producer: SCOPE_REGISTER only) and the LogicalDetails; the order of the instructions inside is left, _true primitive, right, result call, SCOPE_REGISTER - the same for every site.

Every site that builds one uses this - the and/or expressions, a guard AND its condition, a Boolean truth guard, the stream demand's bounded condition and a switch's or chain - never a hand-assembled copy (IR tidy plan FLOW-7). The caller generates the result temp AFTER the right operand's, so the temp order in the IR is unchanged.