KOS_OP_YIELD_VAR
Style: VAR. Arg = pool index of the name.
Stack:
[...] → [...](no stack effect). Resolves the name in the current frame’s namespace, raisingNameErrorwhen it is unbound asKOS_OP_VARwould, and yields the value exactly asKOS_OP_YIELD1 yields a popped one. Marks the code as a generator.Compiler form: Produced by
ByteCodeProcessor.fuse_feederswhenKOS_OP_YIELD1 is fed by a bareKOS_OP_VAR. Lowers toKOS_OP_YIELD_FASTthrough the generic schema-drivenconvert_fastpath when the name has a fast slot.See also: KOS_OP_YIELD; KOS_OP_YIELD_FAST;
koskari/lib/opcode/YIELD_VAR.c.Covered by:
tests/lib/opcode/test_control_operand.py,tests/compile/test_fuse_feeders.py
Example: (yield x) at module level, where x has no fast slot. Pool: 0 = x.
index |
opcode |
arg |
arg view |
comment |
|---|---|---|---|---|
0 |
YIELD_VAR |
0 |
0 (x) |
yield the value of |