Inliner: use time budget to avoid excessive inlining
Use the time budget and time estimates to stop inlining once the
overall jit time increase estimate for the method is 10x the initial
jit time estimate.
This is implemented as part of `LegacyPolicy` and so can impact
the current inline behavior.
The budget is intentionally set quite high so that it only kicks in
for very rare cases where the call tree below the root is deep and wide
with many small methods. In extended testing on desktop this limit
fires in exactly two cases, both HFA tests.
In CoreCLR tests 12 of the HFA tests hit this limit. I've added
a directed test case here that came from the original bug report.
Closes dotnet/coreclr#2472.
Commit migrated from https://github.com/dotnet/coreclr/commit/
597f78e55cc77dc75f25c5aa2471ea0e82e988cd