mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
Issue #316 - Make the memory GC performance object conditional (WIP)
This was only added for GCubench and likely interfering with building without devtools-server.
This commit is contained in:
parent
639a4913b3
commit
1e553d0e73
11 changed files with 36 additions and 0 deletions
|
|
@ -741,7 +741,9 @@ class GCRuntime
|
|||
void removeBlackRootsTracer(JSTraceDataOp traceOp, void* data);
|
||||
|
||||
void setMaxMallocBytes(size_t value);
|
||||
#ifdef MOZ_DEVTOOLS_SERVER
|
||||
int32_t getMallocBytes() const { return mallocBytesUntilGC; }
|
||||
#endif
|
||||
void resetMallocBytes();
|
||||
bool isTooMuchMalloc() const { return mallocBytesUntilGC <= 0; }
|
||||
void updateMallocCounter(JS::Zone* zone, size_t nbytes);
|
||||
|
|
|
|||
|
|
@ -505,7 +505,10 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason)
|
|||
if (!isEnabled())
|
||||
return;
|
||||
|
||||
#ifdef MOZ_DEVTOOLS_SERVER
|
||||
// No need to obsessively track this without devtools
|
||||
rt->gc.incMinorGcNumber();
|
||||
#endif
|
||||
|
||||
rt->gc.stats.beginNurseryCollection(reason);
|
||||
TraceMinorGCStart();
|
||||
|
|
|
|||
|
|
@ -6776,6 +6776,7 @@ js::gc::NextCellUniqueId(JSRuntime* rt)
|
|||
return rt->gc.nextCellUniqueId();
|
||||
}
|
||||
|
||||
#ifdef MOZ_DEVTOOLS_SERVER
|
||||
namespace js {
|
||||
namespace gc {
|
||||
namespace MemInfo {
|
||||
|
|
@ -7032,6 +7033,7 @@ AutoEmptyNursery::AutoEmptyNursery(JSRuntime *rt)
|
|||
|
||||
} /* namespace gc */
|
||||
} /* namespace js */
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
void
|
||||
|
|
|
|||
|
|
@ -1357,8 +1357,10 @@ class ZoneList
|
|||
ZoneList& operator=(const ZoneList& other) = delete;
|
||||
};
|
||||
|
||||
#ifdef MOZ_DEVTOOLS_SERVER
|
||||
JSObject*
|
||||
NewMemoryStatisticsObject(JSContext* cx);
|
||||
#endif
|
||||
|
||||
struct MOZ_RAII AutoAssertNoNurseryAlloc
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7090,6 +7090,7 @@ NewGlobalObject(JSContext* cx, JS::CompartmentOptions& options,
|
|||
if (!DefineOS(cx, glob, fuzzingSafe, &gOutFile, &gErrFile))
|
||||
return nullptr;
|
||||
|
||||
#ifdef MOZ_DEVTOOLS_SERVER
|
||||
RootedObject performanceObj(cx, JS_NewObject(cx, nullptr));
|
||||
if (!performanceObj)
|
||||
return nullptr;
|
||||
|
|
@ -7105,6 +7106,7 @@ NewGlobalObject(JSContext* cx, JS::CompartmentOptions& options,
|
|||
return nullptr;
|
||||
if (!JS_DefineProperty(cx, mozMemoryObj, "gc", gcObj, JSPROP_ENUMERATE))
|
||||
return nullptr;
|
||||
#endif
|
||||
|
||||
/* Initialize FakeDOMObject. */
|
||||
static const js::DOMCallbacks DOMcallbacks = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue