Simplify precompiles
This switches to "do a little work" for precompilation, rather than explicitly spelling out the specific signatures. This should be more maintainable and potentially more exhaustive (or could be made to be so) since it precompiles across runtime dispatch boundaries.
This also uses Base.inferencebarrier in several places to
prevent an argument from being specialized.
I was using this as a test case for https://github.com/JuliaLang/julia/pull/43990 to see if I can eliminate all inference from Revise. It turns out there's one CodeInstance whose inferred code is either not cached or is deleted after compilation. Needs investigation. But the total inference time is <50ms, so in practice it's not a big deal.
I've investigated with help from @aviatesk, and determined that the stubborn MethodInstance was having its compiled code discarded because of a LimitedAccuracy annotation. This was pretty easy to work around (though documentation on this point will need to be added to, e.g., SnoopCompile). Now the total inference time is <5ms on https://github.com/JuliaLang/julia/pull/43990. :v:
Wow, the GC corruption on 1.7 is a bit scary---we might need to debug that and patch 1.7 before merging this.
But the test failure on nightly is https://github.com/JuliaLang/julia/pull/42822, which appears to be deliberate. (CC @IanButterworth.)