[GR-37411] Fix method inlining and quickbuild mode. #4391
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Method inlining of
AlwaysInline
annotated methods is always necessary for correctness. So the optionAOTInline
just does not make sense. This means the method inlining stage of the CompileQueue must always run. WhenAOTTrivialInlining
is disabled, it just only inlines theAlwaysInline
methods.Also interesting to note is that even with
AOTInline
disabled, we were still inlining before the static analysis - because that inlining is again necessary for correctness of e.g. Spring applications.For quick-build mode, disabling trivial method inlining does not make much sense. It takes only 4 seconds for Spring petclinic, then actually reduces compilation time by a few seconds (so overall only a few seconds build time increase) - and avoids all the pathological peak performance problems that can occur without inlining.
The quick-build mode also had a problem that increased the image size (and even image build time of HelloWorld): the enterprise-optimizations before static analysis eliminate String.format and perform method outlining - both actually make images smaller and image build faster. So they must run in quick-build mode too. Removing
EconomyHostedConfiguration
(so that the properEnterpriseHostedConfiguration
is used) is the simple fix for that problem.And since I was already changing a lot, I also removed the "hack" that
-Ob
was treated as optimization level 0 in some places - nowOptimizationLevel
is an enum and all usages properly distinguish between0
andb
.