Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/Move.h
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
 * License, v. 2.0. If a copy of the MPL was not distributed with this
5
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
/* C++11-style, but C++98-usable, "move references" implementation. */
8
9
#ifndef mozilla_Move_h
10
#define mozilla_Move_h
11
12
#include "mozilla/TypeTraits.h"
13
14
#include <utility>
15
16
namespace mozilla {
17
18
/*
19
 * "Move" References
20
 *
21
 * Some types can be copied much more efficiently if we know the original's
22
 * value need not be preserved --- that is, if we are doing a "move", not a
23
 * "copy". For example, if we have:
24
 *
25
 *   Vector<T> u;
26
 *   Vector<T> v(u);
27
 *
28
 * the constructor for v must apply a copy constructor to each element of u ---
29
 * taking time linear in the length of u. However, if we know we will not need u
30
 * any more once v has been initialized, then we could initialize v very
31
 * efficiently simply by stealing u's dynamically allocated buffer and giving it
32
 * to v --- a constant-time operation, regardless of the size of u.
33
 *
34
 * Moves often appear in container implementations. For example, when we append
35
 * to a vector, we may need to resize its buffer. This entails moving each of
36
 * its extant elements from the old, smaller buffer to the new, larger buffer.
37
 * But once the elements have been migrated, we're just going to throw away the
38
 * old buffer; we don't care if they still have their values. So if the vector's
39
 * element type can implement "move" more efficiently than "copy", the vector
40
 * resizing should by all means use a "move" operation. Hash tables should also
41
 * use moves when resizing their internal array as entries are added and
42
 * removed.
43
 *
44
 * The details of the optimization, and whether it's worth applying, vary
45
 * from one type to the next: copying an 'int' is as cheap as moving it, so
46
 * there's no benefit in distinguishing 'int' moves from copies. And while
47
 * some constructor calls for complex types are moves, many really have to
48
 * be copies, and can't be optimized this way. So we need:
49
 *
50
 * 1) a way for a type (like Vector) to announce that it can be moved more
51
 *    efficiently than it can be copied, and provide an implementation of that
52
 *    move operation; and
53
 *
54
 * 2) a way for a particular invocation of a copy constructor to say that it's
55
 *    really a move, not a copy, and that the value of the original isn't
56
 *    important afterwards (although it must still be safe to destroy).
57
 *
58
 * If a constructor has a single argument of type 'T&&' (an 'rvalue reference
59
 * to T'), that indicates that it is a 'move constructor'. That's 1). It should
60
 * move, not copy, its argument into the object being constructed. It may leave
61
 * the original in any safely-destructible state.
62
 *
63
 * If a constructor's argument is an rvalue, as in 'C(f(x))' or 'C(x + y)', as
64
 * opposed to an lvalue, as in 'C(x)', then overload resolution will prefer the
65
 * move constructor, if there is one. The 'std::move' function, defined in
66
 * <utility>, is an identity function you can use in a constructor invocation to
67
 * make any argument into an rvalue, like this: C(std::move(x)). That's 2). (You
68
 * could use any function that works, but 'Move' indicates your intention
69
 * clearly.)
70
 *
71
 * Where we might define a copy constructor for a class C like this:
72
 *
73
 *   C(const C& rhs) { ... copy rhs to this ... }
74
 *
75
 * we would declare a move constructor like this:
76
 *
77
 *   C(C&& rhs) { .. move rhs to this ... }
78
 *
79
 * And where we might perform a copy like this:
80
 *
81
 *   C c2(c1);
82
 *
83
 * we would perform a move like this:
84
 *
85
 *   C c2(std::move(c1));
86
 *
87
 * Note that 'T&&' implicitly converts to 'T&'. So you can pass a 'T&&' to an
88
 * ordinary copy constructor for a type that doesn't support a special move
89
 * constructor, and you'll just get a copy. This means that templates can use
90
 * Move whenever they know they won't use the original value any more, even if
91
 * they're not sure whether the type at hand has a specialized move constructor.
92
 * If it doesn't, the 'T&&' will just convert to a 'T&', and the ordinary copy
93
 * constructor will apply.
94
 *
95
 * A class with a move constructor can also provide a move assignment operator.
96
 * A generic definition would run this's destructor, and then apply the move
97
 * constructor to *this's memory. A typical definition:
98
 *
99
 *   C& operator=(C&& rhs) {
100
 *     MOZ_ASSERT(&rhs != this, "self-moves are prohibited");
101
 *     this->~C();
102
 *     new(this) C(std::move(rhs));
103
 *     return *this;
104
 *   }
105
 *
106
 * With that in place, one can write move assignments like this:
107
 *
108
 *   c2 = std::move(c1);
109
 *
110
 * This destroys c2, moves c1's value to c2, and leaves c1 in an undefined but
111
 * destructible state.
112
 *
113
 * As we say, a move must leave the original in a "destructible" state. The
114
 * original's destructor will still be called, so if a move doesn't
115
 * actually steal all its resources, that's fine. We require only that the
116
 * move destination must take on the original's value; and that destructing
117
 * the original must not break the move destination.
118
 *
119
 * (Opinions differ on whether move assignment operators should deal with move
120
 * assignment of an object onto itself. It seems wise to either handle that
121
 * case, or assert that it does not occur.)
122
 *
123
 * Forwarding:
124
 *
125
 * Sometimes we want copy construction or assignment if we're passed an ordinary
126
 * value, but move construction if passed an rvalue reference. For example, if
127
 * our constructor takes two arguments and either could usefully be a move, it
128
 * seems silly to write out all four combinations:
129
 *
130
 *   C::C(X&  x, Y&  y) : x(x),       y(y)       { }
131
 *   C::C(X&  x, Y&& y) : x(x),       y(std::move(y)) { }
132
 *   C::C(X&& x, Y&  y) : x(std::move(x)), y(y)       { }
133
 *   C::C(X&& x, Y&& y) : x(std::move(x)), y(std::move(y)) { }
134
 *
135
 * To avoid this, C++11 has tweaks to make it possible to write what you mean.
136
 * The four constructor overloads above can be written as one constructor
137
 * template like so[0]:
138
 *
139
 *   template <typename XArg, typename YArg>
140
 *   C::C(XArg&& x, YArg&& y) : x(std::forward<XArg>(x)), y(std::forward<YArg>(y)) { }
141
 *
142
 * ("'Don't Repeat Yourself'? What's that?")
143
 *
144
 * This takes advantage of two new rules in C++11:
145
 *
146
 * - First, when a function template takes an argument that is an rvalue
147
 *   reference to a template argument (like 'XArg&& x' and 'YArg&& y' above),
148
 *   then when the argument is applied to an lvalue, the template argument
149
 *   resolves to 'T&'; and when it is applied to an rvalue, the template
150
 *   argument resolves to 'T'. Thus, in a call to C::C like:
151
 *
152
 *      X foo(int);
153
 *      Y yy;
154
 *
155
 *      C(foo(5), yy)
156
 *
157
 *   XArg would resolve to 'X', and YArg would resolve to 'Y&'.
158
 *
159
 * - Second, Whereas C++ used to forbid references to references, C++11 defines
160
 *   'collapsing rules': 'T& &', 'T&& &', and 'T& &&' (that is, any combination
161
 *   involving an lvalue reference) now collapse to simply 'T&'; and 'T&& &&'
162
 *   collapses to 'T&&'.
163
 *
164
 *   Thus, in the call above, 'XArg&&' is 'X&&'; and 'YArg&&' is 'Y& &&', which
165
 *   collapses to 'Y&'. Because the arguments are declared as rvalue references
166
 *   to template arguments, the lvalue-ness "shines through" where present.
167
 *
168
 * Then, the 'std::forward<T>' function --- you must invoke 'Forward' with its type
169
 * argument --- returns an lvalue reference or an rvalue reference to its
170
 * argument, depending on what T is. In our unified constructor definition, that
171
 * means that we'll invoke either the copy or move constructors for x and y,
172
 * depending on what we gave C's constructor. In our call, we'll move 'foo()'
173
 * into 'x', but copy 'yy' into 'y'.
174
 *
175
 * This header file defines Move and Forward in the mozilla namespace. It's up
176
 * to individual containers to annotate moves as such, by calling Move; and it's
177
 * up to individual types to define move constructors and assignment operators
178
 * when valuable.
179
 *
180
 * (C++11 says that the <utility> header file should define 'std::move' and
181
 * 'std::forward', which are just like our 'Move' and 'Forward'; but those
182
 * definitions aren't available in that header on all our platforms, so we
183
 * define them ourselves here.)
184
 *
185
 * 0. This pattern is known as "perfect forwarding".  Interestingly, it is not
186
 *    actually perfect, and it can't forward all possible argument expressions!
187
 *    There is a C++11 issue: you can't form a reference to a bit-field.  As a
188
 *    workaround, assign the bit-field to a local variable and use that:
189
 *
190
 *      // C is as above
191
 *      struct S { int x : 1; } s;
192
 *      C(s.x, 0); // BAD: s.x is a reference to a bit-field, can't form those
193
 *      int tmp = s.x;
194
 *      C(tmp, 0); // OK: tmp not a bit-field
195
 */
196
197
/** Swap |aX| and |aY| using move-construction if possible. */
198
template<typename T>
199
inline void
200
Swap(T& aX, T& aY)
201
18
{
202
18
  T tmp(std::move(aX));
203
18
  aX = std::move(aY);
204
18
  aY = std::move(tmp);
205
18
}
Unexecuted instantiation: void mozilla::Swap<PLDHashTable>(PLDHashTable&, PLDHashTable&)
Unexecuted instantiation: void mozilla::Swap<Pref*>(Pref*&, Pref*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::DefaultDelete<Pref> >(mozilla::DefaultDelete<Pref>&, mozilla::DefaultDelete<Pref>&)
Unexecuted instantiation: void mozilla::Swap<unsigned int>(unsigned int&, unsigned int&)
Unexecuted instantiation: void mozilla::Swap<FallibleTArray<unsigned char>*>(FallibleTArray<unsigned char>*&, FallibleTArray<unsigned char>*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::DefaultDelete<FallibleTArray<unsigned char> > >(mozilla::DefaultDelete<FallibleTArray<unsigned char> >&, mozilla::DefaultDelete<FallibleTArray<unsigned char> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<mozilla::jsipc::ObjectId, JS::Heap<JSObject*> > >(mozilla::HashMapEntry<mozilla::jsipc::ObjectId, JS::Heap<JSObject*> >&, mozilla::HashMapEntry<mozilla::jsipc::ObjectId, JS::Heap<JSObject*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JS::Heap<JSObject*>, mozilla::jsipc::ObjectId> >(mozilla::HashMapEntry<JS::Heap<JSObject*>, mozilla::jsipc::ObjectId>&, mozilla::HashMapEntry<JS::Heap<JSObject*>, mozilla::jsipc::ObjectId>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JS::Heap<JSObject*>, JS::Heap<JSObject*> > >(mozilla::HashMapEntry<JS::Heap<JSObject*>, JS::Heap<JSObject*> >&, mozilla::HashMapEntry<JS::Heap<JSObject*>, JS::Heap<JSObject*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<RefPtr<mozilla::BasePrincipal>, JS::Heap<JSObject*> > >(mozilla::HashMapEntry<RefPtr<mozilla::BasePrincipal>, JS::Heap<JSObject*> >&, mozilla::HashMapEntry<RefPtr<mozilla::BasePrincipal>, JS::Heap<JSObject*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JS::Heap<JSObject*>, nsXPCWrappedJS*> >(mozilla::HashMapEntry<JS::Heap<JSObject*>, nsXPCWrappedJS*>&, mozilla::HashMapEntry<JS::Heap<JSObject*>, nsXPCWrappedJS*>&)
Unexecuted instantiation: void mozilla::Swap<unsigned char>(unsigned char&, unsigned char&)
Unexecuted instantiation: void mozilla::Swap<int>(int&, int&)
Unexecuted instantiation: void mozilla::Swap<unsigned char*>(unsigned char*&, unsigned char*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::DefaultDelete<unsigned char []> >(mozilla::DefaultDelete<unsigned char []>&, mozilla::DefaultDelete<unsigned char []>&)
Unexecuted instantiation: void mozilla::Swap<MiscContainer*>(MiscContainer*&, MiscContainer*&)
Unexecuted instantiation: void mozilla::Swap<nsTArray<RefPtr<mozilla::gmp::GMPParent> > >(nsTArray<RefPtr<mozilla::gmp::GMPParent> >&, nsTArray<RefPtr<mozilla::gmp::GMPParent> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::dom::NotificationRef*>(mozilla::dom::NotificationRef*&, mozilla::dom::NotificationRef*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::DefaultDelete<mozilla::dom::NotificationRef> >(mozilla::DefaultDelete<mozilla::dom::NotificationRef>&, mozilla::DefaultDelete<mozilla::dom::NotificationRef>&)
Unexecuted instantiation: void mozilla::Swap<nsSMILValue>(nsSMILValue&, nsSMILValue&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<nsJSObjWrapperKey, nsJSObjWrapper*> >(mozilla::HashMapEntry<nsJSObjWrapperKey, nsJSObjWrapper*>&, mozilla::HashMapEntry<nsJSObjWrapperKey, nsJSObjWrapper*>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::detail::FreePolicy<unsigned char> >(mozilla::detail::FreePolicy<unsigned char>&, mozilla::detail::FreePolicy<unsigned char>&)
Unexecuted instantiation: void mozilla::Swap<nsWebBrowserPersist::WalkData*>(nsWebBrowserPersist::WalkData*&, nsWebBrowserPersist::WalkData*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::DefaultDelete<nsWebBrowserPersist::WalkData> >(mozilla::DefaultDelete<nsWebBrowserPersist::WalkData>&, mozilla::DefaultDelete<nsWebBrowserPersist::WalkData>&)
Unexecuted instantiation: void mozilla::Swap<nsRect>(nsRect&, nsRect&)
Unexecuted instantiation: void mozilla::Swap<nsIFrame::InlineIntrinsicISizeData::FloatInfo>(nsIFrame::InlineIntrinsicISizeData::FloatInfo&, nsIFrame::InlineIntrinsicISizeData::FloatInfo&)
Unexecuted instantiation: void mozilla::Swap<bool>(bool&, bool&)
Unexecuted instantiation: void mozilla::Swap<double>(double&, double&)
Unexecuted instantiation: void mozilla::Swap<mozilla::Side>(mozilla::Side&, mozilla::Side&)
Unexecuted instantiation: void mozilla::Swap<nsSplitterInfo*>(nsSplitterInfo*&, nsSplitterInfo*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::DefaultDelete<nsSplitterInfo []> >(mozilla::DefaultDelete<nsSplitterInfo []>&, mozilla::DefaultDelete<nsSplitterInfo []>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::gfx::PointTyped<mozilla::gfx::UnknownUnits, float> >(mozilla::gfx::PointTyped<mozilla::gfx::UnknownUnits, float>&, mozilla::gfx::PointTyped<mozilla::gfx::UnknownUnits, float>&)
Unexecuted instantiation: void mozilla::Swap<float>(float&, float&)
Unexecuted instantiation: void mozilla::Swap<mozilla::dom::StyleChildrenIterator>(mozilla::dom::StyleChildrenIterator&, mozilla::dom::StyleChildrenIterator&)
Unexecuted instantiation: void mozilla::Swap<RefPtr<mozilla::safebrowsing::LookupCache> >(RefPtr<mozilla::safebrowsing::LookupCache>&, RefPtr<mozilla::safebrowsing::LookupCache>&)
Unexecuted instantiation: void mozilla::Swap<nsIThread*>(nsIThread*&, nsIThread*&)
Unexecuted instantiation: void mozilla::Swap<JS::ubi::Node*>(JS::ubi::Node*&, JS::ubi::Node*&)
Unexecuted instantiation: void mozilla::Swap<unsigned long>(unsigned long&, unsigned long&)
Unexecuted instantiation: void mozilla::Swap<JS::ubi::BackEdge*>(JS::ubi::BackEdge*&, JS::ubi::BackEdge*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::JsepSessionImpl*>(mozilla::JsepSessionImpl*&, mozilla::JsepSessionImpl*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::DefaultDelete<mozilla::JsepSessionImpl> >(mozilla::DefaultDelete<mozilla::JsepSessionImpl>&, mozilla::DefaultDelete<mozilla::JsepSessionImpl>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::JsepSessionTest::CandidateSet*>(mozilla::JsepSessionTest::CandidateSet*&, mozilla::JsepSessionTest::CandidateSet*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::DefaultDelete<mozilla::JsepSessionTest::CandidateSet> >(mozilla::DefaultDelete<mozilla::JsepSessionTest::CandidateSet>&, mozilla::DefaultDelete<mozilla::JsepSessionTest::CandidateSet>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::JsepSessionTest::TransportData*>(mozilla::JsepSessionTest::TransportData*&, mozilla::JsepSessionTest::TransportData*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::DefaultDelete<mozilla::JsepSessionTest::TransportData> >(mozilla::DefaultDelete<mozilla::JsepSessionTest::TransportData>&, mozilla::DefaultDelete<mozilla::JsepSessionTest::TransportData>&)
Unexecuted instantiation: void mozilla::Swap<std::__1::vector<mozilla::JsepCodecDescription*, std::__1::allocator<mozilla::JsepCodecDescription*> > >(std::__1::vector<mozilla::JsepCodecDescription*, std::__1::allocator<mozilla::JsepCodecDescription*> >&, std::__1::vector<mozilla::JsepCodecDescription*, std::__1::allocator<mozilla::JsepCodecDescription*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::HeapPtr<JSFlatString*>, js::ctypes::FieldInfo> >(mozilla::HashMapEntry<js::HeapPtr<JSFlatString*>, js::ctypes::FieldInfo>&, mozilla::HashMapEntry<js::HeapPtr<JSFlatString*>, js::ctypes::FieldInfo>&)
Unexecuted instantiation: void mozilla::Swap<js::SharedImmutableStringsCache::StringBox*>(js::SharedImmutableStringsCache::StringBox*&, js::SharedImmutableStringsCache::StringBox*&)
Unexecuted instantiation: void mozilla::Swap<JS::DeletePolicy<js::SharedImmutableStringsCache::StringBox> >(JS::DeletePolicy<js::SharedImmutableStringsCache::StringBox>&, JS::DeletePolicy<js::SharedImmutableStringsCache::StringBox>&)
Unexecuted instantiation: void mozilla::Swap<js::EvalCacheEntry>(js::EvalCacheEntry&, js::EvalCacheEntry&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::CrossCompartmentKey, js::detail::UnsafeBareReadBarriered<JS::Value> > >(mozilla::HashMapEntry<js::CrossCompartmentKey, js::detail::UnsafeBareReadBarriered<JS::Value> >&, mozilla::HashMapEntry<js::CrossCompartmentKey, js::detail::UnsafeBareReadBarriered<JS::Value> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JS::Compartment*, js::NurseryAwareHashMap<js::CrossCompartmentKey, JS::Value, js::CrossCompartmentKey::Hasher, js::SystemAllocPolicy> > >(mozilla::HashMapEntry<JS::Compartment*, js::NurseryAwareHashMap<js::CrossCompartmentKey, JS::Value, js::CrossCompartmentKey::Hasher, js::SystemAllocPolicy> >&, mozilla::HashMapEntry<JS::Compartment*, js::NurseryAwareHashMap<js::CrossCompartmentKey, JS::Value, js::CrossCompartmentKey::Hasher, js::SystemAllocPolicy> >&)
Unexecuted instantiation: void mozilla::Swap<js::ReadBarriered<js::RegExpShared*> >(js::ReadBarriered<js::RegExpShared*>&, js::ReadBarriered<js::RegExpShared*>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JSObject*, unsigned int> >(mozilla::HashMapEntry<JSObject*, unsigned int>&, mozilla::HashMapEntry<JSObject*, unsigned int>&)
Unexecuted instantiation: void mozilla::Swap<JSObject*>(JSObject*&, JSObject*&)
Unexecuted instantiation: void mozilla::Swap<jsid>(jsid&, jsid&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<jsid, js::IndirectBindingMap::Binding> >(mozilla::HashMapEntry<jsid, js::IndirectBindingMap::Binding>&, mozilla::HashMapEntry<jsid, js::IndirectBindingMap::Binding>&)
Unexecuted instantiation: void mozilla::Swap<JSAtom*>(JSAtom*&, JSAtom*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JSAtom*, js::ImportEntryObject*> >(mozilla::HashMapEntry<JSAtom*, js::ImportEntryObject*>&, mozilla::HashMapEntry<JSAtom*, js::ImportEntryObject*>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::Vector<JS::Dispatchable*, 0ul, js::SystemAllocPolicy> >(mozilla::Vector<JS::Dispatchable*, 0ul, js::SystemAllocPolicy>&, mozilla::Vector<JS::Dispatchable*, 0ul, js::SystemAllocPolicy>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::HeapPtr<JSObject*>, js::HeapPtr<JS::Value> > >(mozilla::HashMapEntry<js::HeapPtr<JSObject*>, js::HeapPtr<JS::Value> >&, mozilla::HashMapEntry<js::HeapPtr<JSObject*>, js::HeapPtr<JS::Value> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::HeapPtr<JSObject*>, js::HeapPtr<JSObject*> > >(mozilla::HashMapEntry<js::HeapPtr<JSObject*>, js::HeapPtr<JSObject*> >&, mozilla::HashMapEntry<js::HeapPtr<JSObject*>, js::HeapPtr<JSObject*> >&)
Unexecuted instantiation: void mozilla::Swap<js::InitialShapeEntry>(js::InitialShapeEntry&, js::InitialShapeEntry&)
Unexecuted instantiation: void mozilla::Swap<js::ReadBarriered<js::UnownedBaseShape*> >(js::ReadBarriered<js::UnownedBaseShape*>&, js::ReadBarriered<js::UnownedBaseShape*>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::gc::Cell*, unsigned long> >(mozilla::HashMapEntry<js::gc::Cell*, unsigned long>&, mozilla::HashMapEntry<js::gc::Cell*, unsigned long>&)
Unexecuted instantiation: void mozilla::Swap<js::jit::MDefinition*>(js::jit::MDefinition*&, js::jit::MDefinition*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<unsigned int, js::ReadBarriered<js::jit::JitCode*> > >(mozilla::HashMapEntry<unsigned int, js::ReadBarriered<js::jit::JitCode*> >&, mozilla::HashMapEntry<unsigned int, js::ReadBarriered<js::jit::JitCode*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::jit::CacheIRStubKey, js::ReadBarriered<js::jit::JitCode*> > >(mozilla::HashMapEntry<js::jit::CacheIRStubKey, js::ReadBarriered<js::jit::JitCode*> >&, mozilla::HashMapEntry<js::jit::CacheIRStubKey, js::ReadBarriered<js::jit::JitCode*> >&)
Unexecuted instantiation: void mozilla::Swap<js::jit::MBasicBlock*>(js::jit::MBasicBlock*&, js::jit::MBasicBlock*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JSObject*, mozilla::Vector<js::ArrayBufferViewObject*, 1ul, js::SystemAllocPolicy> > >(mozilla::HashMapEntry<JSObject*, mozilla::Vector<js::ArrayBufferViewObject*, 1ul, js::SystemAllocPolicy> >&, mozilla::HashMapEntry<JSObject*, mozilla::Vector<js::ArrayBufferViewObject*, 1ul, js::SystemAllocPolicy> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::HeapPtr<js::WasmInstanceObject*>, js::HeapPtr<JSObject*> > >(mozilla::HashMapEntry<js::HeapPtr<js::WasmInstanceObject*>, js::HeapPtr<JSObject*> >&, mozilla::HashMapEntry<js::HeapPtr<js::WasmInstanceObject*>, js::HeapPtr<JSObject*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::HeapPtr<js::LazyScript*>, js::HeapPtr<JSObject*> > >(mozilla::HashMapEntry<js::HeapPtr<js::LazyScript*>, js::HeapPtr<JSObject*> >&, mozilla::HashMapEntry<js::HeapPtr<js::LazyScript*>, js::HeapPtr<JSObject*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::HeapPtr<JSScript*>, js::HeapPtr<JSObject*> > >(mozilla::HashMapEntry<js::HeapPtr<JSScript*>, js::HeapPtr<JSObject*> >&, mozilla::HashMapEntry<js::HeapPtr<JSScript*>, js::HeapPtr<JSObject*> >&)
Unexecuted instantiation: void mozilla::Swap<js::ReadBarriered<js::GlobalObject*> >(js::ReadBarriered<js::GlobalObject*>&, js::ReadBarriered<js::GlobalObject*>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::AbstractFramePtr, js::HeapPtr<js::DebuggerFrame*> > >(mozilla::HashMapEntry<js::AbstractFramePtr, js::HeapPtr<js::DebuggerFrame*> >&, mozilla::HashMapEntry<js::AbstractFramePtr, js::HeapPtr<js::DebuggerFrame*> >&)
Unexecuted instantiation: void mozilla::Swap<js::Debugger::AllocationsLogEntry*>(js::Debugger::AllocationsLogEntry*&, js::Debugger::AllocationsLogEntry*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::MissingEnvironmentKey, js::ReadBarriered<js::DebugEnvironmentProxy*> > >(mozilla::HashMapEntry<js::MissingEnvironmentKey, js::ReadBarriered<js::DebugEnvironmentProxy*> >&, mozilla::HashMapEntry<js::MissingEnvironmentKey, js::ReadBarriered<js::DebugEnvironmentProxy*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::ReadBarriered<JSObject*>, js::LiveEnvironmentVal> >(mozilla::HashMapEntry<js::ReadBarriered<JSObject*>, js::LiveEnvironmentVal>&, mozilla::HashMapEntry<js::ReadBarriered<JSObject*>, js::LiveEnvironmentVal>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JSScript*, mozilla::UniquePtr<char [], JS::FreePolicy> > >(mozilla::HashMapEntry<JSScript*, mozilla::UniquePtr<char [], JS::FreePolicy> >&, mozilla::HashMapEntry<JSScript*, mozilla::UniquePtr<char [], JS::FreePolicy> >&)
Unexecuted instantiation: void mozilla::Swap<js::AtomStateEntry>(js::AtomStateEntry&, js::AtomStateEntry&)
Unexecuted instantiation: void mozilla::Swap<js::wasm::CompileTask**>(js::wasm::CompileTask**&, js::wasm::CompileTask**&)
Unexecuted instantiation: void mozilla::Swap<js::SharedScriptData*>(js::SharedScriptData*&, js::SharedScriptData*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::ObjectGroupRealm::PlainObjectKey, js::ObjectGroupRealm::PlainObjectEntry> >(mozilla::HashMapEntry<js::ObjectGroupRealm::PlainObjectKey, js::ObjectGroupRealm::PlainObjectEntry>&, mozilla::HashMapEntry<js::ObjectGroupRealm::PlainObjectKey, js::ObjectGroupRealm::PlainObjectEntry>&)
Unexecuted instantiation: void mozilla::Swap<js::ObjectGroupRealm::NewEntry>(js::ObjectGroupRealm::NewEntry&, js::ObjectGroupRealm::NewEntry&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::ObjectGroupRealm::AllocationSiteKey, js::ReadBarriered<js::ObjectGroup*> > >(mozilla::HashMapEntry<js::ObjectGroupRealm::AllocationSiteKey, js::ReadBarriered<js::ObjectGroup*> >&, mozilla::HashMapEntry<js::ObjectGroupRealm::AllocationSiteKey, js::ReadBarriered<js::ObjectGroup*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::ObjectGroupRealm::ArrayObjectKey, js::ReadBarriered<js::ObjectGroup*> > >(mozilla::HashMapEntry<js::ObjectGroupRealm::ArrayObjectKey, js::ReadBarriered<js::ObjectGroup*> >&, mozilla::HashMapEntry<js::ObjectGroupRealm::ArrayObjectKey, js::ReadBarriered<js::ObjectGroup*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JSScript*, mozilla::UniquePtr<js::ScriptCounts, JS::DeletePolicy<js::ScriptCounts> > > >(mozilla::HashMapEntry<JSScript*, mozilla::UniquePtr<js::ScriptCounts, JS::DeletePolicy<js::ScriptCounts> > >&, mozilla::HashMapEntry<JSScript*, mozilla::UniquePtr<js::ScriptCounts, JS::DeletePolicy<js::ScriptCounts> > >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JSScript*, mozilla::UniquePtr<js::DebugScript, JS::FreePolicy> > >(mozilla::HashMapEntry<JSScript*, mozilla::UniquePtr<js::DebugScript, JS::FreePolicy> >&, mozilla::HashMapEntry<JSScript*, mozilla::UniquePtr<js::DebugScript, JS::FreePolicy> >&)
Unexecuted instantiation: void mozilla::Swap<js::Shape*>(js::Shape*&, js::Shape*&)
Unexecuted instantiation: void mozilla::Swap<js::ReadBarriered<js::SavedFrame*> >(js::ReadBarriered<js::SavedFrame*>&, js::ReadBarriered<js::SavedFrame*>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<js::SavedStacks::PCKey, js::SavedStacks::LocationValue> >(mozilla::HashMapEntry<js::SavedStacks::PCKey, js::SavedStacks::LocationValue>&, mozilla::HashMapEntry<js::SavedStacks::PCKey, js::SavedStacks::LocationValue>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<unsigned long, mozilla::Array<unsigned long, 512ul>*> >(mozilla::HashMapEntry<unsigned long, mozilla::Array<unsigned long, 512ul>*>&, mozilla::HashMapEntry<unsigned long, mozilla::Array<unsigned long, 512ul>*>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<JSAtom*, JSAtom*> >(mozilla::HashMapEntry<JSAtom*, JSAtom*>&, mozilla::HashMapEntry<JSAtom*, JSAtom*>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<unsigned char*, JS::GCVector<js::jit::RematerializedFrame*, 0ul, js::TempAllocPolicy> > >(mozilla::HashMapEntry<unsigned char*, JS::GCVector<js::jit::RematerializedFrame*, 0ul, js::TempAllocPolicy> >&, mozilla::HashMapEntry<unsigned char*, JS::GCVector<js::jit::RematerializedFrame*, 0ul, js::TempAllocPolicy> >&)
Unexecuted instantiation: void mozilla::Swap<js::wasm::CallSite*>(js::wasm::CallSite*&, js::wasm::CallSite*&)
Unexecuted instantiation: void mozilla::Swap<js::wasm::CallSiteTarget*>(js::wasm::CallSiteTarget*&, js::wasm::CallSiteTarget*&)
Unexecuted instantiation: void mozilla::Swap<js::wasm::CallFarJump*>(js::wasm::CallFarJump*&, js::wasm::CallFarJump*&)
Unexecuted instantiation: void mozilla::Swap<js::wasm::SymbolicAccess*>(js::wasm::SymbolicAccess*&, js::wasm::SymbolicAccess*&)
Unexecuted instantiation: void mozilla::Swap<js::jit::CodeLabel*>(js::jit::CodeLabel*&, js::jit::CodeLabel*&)
Unexecuted instantiation: void mozilla::Swap<js::ReadBarriered<js::WasmInstanceObject*> >(js::ReadBarriered<js::WasmInstanceObject*>&, js::ReadBarriered<js::WasmInstanceObject*>&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<unsigned int, js::HeapPtr<JSFunction*> > >(mozilla::HashMapEntry<unsigned int, js::HeapPtr<JSFunction*> >&, mozilla::HashMapEntry<unsigned int, js::HeapPtr<JSFunction*> >&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashMapEntry<unsigned int, js::ReadBarriered<js::WasmFunctionScope*> > >(mozilla::HashMapEntry<unsigned int, js::ReadBarriered<js::WasmFunctionScope*> >&, mozilla::HashMapEntry<unsigned int, js::ReadBarriered<js::WasmFunctionScope*> >&)
Unexecuted instantiation: void mozilla::Swap<js::wasm::TrapSite*>(js::wasm::TrapSite*&, js::wasm::TrapSite*&)
Unexecuted instantiation: void mozilla::Swap<js::ReadBarriered<JS::Symbol*> >(js::ReadBarriered<JS::Symbol*>&, js::ReadBarriered<JS::Symbol*>&)
void mozilla::Swap<mozilla::Vector<js::gc::Chunk*, 0ul, mozilla::MallocAllocPolicy> >(mozilla::Vector<js::gc::Chunk*, 0ul, mozilla::MallocAllocPolicy>&, mozilla::Vector<js::gc::Chunk*, 0ul, mozilla::MallocAllocPolicy>&)
Line
Count
Source
201
18
{
202
18
  T tmp(std::move(aX));
203
18
  aX = std::move(aY);
204
18
  aY = std::move(tmp);
205
18
}
Unexecuted instantiation: void mozilla::Swap<void*>(void*&, void*&)
Unexecuted instantiation: void mozilla::Swap<mozilla::HashSet<void*, mozilla::PointerHasher<void*>, js::SystemAllocPolicy> >(mozilla::HashSet<void*, mozilla::PointerHasher<void*>, js::SystemAllocPolicy>&, mozilla::HashSet<void*, mozilla::PointerHasher<void*>, js::SystemAllocPolicy>&)
206
207
} // namespace mozilla
208
209
#endif /* mozilla_Move_h */