diff options
author | Andy Ayers <andya@microsoft.com> | 2016-03-04 14:16:58 -0800 |
---|---|---|
committer | Andy Ayers <andya@microsoft.com> | 2016-03-07 19:53:23 -0800 |
commit | 1876230e5098541c150f2893644fda413484426c (patch) | |
tree | 0c38d12ba66428df0e4cd51e48b9a77be8461b0a /src/jit/inline.h | |
parent | 40b9ef6f3cc647ec0413e583b4a9e55b55b885bb (diff) | |
download | coreclr-1876230e5098541c150f2893644fda413484426c.tar.gz coreclr-1876230e5098541c150f2893644fda413484426c.tar.bz2 coreclr-1876230e5098541c150f2893644fda413484426c.zip |
Inline refactoring: move state machine into LegacyPolicy
The state machine used to estimate callee native code size is now an
internal part of the LegacyPolicy.
During `fgFindJumpTargets` the policy determines if the state machine
is need, and if so, sets one up. `fgFindJumpTargets` then notifies the
policy of the various opcodes in the method, and the policy uses this
to drive the state machine forward.
When the IL scan is completed, the `fgFindJumpTargets` notifies the
policy, then, for the discretionary inline case, grabs the native size
estimate, and uses that to evaluate inlinability.
The knowledge of when inlines are "always", "forced", or
"discretionary" is now encapsulated by the policy instead of being
distributed in various places in the code.
Diffstat (limited to 'src/jit/inline.h')
-rw-r--r-- | src/jit/inline.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/jit/inline.h b/src/jit/inline.h index 625e1ea7ed..9a5a7bcf7d 100644 --- a/src/jit/inline.h +++ b/src/jit/inline.h @@ -228,6 +228,8 @@ public: // Policy determinations virtual double determineMultiplier() = 0; + virtual bool hasNativeSizeEstimate() = 0; + virtual int determineNativeSizeEstimate() = 0; // Policy policies virtual bool propagateNeverToRuntime() const = 0; @@ -363,6 +365,18 @@ public: return inlPolicy->determineMultiplier(); } + // Is there a native size estimate? + bool hasNativeSizeEstimate() + { + return inlPolicy->hasNativeSizeEstimate(); + } + + // Determine the native size estimate for this inline + int determineNativeSizeEstimate() + { + return inlPolicy->determineNativeSizeEstimate(); + } + // Ensure details of this inlining process are appropriately // reported when the result goes out of scope. ~InlineResult() |