JIT: fix case with slow generic delegate creation (#17802)
authorAndy Ayers <andya@microsoft.com>
Fri, 11 May 2018 00:22:10 +0000 (17:22 -0700)
committerGitHub <noreply@github.com>
Fri, 11 May 2018 00:22:10 +0000 (17:22 -0700)
commite2e1cfa1ce7def86a04c4bc495081d1389fe0c48
tree7aa51c74491cde921ca4e0e1cddad10c7708114e
parent8a0c19ea09b2b4b0ecfa4af427ae2e4926e218f7
JIT: fix case with slow generic delegate creation (#17802)

The jit has been using IR pattern matching to find the information needed for
optimizing delegate construction. This missed one case, causing the code to
use a very slow construction path.

to convey this information to the optimization. With this change the jit now
now relies on the token cache for all the other cases too.

This initial commit preserves the pattern match code and verifies that when
it fires it reaches the same conclusion as the token cache does.

This cross-validation revealed one case where the token information was less
specific than the pattern match so we now also update the method handle in
the token from the call info.

A subsequent commit will remove the pattern matching when we are confident the
new token cache logic handles all the cases correctly.

Closes #12264.
src/jit/flowgraph.cpp
src/jit/importer.cpp