ReorderGlobals pass
This sorts globals by their usage (and respecting dependencies). If the module has very many globals then using smaller LEBs can matter.
On most MVP files this won't matter, since there are only a few globals at most (the stack pointer, maybe dynamic linking?). With GC there is more reason to use globals for things like vtables. This shrinks J2Wasm by 7% (!), though only 0.5% after gzip. This doesn't help all GC code, though - on Dart it just helps by 0.2% both before and after gzip.
Given the low benefit in general, I wonder if this should not be turned on by default. Perhaps it could be skipped if we have fewer than 128 globals, for example? (though that would make testing less simple, as small testcases would be skipped...)
Credit to @jakobkummerow for the idea.