Files
UnrealEngineUWP/Engine/Source/Runtime/CoreUObject
russell johnston 43ee153dd8 Implement defer in VerseVM
Defer blocks run for one of several reasons: normal block exit, exit via break or return, or (not yet implemented) task cancellation. To accommodate this, defer bytecode accepts a jump target index and switches on it after running. This index is stored in a register allocated for the defer block, which is sufficient because defers are not re-entrant. The register and switch are elided when the block runs only on the normal exit path.

The switch instruction has a variadic label operand. To simplify label fixup, all variadic operands are moved from `TArray` fields in the instructions to a shared trailing array in `VProcedure`. (Variadic operands to suspension captures remain `TArray`s.)

Early exit may cross several defer blocks on the way to its eventual jump target. Each defer block wraps these jump targets in a thunk, which passes the index for the wrapped target to the defer block. Exit control flow thus executes a chain of these thunks, ending with the actual exit jump when it reaches the appropriate scope.

#rb Markus.Breyer, Tim.Smith

[CL 32670628 by russell johnston in ue5-main branch]
2024-04-02 12:33:04 -04:00
..
2024-04-02 12:33:04 -04:00
2024-04-02 12:33:04 -04:00