tfpt review “/shelveset:LightBinding5;REDMOND\tomat”
The changeset focuses on reducing time spent in JIT to compile generic
instantiations of various helper methods. These are mostly related to
generic instructions that implement dynamic sites and method calls. It
reduces the number of methods jitted during startup time of irb from 481
to 80 (with -X:CompilationThreshold 10000000), which translates to 34%
rbr -X:CompilationThreshold 10000000 i.rb < exit.txt
s = Time.now
t = Time.now
p t - s
Before: 0.961096 seconds
After: 0.631063 seconds
Adds LightDynamicExpression - these reducible nodes reduce to strongly
typed DynamicExpressions yet when interpreted use untyped dynamic sites
(sites typed to CallSite<Func<CallSite, object*>>). Using light sites
avoids jitting generic instantiations of various instructions, stubs and
helpers that are strongly typed to the call-site signature. Also,
strongly typed delegate types are created only when compiling the sites.
Adds helpers to CallInstruction that add MethodInfo to CallInstruction
mapping into the internal cache. These helpers can be used by reflection
caches that look up CLR helper methods. For example, Ruby’s
ReflectionCache holds on MethodInfos for all RubyOps. Whenever a helper
MethodInfo is needed a delegate is created for it and cached into
CallInstruction’s cache along with the instruction that dispatches to
it. Since all static helpers are known upfront the delegates and the
corresponding instructions can all be ngen’d.
Moves helpers for rule interpretation from Ruby to DynamicUtils.
Replaces LazyDynamicExpressions with subclasses of
Simplifies rules interpretation, moves related helpers to DLR.
Uses LightDynamicExpression for all dynamic sites.
Uses CallInstruction caching for RubyOps.