mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1063247: Amend JS::ubi::Node::size and its implementations to expect a mozilla::MallocSizeOf function. r=terrence
Note that JS::ubi::Node::size has no callers at present, so we can change its type without changing any callers.
This commit is contained in:
parent
25be307de9
commit
49104fabe9
@ -10,6 +10,7 @@
|
||||
#include "mozilla/Alignment.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Move.h"
|
||||
|
||||
#include "jspubtd.h"
|
||||
@ -178,7 +179,9 @@ class Base {
|
||||
|
||||
// Return the size of this node, in bytes. Include any structures that this
|
||||
// node owns exclusively that are not exposed as their own ubi::Nodes.
|
||||
virtual size_t size() const = 0;
|
||||
// |mallocSizeOf| should be a malloc block sizing function; see
|
||||
// |mfbt/MemoryReporting.h.
|
||||
virtual size_t size(mozilla::MallocSizeOf mallocSizeof) const = 0;
|
||||
|
||||
// Return an EdgeRange that initially contains all the referent's outgoing
|
||||
// edges. The EdgeRange should be freed with 'js_delete'. (You could use
|
||||
@ -321,9 +324,13 @@ class Node {
|
||||
JS::Value exposeToJS() const;
|
||||
|
||||
const jschar *typeName() const { return base()->typeName(); }
|
||||
size_t size() const { return base()->size(); }
|
||||
JS::Zone *zone() const { return base()->zone(); }
|
||||
JSCompartment *compartment() const { return base()->compartment(); }
|
||||
|
||||
size_t size(mozilla::MallocSizeOf mallocSizeof) const {
|
||||
return base()->size(mallocSizeof);
|
||||
}
|
||||
|
||||
EdgeRange *edges(JSContext *cx, bool wantNames = true) const {
|
||||
return base()->edges(cx, wantNames);
|
||||
}
|
||||
@ -419,7 +426,9 @@ class EdgeRange {
|
||||
template<typename Referent>
|
||||
class TracerConcrete : public Base {
|
||||
const jschar *typeName() const MOZ_OVERRIDE { return concreteTypeName; }
|
||||
size_t size() const MOZ_OVERRIDE { return 0; } // not implemented yet; bug 1011300
|
||||
size_t size(mozilla::MallocSizeOf mallocSizeof) const MOZ_OVERRIDE {
|
||||
return 0; // not implemented yet; bug 1011300
|
||||
}
|
||||
EdgeRange *edges(JSContext *, bool wantNames) const MOZ_OVERRIDE;
|
||||
JS::Zone *zone() const MOZ_OVERRIDE { return get().zone(); }
|
||||
JSCompartment *compartment() const MOZ_OVERRIDE { return nullptr; }
|
||||
@ -458,7 +467,7 @@ template<> struct Concrete<JSScript> : TracerConcreteWithCompartment<JSScript> {
|
||||
template<>
|
||||
class Concrete<void> : public Base {
|
||||
const jschar *typeName() const MOZ_OVERRIDE;
|
||||
size_t size() const MOZ_OVERRIDE;
|
||||
size_t size(mozilla::MallocSizeOf mallocSizeOf) const MOZ_OVERRIDE;
|
||||
EdgeRange *edges(JSContext *cx, bool wantNames) const MOZ_OVERRIDE;
|
||||
JS::Zone *zone() const MOZ_OVERRIDE;
|
||||
JSCompartment *compartment() const MOZ_OVERRIDE;
|
||||
|
@ -29,11 +29,16 @@ using JS::ubi::TracerConcrete;
|
||||
|
||||
// All operations on null ubi::Nodes crash.
|
||||
const jschar *Concrete<void>::typeName() const { MOZ_CRASH("null ubi::Node"); }
|
||||
size_t Concrete<void>::size() const { MOZ_CRASH("null ubi::Node"); }
|
||||
EdgeRange *Concrete<void>::edges(JSContext *, bool) const { MOZ_CRASH("null ubi::Node"); }
|
||||
JS::Zone *Concrete<void>::zone() const { MOZ_CRASH("null ubi::Node"); }
|
||||
JSCompartment *Concrete<void>::compartment() const { MOZ_CRASH("null ubi::Node"); }
|
||||
|
||||
size_t
|
||||
Concrete<void>::size(mozilla::MallocSizeOf mallocSizeof) const
|
||||
{
|
||||
MOZ_CRASH("null ubi::Node");
|
||||
}
|
||||
|
||||
Node::Node(JSGCTraceKind kind, void *ptr)
|
||||
{
|
||||
switch (kind) {
|
||||
|
Loading…
Reference in New Issue
Block a user