5#if WITH_VERSE_VM || defined(__INTELLISENSE__)
33struct FAllocationContext;
55 FContext(
const FContext&
Other)
61 FContext& operator=(
const FContext&) =
default;
70 return GetImpl() ==
Other.GetImpl();
73 explicit operator bool()
const
80 return GetImpl()->GetHeapRole();
85 GetImpl()->EnableManualStackScanning();
90 return GetImpl()->UsesManualStackScanning();
97 return GetImpl()->ManualStackScanRequested();
112 GetImpl()->ClearManualStackScanRequest();
117 return GetImpl()->IsInManuallyEmptyStack();
127 FContextImpl::AttachedDebugger();
131 FContextImpl::DetachedDebugger();
204 template <
typename TFunc>
207 template <
typename TFunc>
214 FIOContext Context(FContextImpl::ClaimOrAllocateContext(EContextHeapRole::Mutator), EIsInHandshake::No);
215 Context.EnableManualStackScanning();
222 GetImpl()->ReleaseContext();
324 Context.GetImpl()->ReleaseContext();
380 GetImpl()->StopAllocators();
385 return GetImpl()->MarkStack;
390 GetImpl()->RunWriteBarrier(
Cell);
395 GetImpl()->RunWriteBarrierNonNull(
Cell);
400 GetImpl()->RunWriteBarrierNonNullDuringMarking(
Cell);
405 GetImpl()->RunWriteBarrierDuringMarking(
Cell);
410 return GetImpl()->RunWeakReadBarrier(
Cell);
415 return GetImpl()->RunWeakReadBarrierUnmarkedWhenActive(
Cell,
416 [
this](
const VCell*
Cell) { GetImpl()->MarkStack.MarkNonNull(
Cell); });
421 GetImpl()->RunAuxWriteBarrier(
Aux);
426 GetImpl()->RunAuxWriteBarrierNonNull(
Aux);
431 GetImpl()->RunAuxWriteBarrierNonNullDuringMarking(
Aux);
436 GetImpl()->RunAuxWriteBarrierDuringMarking(
Aux);
441 return GetImpl()->RunAuxWeakReadBarrier(
Aux);
446 return GetImpl()->RunWeakReadBarrierUnmarkedWhenActive(
Aux,
447 [
this](
const void*
Aux) { GetImpl()->MarkStack.MarkAuxNonNull(
Aux); });
452 return GetImpl()->CurrentTransaction();
457 GetImpl()->SetCurrentTransaction(Transaction);
462 return GetImpl()->CurrentTaskGroup();
467 GetImpl()->SetCurrentTaskGroup(
TaskGroup);
472 return GetImpl()->CurrentTrail();
477 return GetImpl()->SetCurrentTrail(
Trail);
482 return GetImpl()->NativeFrame();
487 template <
typename TFunctor>
498 return GetImpl()->PushNativeFrame(
509 return GetImpl()->GetCurrentPackage();
514 GetImpl()->RecordCell(
Cell);
519 return GetImpl()->PackageForCell(
Cell);
580 template <
typename TFunc>
588 template <
typename TFunc>
592 GetImpl()->ExitConservativeStack([
this, &Func]() {
593 GetImpl()->RelinquishAccess();
595 GetImpl()->AcquireAccess();
604 GetImpl()->RelinquishAccess();
608 template <
typename IfDebuggerOrProfilerCallback>
612 GetImpl()->CheckForHandshake(Callback);
625 template <
typename TFunctor>
628 AutoRTFM::UnreachableIfClosed(
"#jira SOL-8415");
633 template <
typename TFunctor>
636 AutoRTFM::TransactThenOpen([&] {
650 template <
typename TFunctor>
698 FAllocationContext(
const FAllocationContext&
Other)
728 return GetImpl()->AllocateFastCell(NumBytes);
734 return GetImpl()->TryAllocateFastCell(NumBytes);
740 return GetImpl()->AllocateAuxCell(NumBytes);
746 return GetImpl()->TryAllocateAuxCell(NumBytes);
753 return FHeap::EmergentSpace->Allocate(NumBytes);
759 return Subspace->TryAllocate(NumBytes);
761 std::byte* TryAllocate(
FSubspace*
Subspace,
size_t NumBytes,
size_t Alignment)
const
764 return Subspace->TryAllocate(NumBytes, Alignment);
769 return Subspace->Allocate(NumBytes);
771 std::byte* Allocate(
FSubspace*
Subspace,
size_t NumBytes,
size_t Alignment)
const
774 return Subspace->Allocate(NumBytes, Alignment);
806 GetImpl()->MarkConservativeStack();
811 GetImpl()->MarkReferencedCells();
826 GetImpl()->CancelStop();
843template <
typename TFunc>
847 return Func(Scope.Context);
850template <
typename TFunc>
851void FIOContext::AcquireAccess(
const TFunc& Func)
const
853 GetImpl()->AcquireAccess();
854 GetImpl()->EnterConservativeStack([
this, &Func]() {
857 GetImpl()->RelinquishAccess();
860inline FRunningContext FIOContext::AcquireAccessForManualStackScanning()
863 GetImpl()->AcquireAccess();
867template <
typename TFunctor>
868auto FContextImpl::PushNativeFrame(
878 AutoRTFM::UnreachableIfClosed(
"#jira SOL-8415");
#define checkSlow(expr)
Definition AssertionMacros.h:332
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
const bool
Definition NetworkReplayStreaming.h:178
#define ON_SCOPE_EXIT
Definition ScopeExit.h:73
UE_INTRINSIC_CAST UE_REWRITE constexpr std::remove_reference_t< T > && MoveTemp(T &&Obj) noexcept
Definition UnrealTemplate.h:520
Definition AssetRegistryState.h:50
Definition ExpressionParserTypes.h:21
bool operator==(const FCachedAssetKey &A, const FCachedAssetKey &B)
Definition AssetDataMap.h:501
ERuntimeDiagnostic
Definition VVMRuntimeError.h:42
void RaiseVerseRuntimeError(const Verse::ERuntimeDiagnostic Diagnostic, const FText &MessageText)
Definition VVMRuntimeError.cpp:130
Definition UnrealTemplate.h:341