Bind the `task` class to `VTask` with a native `Await` method. For tasks created before this binding, `VTask` uses a trivial emergent type and shape, so code that runs in this context (i.e. module top-levels) does not support structured concurrency.
Each `sync` arm spawns a new task, and the overall expression `Await`s each of them in turn to collect their results. These tasks may need to remain active when the outer `sync` expression suspends, which conflicts with the way lenient suspension forcibly suspends child tasks - to resolve this, suspenion no longer affects child tasks (in fact child tasks are no longer tracked at all) and instead `EndTask` (really any time the current task changes) must check for an already-suspended `YieldTask`.
Also adjust the bytecode of `for` loops so that the body runs outside of any failure context, rather than forwarding failures. This enables `<suspends>` calls in `for` loop bodies.
#rb Markus.Breyer
[CL 32277546 by russell johnston in ue5-main branch]
Replace `TVerseFunction` and its `FProperty` with a `VRestValue`.
Unify `TVerseFunction` and `FInteropUtils::TryInvoke...` for calling methods vs module/interface functions. (This includes fixing named non-defaulted parameters in the `TVerseFunction` path, apparently previous unused.)
Wrap the `verse::task*` result of `<native_callable>` APIs in `FVerseTask`; remove `Cancel` from `TVerseCall` (see SOL-6056).
Switch to decorated but unmangled names in VNI-generated binding glue.
Switch to decorated method names in VerseVM to match the binding glue.
Run `UVerseVMClass` CDO initialization after binding glue computes class layout.
Always create a `UObject` for `<native>` classes, now that their methods are bound.
#rb markus.breyer, tim.smith
#okforversepublic
[CL 32004566 by russell johnston in ue5-main branch]
#rb russell.johnston
#okforversepublic
Top-level code is allowed to have mostly arbitrary expressions in it. For example, you could have `X:int = 1+2` at the top level. Prior to this patch, we had a janky AST interpreter that pattern matched code at the top level. It only worked for things that were constant to the degree it understood. However, it's cleaner to just generate bytecode for top-level code that uses the normal interperter and binds evaluation results to variables.
[CL 31833870 by saam barati in ue5-main branch]
#okforversepublic
VerseVM:
- named & default params
- variadic immediate support in VVM code generator
[CL 31679794 by shawn mcgrath in ue5-main branch]
- Added ability to optionally skip SDK validation when making a Target instance even if we don't want to skip Target validation (used when we make the base UnrealEditor target to compare to project's Editor target - we don't need to manage SDK for that temporary UnrealEditor target).
- ShaderCompileWorker is now BuildEnvironment.UniqueIfNeeded, which will build into the project binaries dir if needed (based on per-project SDK override)
- UnrealPak is marked as not caring about an SDK versions so it can be built along with SCW that does care
- Added $(BinaryDir) variable to UEBuildTarget, etc, for the location of the first Binary in the output binaries
#rb David.Harvey, Joe.Kirchoff
[CL 31661939 by josh adams in ue5-main branch]
- Some static variables made it tricky, so added some support to make it simpler on users of the static variables
#rb David.Harvey
[CL 31431441 by josh adams in ue5-main branch]
Added support for Visit template specialization. This allows for C++ structures to have visitors defined without having to modify the visitor objects. Work in progress.
#rnx
#rb yiliang.siew
[CL 31288348 by tim smith in ue5-main branch]
Expose RuntimeDependencies to ToolChain ModifyBuildProducts and LinkFiles methods. This is required to properly bundle DLLs on some platforms.
#Jira UE-199874
#rb David.Harvey
[CL 31277174 by michael wanderson in ue5-main branch]
[FYI] michael.wanderson
Original CL Desc
-----------------------------------------------------------------
Expose RuntimeDependencies to ToolChain ModifyBuildProducts and LinkFiles methods. This is required to properly bundle DLLs on some platforms.
#Jira UE-199874
#rb David.Harvey
#changelist validated
#virtualized
[CL 31249061 by bob tellez in ue5-main branch]
A new VTask object tracks a chain of the VFrames, from the point where the task was spawned to the point where it suspended. This task boundary is recorded by a pair of BeginTask/EndTask instructions. Individual <suspends> function calls in the new VM do not have distinct tasks, and <suspends> does not change how bytecode is generated.
Native functions may suspend the current task by returning a new FOpResult of kind Yield, at which point the current PC is saved to the VTask, its VFrames are detached from the stack, and execution continues in the parent task. Native code may resume a task with a new VTask::ResumeInTransaction API, which re-attaches these VFrames to the top of the stack and continues execution from the saved PC.
VNI functions continue to use the verse::continuation API, which now wraps a VTask pointer and thus must be accounted for during GC tracing.
#rb Markus.Breyer, saam.barati
#okforversepublic
[CL 30978163 by russell johnston in ue5-main branch]