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/src/ds/TraceableFifo.h | |
parent | 5310bcfbad6c8687d0bdbe5e49fb73858dcc1631 (diff) | |
download | aura-central-f11b40c3ab4a5a766b0b71ab1e9a6199b23bbfeb.tar.gz |
[JS:Engine] Remove the use of tagged shape pointers
Diffstat (limited to 'js/src/ds/TraceableFifo.h')
-rw-r--r-- | js/src/ds/TraceableFifo.h | 54 |
1 files changed, 7 insertions, 47 deletions
diff --git a/js/src/ds/TraceableFifo.h b/js/src/ds/TraceableFifo.h index 04f67da15..0f94b93cb 100644 --- a/js/src/ds/TraceableFifo.h +++ b/js/src/ds/TraceableFifo.h @@ -51,11 +51,11 @@ class TraceableFifo : public js::Fifo<T, MinInlineCapacity, AllocPolicy> } }; -template <typename Outer, typename T, size_t Capacity, typename AllocPolicy> -class TraceableFifoOperations +template <typename Wrapper, typename T, size_t Capacity, typename AllocPolicy> +class WrappedPtrOperations<TraceableFifo<T, Capacity, AllocPolicy>, Wrapper> { using TF = TraceableFifo<T, Capacity, AllocPolicy>; - const TF& fifo() const { return static_cast<const Outer*>(this)->extract(); } + const TF& fifo() const { return static_cast<const Wrapper*>(this)->get(); } public: size_t length() const { return fifo().length(); } @@ -63,12 +63,12 @@ class TraceableFifoOperations const T& front() const { return fifo().front(); } }; -template <typename Outer, typename T, size_t Capacity, typename AllocPolicy> -class MutableTraceableFifoOperations - : public TraceableFifoOperations<Outer, T, Capacity, AllocPolicy> +template <typename Wrapper, typename T, size_t Capacity, typename AllocPolicy> +class MutableWrappedPtrOperations<TraceableFifo<T, Capacity, AllocPolicy>, Wrapper> + : public WrappedPtrOperations<TraceableFifo<T, Capacity, AllocPolicy>, Wrapper> { using TF = TraceableFifo<T, Capacity, AllocPolicy>; - TF& fifo() { return static_cast<Outer*>(this)->extract(); } + TF& fifo() { return static_cast<Wrapper*>(this)->get(); } public: T& front() { return fifo().front(); } @@ -82,46 +82,6 @@ class MutableTraceableFifoOperations void clear() { fifo().clear(); } }; -template <typename A, size_t B, typename C> -class RootedBase<TraceableFifo<A,B,C>> - : public MutableTraceableFifoOperations<JS::Rooted<TraceableFifo<A,B,C>>, A,B,C> -{ - using TF = TraceableFifo<A,B,C>; - - friend class TraceableFifoOperations<JS::Rooted<TF>, A,B,C>; - const TF& extract() const { return *static_cast<const JS::Rooted<TF>*>(this)->address(); } - - friend class MutableTraceableFifoOperations<JS::Rooted<TF>, A,B,C>; - TF& extract() { return *static_cast<JS::Rooted<TF>*>(this)->address(); } -}; - -template <typename A, size_t B, typename C> -class MutableHandleBase<TraceableFifo<A,B,C>> - : public MutableTraceableFifoOperations<JS::MutableHandle<TraceableFifo<A,B,C>>, A,B,C> -{ - using TF = TraceableFifo<A,B,C>; - - friend class TraceableFifoOperations<JS::MutableHandle<TF>, A,B,C>; - const TF& extract() const { - return *static_cast<const JS::MutableHandle<TF>*>(this)->address(); - } - - friend class MutableTraceableFifoOperations<JS::MutableHandle<TF>, A,B,C>; - TF& extract() { return *static_cast<JS::MutableHandle<TF>*>(this)->address(); } -}; - -template <typename A, size_t B, typename C> -class HandleBase<TraceableFifo<A,B,C>> - : public TraceableFifoOperations<JS::Handle<TraceableFifo<A,B,C>>, A,B,C> -{ - using TF = TraceableFifo<A,B,C>; - - friend class TraceableFifoOperations<JS::Handle<TF>, A,B,C>; - const TF& extract() const { - return *static_cast<const JS::Handle<TF>*>(this)->address(); - } -}; - } // namespace js #endif // js_TraceableFifo_h |