Bug 1199221 - Implement JS::ubi::Node::size for js::ObjectGroup referents; r=sfink

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

View File

@ -4450,3 +4450,11 @@ TypeScript::printTypes(JSContext* cx, HandleScript script) const
fprintf(stderr, "\n");
}
#endif /* DEBUG */
JS::ubi::Node::Size
JS::ubi::Concrete<js::ObjectGroup>::size(mozilla::MallocSizeOf mallocSizeOf) const
{
Size size = js::gc::Arena::thingSize(get().asTenured().getAllocKind());
size += get().sizeOfExcludingThis(mallocSizeOf);
return size;
}

View File

@ -1295,7 +1295,18 @@ PrintTypes(JSContext* cx, JSCompartment* comp, bool force);
// with no associated compartment.
namespace JS {
namespace ubi {
template<> struct Concrete<js::ObjectGroup> : TracerConcrete<js::ObjectGroup> { };
template<>
struct Concrete<js::ObjectGroup> : TracerConcrete<js::ObjectGroup> {
Size size(mozilla::MallocSizeOf mallocSizeOf) const override;
protected:
explicit Concrete(js::ObjectGroup *ptr) : TracerConcrete<js::ObjectGroup>(ptr) { }
public:
static void construct(void *storage, js::ObjectGroup *ptr) { new (storage) Concrete(ptr); }
};
} // namespace ubi
} // namespace JS