Class ShortCircuitBlock
java.lang.Object
org.ek9lang.compiler.phase7.support.ShortCircuitBlock
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe parts of one block. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionand(ShortCircuitBlock.Operands operands) RIGHT is evaluated only when LEFT is true.of(Function<LogicalDetails, IRInstr> operation, ShortCircuitBlock.Operands operands) The block for the given operation (LogicalOperationInstr::andOperationor::orOperation).or(ShortCircuitBlock.Operands operands) RIGHT is evaluated only when LEFT is false.
-
Constructor Details
-
ShortCircuitBlock
-
-
Method Details
-
and
RIGHT is evaluated only when LEFT is true. -
or
RIGHT is evaluated only when LEFT is false. -
of
The block for the given operation (LogicalOperationInstr::andOperationor::orOperation).
-