diff options
author | Moonchild <git-repo@palemoon.org> | 2020-02-20 16:50:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-20 16:50:49 +0100 |
commit | 7832dded378423f245cb8cf8ef66c4c16a39f6e8 (patch) | |
tree | 8942443c378dfbe069af0bab196fa63a212adc83 /js | |
parent | 0e9957c412002000067479e7ce582e8d625e21c0 (diff) | |
parent | d53b11c9dc34d0a8c3bb4ad862cff1e0ce566457 (diff) | |
download | UXP-7832dded378423f245cb8cf8ef66c4c16a39f6e8.tar UXP-7832dded378423f245cb8cf8ef66c4c16a39f6e8.tar.gz UXP-7832dded378423f245cb8cf8ef66c4c16a39f6e8.tar.lz UXP-7832dded378423f245cb8cf8ef66c4c16a39f6e8.tar.xz UXP-7832dded378423f245cb8cf8ef66c4c16a39f6e8.zip |
Merge pull request #1458 from MoonchildProductions/316
Fix buildability of builds without devtools-server
Diffstat (limited to 'js')
-rw-r--r-- | js/public/HeapAPI.h | 2 | ||||
-rw-r--r-- | js/src/gc/GCRuntime.h | 2 | ||||
-rw-r--r-- | js/src/gc/Nursery.cpp | 3 | ||||
-rw-r--r-- | js/src/jsgc.cpp | 2 | ||||
-rw-r--r-- | js/src/jsgc.h | 2 | ||||
-rw-r--r-- | js/src/shell/js.cpp | 2 |
6 files changed, 13 insertions, 0 deletions
diff --git a/js/public/HeapAPI.h b/js/public/HeapAPI.h index e37d13e93..fef6c0c78 100644 --- a/js/public/HeapAPI.h +++ b/js/public/HeapAPI.h @@ -392,6 +392,7 @@ IsIncrementalBarrierNeededOnTenuredGCThing(JS::shadow::Runtime* rt, const JS::GC return JS::shadow::Zone::asShadowZone(zone)->needsIncrementalBarrier(); } +#ifdef MOZ_DEVTOOLS_SERVER /** * Create an object providing access to the garbage collector's internal notion * of the current state of memory (both GC heap memory and GCthing-controlled @@ -399,6 +400,7 @@ IsIncrementalBarrierNeededOnTenuredGCThing(JS::shadow::Runtime* rt, const JS::GC */ extern JS_PUBLIC_API(JSObject*) NewMemoryInfoObject(JSContext* cx); +#endif } /* namespace gc */ } /* namespace js */ diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h index f102e9ef0..f43dcd351 100644 --- a/js/src/gc/GCRuntime.h +++ b/js/src/gc/GCRuntime.h @@ -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); diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp index 93a0eb6a8..737d68bd0 100644 --- a/js/src/gc/Nursery.cpp +++ b/js/src/gc/Nursery.cpp @@ -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(); diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp index 5a9d732b6..3ad526f74 100644 --- a/js/src/jsgc.cpp +++ b/js/src/jsgc.cpp @@ -6778,6 +6778,7 @@ js::gc::NextCellUniqueId(JSRuntime* rt) namespace js { namespace gc { +#ifdef MOZ_DEVTOOLS_SERVER namespace MemInfo { static bool @@ -6993,6 +6994,7 @@ NewMemoryInfoObject(JSContext* cx) return obj; } +#endif // MOZ_DEVTOOLS_SERVER const char* StateName(State state) diff --git a/js/src/jsgc.h b/js/src/jsgc.h index 952fd6bae..601f63daa 100644 --- a/js/src/jsgc.h +++ b/js/src/jsgc.h @@ -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 { diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 36558a694..4b0c858a4 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -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 = { |