Bug 1199220 - Implement JS::ubi::Node::size for js::BaseShape referents; r=sfink

This commit is contained in:
Nick Fitzgerald 2015-09-22 12:15:24 -07:00
parent dd4075f4da
commit 5c1fb4b1f9
2 changed files with 16 additions and 1 deletions

View File

@ -1663,3 +1663,9 @@ JS::ubi::Concrete<js::Shape>::size(mozilla::MallocSizeOf mallocSizeOf) const
return size;
}
JS::ubi::Node::Size
JS::ubi::Concrete<js::BaseShape>::size(mozilla::MallocSizeOf mallocSizeOf) const
{
return js::gc::Arena::thingSize(get().asTenured().getAllocKind());
}

View File

@ -1445,7 +1445,16 @@ template<> struct Concrete<js::Shape> : TracerConcreteWithCompartment<js::Shape>
static void construct(void *storage, js::Shape *ptr) { new (storage) Concrete(ptr); }
};
template<> struct Concrete<js::BaseShape> : TracerConcreteWithCompartment<js::BaseShape> { };
template<> struct Concrete<js::BaseShape> : TracerConcreteWithCompartment<js::BaseShape> {
Size size(mozilla::MallocSizeOf mallocSizeOf) const override;
protected:
explicit Concrete(js::BaseShape *ptr) : TracerConcreteWithCompartment<js::BaseShape>(ptr) { }
public:
static void construct(void *storage, js::BaseShape *ptr) { new (storage) Concrete(ptr); }
};
} // namespace ubi
} // namespace JS