Issue #1742 - Part 1: Refactor rooting base class templates

Based on Bug 1325406
This commit is contained in:
Moonchild 2022-05-24 06:51:11 +00:00 committed by roytam1
commit 80d7d43961
24 changed files with 239 additions and 512 deletions

View file

@ -541,7 +541,6 @@ class InnerViewTable
typedef Vector<ArrayBufferViewObject*, 1, SystemAllocPolicy> ViewVector;
friend class ArrayBufferObject;
friend class WeakCacheBase<InnerViewTable>;
private:
struct MapGCPolicy {
@ -602,23 +601,15 @@ class InnerViewTable
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf);
};
template <>
class WeakCacheBase<InnerViewTable>
template <typename Wrapper>
class MutableWrappedPtrOperations<InnerViewTable, Wrapper>
: public WrappedPtrOperations<InnerViewTable, Wrapper>
{
InnerViewTable& table() {
return static_cast<JS::WeakCache<InnerViewTable>*>(this)->get();
}
const InnerViewTable& table() const {
return static_cast<const JS::WeakCache<InnerViewTable>*>(this)->get();
return static_cast<Wrapper*>(this)->get();
}
public:
InnerViewTable::ViewVector* maybeViewsUnbarriered(ArrayBufferObject* obj) {
return table().maybeViewsUnbarriered(obj);
}
void removeViews(ArrayBufferObject* obj) { table().removeViews(obj); }
void sweepAfterMinorGC() { table().sweepAfterMinorGC(); }
bool needsSweepAfterMinorGC() const { return table().needsSweepAfterMinorGC(); }
size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) {
return table().sizeOfExcludingThis(mallocSizeOf);
}