Make RegexCompiler-generated code more JIT friendly (#35321)
authorStephen Toub <stoub@microsoft.com>
Sat, 25 Apr 2020 14:12:10 +0000 (10:12 -0400)
committerGitHub <noreply@github.com>
Sat, 25 Apr 2020 14:12:10 +0000 (10:12 -0400)
commitdef65b89ea9d23e2cfebd29518a3de4b1e210e8d
tree813a84eb40d27e2be4d72aeeb109fab1467a9224
parentcfaaf7738f4c6dc686dbc2599f480cb56c4285a5
Make RegexCompiler-generated code more JIT friendly (#35321)

* Make RegexCompiler-generated code more JIT friendly

- Prefer using stloc/ldloc over using dup, especially across branches.
- Use call instead of callvirt where applicable.
- Use shorter form of some instructions

* Remove the rest of the Dups
src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCompiler.cs