Notes:
- For placeholder-typed objects, TObjectPtr<UObject> is considered to be type safe since placeholder types are based on UObject.
- This means we can avoid having to check for and indirectly resolve placeholders via the ptr's internal object handle in these cases.
#jira UE-209831
#rb Francis.Hurteau, Zousar.Shaker
[CL 32434610 by phillip kavan in ue5-main branch]
Change summary:
- Modified ObjectPtr_Private::IsObjectPtrEqualToRawPtrOfRelatedType() to include a non-resolving NULL check for LHS. This allows unsafe type object pointers to equate to NULL object pointers (in addition to nullptr) - e.g. for compiled paths that do implicit type conversions from nullptr to TObjectPtr(nullptr). Also updated the unit test to reflect this behavior change.
- Replaced FPropertyBagRepository::IsPropertyBagPlaceholderType() with IsPropertyBagPlaceholderObject().
- No longer setting RF_HasPlaceholderType on placeholder import type CDOs. This allows UObject initializers to evaluate/dereference the CDO ptr normally as a UObject*, even if created with a placeholder type.
- Replaced direct RF_HasPlaceholderType flag queries with FPropertyBagRepository::IsPropertyBagPlaceholderObject() instead for placeholder export object queries in FLinkerLoad. This remains inclusive of the CDO.
- Now appending RF_HasPlaceholderType onto the ObjectFlags member for export entries created from placeholder type imports. The flag will be cleared if/when the correct instance is patched back into the export table (e.g. at reinstancing time).
- Modified FLinkerLoad::TryCreatePlaceholderTypeForExport() to remove the check for 'bSerializeUnknownProperty'. This does not get set until after we've created the placeholder type when we attempt to Preload() the export that's using it.
- Modified FLinkerLoad::Serialize() to virtualize serialization when loading a property bag for an object with a missing type import that was serialized with an asset version older than EUnrealEngineObjectUE5Version::SCRIPT_SERIALIZATION_OFFSET.
- Modified FLinkerLoad::Preload() to include an asset version check for when serialization of placeholder exports can be safely narrowed to SerializeScriptProperties(). For older asset versions, any non-TPS data serialization is now virtualized instead.
- A warning is now emitted by FLinkerLoad::operator<<() when returning NULL for placeholder export object refs in those cases where we are not able to enforce its type safety at runtime. This now includes reflected properties that might serialize a reference to a placeholder type's CDO, which should be an unlikely edge case that we'll now report on here.
- Re-enabled unit tests for object handle/pointer type safety (ObjectHandleTests.cpp).
- Added a "stress test" method for object pointers to assist with A/B testing and perf analysis (ObjectPtrTests.cpp).
- Modified natvis to extend the TObjectPtr format to display as 'nullptr' for pointers to placeholder export types. Intent is to minimize confusion while debugging since object pointers don't allow access to unsafe type objects directly.
- Added a CVar to control whether or not we will create placeholder exports as serialization targets when import types are missing on map load (SceneGraph.EnablePropertyBagPlaceholderObjectSupport). Also can be enabled at launch via command line (-EnablePropertyBagPlaceholderObjects) for iteration purposes. Currently the CVar/feature defaults to off (experimental/WiP).
#jira UE-197358
#rb Francis.Hurteau
[CL 31447968 by phillip kavan in ue5-main branch]
Further improvements to be had by avoiding CheckCallable overhead of TFunction and making a lockless container to store read callbacks. Those will be investigated in future changelists.
#rb joe.pribele
[FYI] dan.oconnor
[FYI] ben.zeigler
[CL 27728373 by zousar shaker in ue5-main branch]
Disabled by default. gc.AllowIncrementalReachability controls if it's enabled or not.
gc.IncrementalReachabilityTimeLimit controls time limit (defaults to 0.005 = 5ms)
gc.VerifyNoUnrachableObjects (defaults to 0) controls additional GC assumption verification that no unreachable objects are reachable after RA is complete
gc.ContinuousIncrementalGC (defaults to 0) is a new GC stress test that runs incremental GC continuously
TObjectPtr barrier (Obj->MarkAsReachable()) is also currently disabled (compiled out with a macro) until we have all the places (ARO/BPVM) properly running barriers
EngineTest tests can and will run Incremental Reachability Analysis tests even if all the above is disabled
#rb Johan.Torp, Zousar.Shaker
[CL 26252569 by robert manuszewski in ue5-main branch]
Disabled by default. gc.AllowIncrementalReachability controls if it's enabled or not.
gc.IncrementalReachabilityTimeLimit controls time limit (defaults to 0.005 = 5ms)
gc.VerifyUnrachableObjects (defaults to 0) controls additional GC assumption verification that no unreachable objects are reachable after RA is complete
gc.ContinuousIncrementalGC (defaults to 0) is a new GC stress test that runs incremental GC continuously
TObjectPtr barrier (Obj->MarkAsReachable()) is also currently disabled (compiled out with a macro) until we have all the places (ARO/BPVM) properly running barriers
EngineTest tests can and will run Incremental Reachability Analysis tests even if all the above is disabled
#rb Johan.Torp, Zousar.Shaker
[CL 26229728 by robert manuszewski in ue5-main branch]
changed how the Object Handle index stores info to be able to get the class of the outer objects
Packages dont' store a ObjectPathId or ClassDescriptor as it is always known
https://p4-swarm.epicgames.net/reviews/25378953
#rb zousar.shaker
#preflight 64791957e25209b6cbbb45fc
[CL 25747367 by joe pribele in ue5-main branch]
changed the access tracking to a bulk operation api to allow for single calls instead of O(n) calls
#preflight 63fe5fc7ac6c61e2b553e9a9
[CL 24449378 by joe pribele in ue5-main branch]
#fyi joe.pribele
Original CL Desc
-----------------------------------------------------------------
fix for performance problem when converting arrays of TObjectPtr to UObject*
changed the access tracking to a bulk operation api to allow for single calls instead of O(n) calls
#preflight 63fd1de9f43e53f6811a37af
[CL 24436160 by joe pribele in ue5-main branch]
changed the access tracking to a bulk operation api to allow for single calls instead of O(n) calls
#preflight 63fd1de9f43e53f6811a37af
[CL 24432584 by joe pribele in ue5-main branch]
made ObjectPathId to private
trimmed down the public API as much as possible
https://p4-swarm.epicgames.net/reviews/23658342
#rb zousar.shaker
#preflight 63c5c8922a6acaf1625fcf25
[CL 23734208 by joe pribele in ue5-main branch]
GetTypeHash will create a packaged object ref for hashing if the class is defined as lazy load otherwise raw pointer is hashed
a map was added for moved objects and ObjectPathId can be a WeakObjectPtr
the map allows UObjects to be mapped back to packed object refs
#rb zousar.shaker
https://p4-swarm.epicgames.net/reviews/23356491
#preflight 63b5de641c35d1cbdbccecf7
#preflight 63b70406e26e31879b8aa6d3
[CL 23589497 by joe pribele in ue5-main branch]
GetTypeHash will create a packaged object ref for hashing if the class is defined as lazy load otherwise raw pointer is hashed
a map was added for moved objects and ObjectPathId can be a WeakObjectPtr
the map allows UObjects to be mapped back to packed object refs
#preflight 638fad1b5624e6da5e166024
[CL 23416765 by joe pribele in ue5-main branch]
moved test classes outside of namespace as that was causing problems for the compiler
#preflight 6356dcc73a547c3da332a751
[CL 22733737 by joe pribele in ue5-main branch]
resolved pointers where comparing uintptr_t instead of the raw pointers which allow for inheritance
#jira https://jira.it.epicgames.com/browse/UE-168013
#rb zousar.shaker
#preflight 6356c19a9e14ee3c795a2b6f
[CL 22731180 by joe pribele in ue5-main branch]