diff --git a/libraries/libmesosphere/include/mesosphere/kern_build_config.hpp b/libraries/libmesosphere/include/mesosphere/kern_build_config.hpp index 6ecd2291b..70dd7508c 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_build_config.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_build_config.hpp @@ -47,13 +47,6 @@ /* re-enabled by toggling this define. */ //#define MESOSPHERE_ENABLE_PROCESS_CREATION_TIME -/* NOTE: This enables fast class token storage using a class member. */ -/* This saves a virtual call when doing KAutoObject->DynCast<>(), */ -/* at the cost of storing class tokens inside the class object. */ -/* However, as of (10/16/2021) KAutoObject has an unused class member */ -/* of the right side, and so this does not actually cost any space. */ -#define MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST - /* NOTE: This enables usage of KDebug handles as parameter for svc::GetInfo */ /* calls which require a process parameter. This enables a debugger to obtain */ /* address space/layout information, for example. However, it changes abi, and so */ diff --git a/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp b/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp index dc99f5ceb..e37c4dd11 100644 --- a/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp +++ b/libraries/libmesosphere/include/mesosphere/kern_k_auto_object.hpp @@ -121,14 +121,9 @@ namespace ams::kern { private: KAutoObject *m_next_closed_object; ReferenceCount m_ref_count; - #if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST) ClassTokenType m_class_token; - #endif public: - constexpr ALWAYS_INLINE explicit KAutoObject(util::ConstantInitializeTag) : m_next_closed_object(nullptr), m_ref_count(0) - #if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST) - , m_class_token(0) - #endif + constexpr ALWAYS_INLINE explicit KAutoObject(util::ConstantInitializeTag) : m_next_closed_object(nullptr), m_ref_count(0), m_class_token(0) { MESOSPHERE_ASSERT_THIS(); } @@ -151,19 +146,11 @@ namespace ams::kern { } ALWAYS_INLINE bool IsDerivedFrom(const TypeObj &rhs) const { - #if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST) - return TypeObj::IsClassTokenDerivedFrom(m_class_token, rhs.GetClassToken()); - #else - return this->GetTypeObj().IsDerivedFrom(rhs); - #endif + return TypeObj::IsClassTokenDerivedFrom(m_class_token, rhs.GetClassToken()); } ALWAYS_INLINE bool IsDerivedFrom(const KAutoObject &rhs) const { - #if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST) - return TypeObj::IsClassTokenDerivedFrom(m_class_token, rhs.m_class_token); - #else - return this->IsDerivedFrom(rhs.GetTypeObj()); - #endif + return TypeObj::IsClassTokenDerivedFrom(m_class_token, rhs.m_class_token); } template @@ -218,12 +205,10 @@ namespace ams::kern { KAutoObject &auto_object = *static_cast(obj); /* If we should, set our class token. */ - #if defined(MESOSPHERE_ENABLE_DEVIRTUALIZED_DYNAMIC_CAST) { constexpr auto Token = Derived::GetStaticTypeObj().GetClassToken(); auto_object.m_class_token = Token; } - #endif /* Initialize reference count to 1. */ auto_object.m_ref_count = 1;