summaryrefslogtreecommitdiffstats
path: root/js/public/RootingAPI.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/public/RootingAPI.h')
-rw-r--r--js/public/RootingAPI.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/js/public/RootingAPI.h b/js/public/RootingAPI.h
index 9f6ed8943..ca35ea4a5 100644
--- a/js/public/RootingAPI.h
+++ b/js/public/RootingAPI.h
@@ -274,6 +274,12 @@ class MOZ_NON_MEMMOVABLE Heap : public js::HeapBase<T>
T* unsafeGet() { return &ptr; }
+ void set(const T& newPtr) {
+ T tmp = ptr;
+ ptr = newPtr;
+ post(tmp, ptr);
+ }
+
explicit operator bool() const {
return bool(js::BarrierMethods<T>::asGCThingOrNull(ptr));
}
@@ -287,12 +293,6 @@ class MOZ_NON_MEMMOVABLE Heap : public js::HeapBase<T>
post(GCPolicy<T>::initial(), ptr);
}
- void set(const T& newPtr) {
- T tmp = ptr;
- ptr = newPtr;
- post(tmp, ptr);
- }
-
void post(const T& prev, const T& next) {
js::BarrierMethods<T>::postBarrier(&ptr, prev, next);
}
@@ -1172,13 +1172,13 @@ class PersistentRooted : public js::PersistentRootedBase<T>,
return ptr;
}
- private:
template <typename U>
void set(U&& value) {
MOZ_ASSERT(initialized());
ptr = mozilla::Forward<U>(value);
}
+ private:
// See the comment above Rooted::ptr.
using MaybeWrapped = typename mozilla::Conditional<
MapTypeToRootKind<T>::kind == JS::RootKind::Traceable,