InlineRefactoring: introducing InlinePolicy
authorAndy Ayers <andya@microsoft.com>
Mon, 22 Feb 2016 21:51:52 +0000 (13:51 -0800)
committerAndy Ayers <andya@microsoft.com>
Tue, 23 Feb 2016 16:28:04 +0000 (08:28 -0800)
commitd5d25db5934520997ef085bd5f973451fd15a947
treece5d51afb58e2fefe088da68afbfc0a29e9fd1fd
parente9fa953a295d16b7e00e9192b4973743398358e9
InlineRefactoring: introducing InlinePolicy

Split the policy aspect of the InlineResult into a separate
policy object, acessed from the InlineResult via a base class.

Implement a LegacyPolicy to capture today's behavior.

Create a factory method for determining what policy to use. Right
now it always creates a LegacyPolicy. This is newed up for each
Inline decision, but since the InlineResult has relatively short
lifetime, we should probably recycle policy objects (might be
more desirable once they start having a bit more state).

Split out a bunch of the InlineDecision helper methods that lived
on InlineResult into global methods since policies will want to refer
to them too. Shame that enum classes don't allow member functions.
src/jit/inline.cpp
src/jit/inline.h