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 /dom | |
parent | 5310bcfbad6c8687d0bdbe5e49fb73858dcc1631 (diff) | |
download | aura-central-f11b40c3ab4a5a766b0b71ab1e9a6199b23bbfeb.tar.gz |
[JS:Engine] Remove the use of tagged shape pointers
Diffstat (limited to 'dom')
-rw-r--r-- | dom/bindings/RootedOwningNonNull.h | 15 | ||||
-rw-r--r-- | dom/bindings/RootedRefPtr.h | 13 | ||||
-rw-r--r-- | dom/plugins/base/nsJSNPRuntime.cpp | 2 | ||||
-rw-r--r-- | dom/xbl/nsXBLMaybeCompiled.h | 12 |
4 files changed, 13 insertions, 29 deletions
diff --git a/dom/bindings/RootedOwningNonNull.h b/dom/bindings/RootedOwningNonNull.h index 13424d155..387a70734 100644 --- a/dom/bindings/RootedOwningNonNull.h +++ b/dom/bindings/RootedOwningNonNull.h @@ -50,21 +50,12 @@ struct GCPolicy<mozilla::OwningNonNull<T>> } // namespace JS namespace js { -template<typename T> -struct RootedBase<mozilla::OwningNonNull<T>> +template<typename T, typename Wrapper> +struct WrappedPtrOperations<mozilla::OwningNonNull<T>, Wrapper> { - typedef mozilla::OwningNonNull<T> SmartPtrType; - - operator SmartPtrType& () const - { - auto& self = *static_cast<const JS::Rooted<SmartPtrType>*>(this); - return self.get(); - } - operator T& () const { - auto& self = *static_cast<const JS::Rooted<SmartPtrType>*>(this); - return self.get(); + return static_cast<const Wrapper*>(this)->get(); } }; } // namespace js diff --git a/dom/bindings/RootedRefPtr.h b/dom/bindings/RootedRefPtr.h index 34f2da5c9..2563d4649 100644 --- a/dom/bindings/RootedRefPtr.h +++ b/dom/bindings/RootedRefPtr.h @@ -38,19 +38,12 @@ struct GCPolicy<RefPtr<T>> } // namespace JS namespace js { -template<typename T> -struct RootedBase<RefPtr<T>> +template<typename T, typename Wrapper> +struct WrappedPtrOperations<RefPtr<T>, Wrapper> { - operator RefPtr<T>& () const - { - auto& self = *static_cast<const JS::Rooted<RefPtr<T>>*>(this); - return self.get(); - } - operator T*() const { - auto& self = *static_cast<const JS::Rooted<RefPtr<T>>*>(this); - return self.get(); + return static_cast<const Wrapper*>(this)->get(); } }; } // namespace js diff --git a/dom/plugins/base/nsJSNPRuntime.cpp b/dom/plugins/base/nsJSNPRuntime.cpp index 1d42c18d6..7a118cae3 100644 --- a/dom/plugins/base/nsJSNPRuntime.cpp +++ b/dom/plugins/base/nsJSNPRuntime.cpp @@ -1747,7 +1747,7 @@ NPObjWrapper_ObjectMoved(JSObject *obj, const JSObject *old) auto entry = static_cast<NPObjWrapperHashEntry*>(sNPObjWrappers->Search(npobj)); MOZ_ASSERT(entry && entry->mJSObj); - MOZ_ASSERT(entry->mJSObj.unbarrieredGetPtr() == old); + MOZ_ASSERT(entry->mJSObj == old); entry->mJSObj = obj; } diff --git a/dom/xbl/nsXBLMaybeCompiled.h b/dom/xbl/nsXBLMaybeCompiled.h index 4bd7f8396..d9d16fdfb 100644 --- a/dom/xbl/nsXBLMaybeCompiled.h +++ b/dom/xbl/nsXBLMaybeCompiled.h @@ -126,15 +126,15 @@ struct IsHeapConstructibleType<nsXBLMaybeCompiled<T>> static const bool value = true; }; -template <class UncompiledT> -class HeapBase<nsXBLMaybeCompiled<UncompiledT>> +template <class UncompiledT, class Wrapper> +class HeapBase<nsXBLMaybeCompiled<UncompiledT>, Wrapper> { - const JS::Heap<nsXBLMaybeCompiled<UncompiledT>>& wrapper() const { - return *static_cast<const JS::Heap<nsXBLMaybeCompiled<UncompiledT>>*>(this); + const Wrapper& wrapper() const { + return *static_cast<const Wrapper*>(this); } - JS::Heap<nsXBLMaybeCompiled<UncompiledT>>& wrapper() { - return *static_cast<JS::Heap<nsXBLMaybeCompiled<UncompiledT>>*>(this); + Wrapper& wrapper() { + return *static_cast<Wrapper*>(this); } const nsXBLMaybeCompiled<UncompiledT>* extract() const { |