These function are unused.
Docs:
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_reference/JS_MaybeGC
The information found here "should be ignored completely": https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/Garbage_collection
Some history:
rP8622 introduced the ScriptInterface MaybeGC function and called it every 10th turn in CSimulation2Impl::Update
rP9220 exposed it to rmgen JS, but it was never called.
rP13225 was a major CCmpAIManager commit and added a number of MaybeGC calls and a ForceGC function there
rP14877 updated SM to v24 and
- removed the CCmpAIManager MaybeGC
- introduced MaybeIncrementalRuntimeGC and changed the simulation MaybeGC call to that
- left MaybeGC unused
rP15787, rP15831, #2808 tuned the MaybeIncrementalRuntimeGC calls.
In current svn, we still have these MaybeIncrementalRuntimeGC and a number of calls to native SpiderMonkey functions:
- JS::IsIncrementalGCEnabled
- JS_GetGCParameter
- JS::IsIncrementalGCInProgress
- JS::IncrementalGCSlice
- JS::StartIncrementalGC
- JS_AddExtraGCRootsTracer
- JS_RemoveExtraGCRootsTracer
- JS_GC
- ...
As we can see from the revision history:
- Optimizing the garbage collection isn't simple. Adding reasonable GC calls requires a good understanding of the GC, not too few code and lots of time.
- Many more places than these two are possible use cases.
- Many more functions than these two are often required to address the use cases.
So the unused functions don't seem to lower the effort for GC optimization and hence can be removed.