diff options
author | Matt A. Tobin <email@mattatobin.com> | 2022-05-29 00:47:25 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2022-05-29 00:47:25 -0500 |
commit | f11b40c3ab4a5a766b0b71ab1e9a6199b23bbfeb (patch) | |
tree | 7b10fdf57c04235448662d0256ef76fa48a1d076 /js/public/GCVariant.h | |
parent | 5310bcfbad6c8687d0bdbe5e49fb73858dcc1631 (diff) | |
download | aura-central-f11b40c3ab4a5a766b0b71ab1e9a6199b23bbfeb.tar.gz |
[JS:Engine] Remove the use of tagged shape pointers
Diffstat (limited to 'js/public/GCVariant.h')
-rw-r--r-- | js/public/GCVariant.h | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/js/public/GCVariant.h b/js/public/GCVariant.h index 43f2957fe..3ec40df5c 100644 --- a/js/public/GCVariant.h +++ b/js/public/GCVariant.h @@ -123,13 +123,13 @@ struct GCPolicy<mozilla::Variant<Ts...>> namespace js { -template <typename Outer, typename... Ts> -class GCVariantOperations +template <typename Wrapper, typename... Ts> +class WrappedPtrOperations<mozilla::Variant<Ts...>, Wrapper> { using Impl = JS::detail::GCVariantImplementation<Ts...>; using Variant = mozilla::Variant<Ts...>; - const Variant& variant() const { return static_cast<const Outer*>(this)->get(); } + const Variant& variant() const { return static_cast<const Wrapper*>(this)->get(); } public: template <typename T> @@ -149,15 +149,15 @@ class GCVariantOperations } }; -template <typename Outer, typename... Ts> -class MutableGCVariantOperations - : public GCVariantOperations<Outer, Ts...> +template <typename Wrapper, typename... Ts> +class MutableWrappedPtrOperations<mozilla::Variant<Ts...>, Wrapper> + : public WrappedPtrOperations<mozilla::Variant<Ts...>, Wrapper> { using Impl = JS::detail::GCVariantImplementation<Ts...>; using Variant = mozilla::Variant<Ts...>; - const Variant& variant() const { return static_cast<const Outer*>(this)->get(); } - Variant& variant() { return static_cast<Outer*>(this)->get(); } + const Variant& variant() const { return static_cast<const Wrapper*>(this)->get(); } + Variant& variant() { return static_cast<Wrapper*>(this)->get(); } public: template <typename T> @@ -172,26 +172,6 @@ class MutableGCVariantOperations } }; -template <typename... Ts> -class RootedBase<mozilla::Variant<Ts...>> - : public MutableGCVariantOperations<JS::Rooted<mozilla::Variant<Ts...>>, Ts...> -{ }; - -template <typename... Ts> -class MutableHandleBase<mozilla::Variant<Ts...>> - : public MutableGCVariantOperations<JS::MutableHandle<mozilla::Variant<Ts...>>, Ts...> -{ }; - -template <typename... Ts> -class HandleBase<mozilla::Variant<Ts...>> - : public GCVariantOperations<JS::Handle<mozilla::Variant<Ts...>>, Ts...> -{ }; - -template <typename... Ts> -class PersistentRootedBase<mozilla::Variant<Ts...>> - : public MutableGCVariantOperations<JS::PersistentRooted<mozilla::Variant<Ts...>>, Ts...> -{ }; - } // namespace js #endif // js_GCVariant_h |