UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
VVMFrame.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#if WITH_VERSE_VM || defined(__INTELLISENSE__)
6
12#include "VerseVM/VVMType.h"
13
14namespace Verse
15{
16struct FOp;
17struct VProcedure;
18
19struct VFrame : VCell
20{
23
24 FOp* CallerPC{nullptr};
27
29 const uint32 NumRegisters;
31
33
34 template <typename ReturnSlotType>
36 {
37 uint32 NumRegisters = Procedure.NumRegisters;
38 return *new (Context.AllocateFastCell(offsetof(VFrame, Registers) + sizeof(VRestValue) * NumRegisters)) VFrame(Context, CallerPC, CallerFrame, ReturnSlot, Procedure);
39 }
40
41 VFrame& CloneWithoutCallerInfo(FAllocationContext Context)
42 {
43 return VFrame::New(Context, *this);
44 }
45
46 static void InitializeGlobals(FAllocationContext Context);
47
48private:
49 static VFrame& New(FAllocationContext Context, VFrame& Other)
50 {
51 return *new (Context.AllocateFastCell(offsetof(VFrame, Registers) + sizeof(VRestValue) * Other.NumRegisters)) VFrame(Context, Other);
52 }
53
54 template <typename ReturnSlotType>
61 , NumRegisters(Procedure.NumRegisters)
62 {
63 for (uint32 RegisterIndex = 0; RegisterIndex < NumRegisters; ++RegisterIndex)
64 {
65 // TODO SOL-4222: Pipe through proper split depth here.
67 }
68 }
69
70 // We don't copy the CallerFrame/CallerPC because during lenient execution
71 // this won't return to the caller.
72 VFrame(FAllocationContext Context, VFrame& Other)
76 , NumRegisters(Other.NumRegisters)
77 {
78 ReturnSlot.EffectToken.Set(Context, Other.ReturnSlot.EffectToken.Get(Context));
79 for (uint32 RegisterIndex = 0; RegisterIndex < NumRegisters; ++RegisterIndex)
80 {
81 // TODO SOL-4222: Pipe through proper split depth here.
84 }
85 }
86};
87
88} // namespace Verse
89
90#endif
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
T * New(FMemStackBase &Mem, int32 Count=1, int32 Align=DEFAULT_ALIGNMENT)
Definition MemStack.h:259
uint32_t uint32
Definition binka_ue_file_header.h:6
FORCEINLINE T * Get(const FObjectPtr &ObjectPtr)
Definition ObjectPtr.h:426
Definition Archive.h:36