KOS_OP_YIELD_CONST
Style: CONST. Arg = pool index of the constant to yield.
Stack:
[...] → [...](no stack effect). Yields the constant exactly asKOS_OP_YIELD1 yields a popped value: a flattened generator delivers to its consumer and threads into it, any other returns the YIELD signal. Marks the code as a generator, asKOS_OP_YIELDdoes.Compiler form: Produced by
ByteCodeProcessor.fuse_feederswhenKOS_OP_YIELD1 is fed by a bareKOS_OP_CONST. ANoneconstant takesKOS_OP_YIELD0 in the earlier squish pass instead.See also: KOS_OP_YIELD; compile/yield;
koskari/lib/opcode/YIELD_CONST.c.Covered by:
tests/lib/opcode/test_control_operand.py,tests/compile/test_fuse_feeders.py
Example: (yield 100) after compress. Pool: 0 = 100.
index |
opcode |
arg |
arg view |
comment |
|---|---|---|---|---|
0 |
YIELD_CONST |
0 |
0 (100) |
yield 100; nothing pushed first |