Make GT_LIST processing non-recursive to avoid StackOverflow.
authorEugene Rozenfeld <erozen@microsoft.com>
Tue, 6 Sep 2016 23:51:23 +0000 (16:51 -0700)
committerEugene Rozenfeld <erozen@microsoft.com>
Wed, 7 Sep 2016 17:49:23 +0000 (10:49 -0700)
commita67f5698705dab8cb58bd07c733ac492e81ad28f
tree67091a015f8d5a85e4f7d12e3cccf4a14ee33b5f
parentbcd4c0c7ff141f854c1c3727f9a5cf45ea3efd43
Make GT_LIST processing non-recursive to avoid StackOverflow.

We had some internal cases where crossgen failed with StackOverflow exception
when compiling huge methods. In particular, the methods had GT_PHI nodes with
huge number of arguments.

StackOverflow was happening in multiple places. Recent LIR changes eliminated two of those places,
these changes eliminate two more: gtSetEvalOrder and fgDebugCheckFlags (debug only). We already had
gtSetListOrder but it was only used for call arg lists. I made gtSetListOrder non-recursive and also generalized
to handle other GT_LIST nodes.

With that with these changes the huge repros can now be crossgen'd.

I verified no assembly diffs in SuperPMI.

I'm verifying overall throughput effect.
src/jit/compiler.h
src/jit/flowgraph.cpp
src/jit/gentree.cpp