With an analysis to find the set of functions which can GC (bug 829243), it is not too hard to automatically find unrooted GC thing pointers or Values which are held live across a call which can GC, or to find rooted things which are not held live across such a call (and for which the root adds unnecessary overhead).
I wrote some more scripts to find variables fitting either of these categories, building on top of bug 829243 and also stored at https://github.com/bhackett1024/gcAnalysis. A list of all the reports is at:
This currently reports 851 rooting hazards in the shell (though 107 are in jsxml.cpp and can be ignored), and 171 unnecessary roots. These reports are still preliminary and will have a fair number of false positives, will be working to improve this. For usability the number of false positives needs to be zero.
*** Bug 658676 has been marked as a duplicate of this bug. ***