diff options
author | Eugene Rozenfeld <erozen@microsoft.com> | 2018-10-29 17:34:17 -0700 |
---|---|---|
committer | Eugene Rozenfeld <erozen@microsoft.com> | 2018-11-08 22:35:07 -0800 |
commit | 00f5934a3e34977c7a1502da604f2dae90040888 (patch) | |
tree | 1b739c1141eeb5973ae2c1ded9619164ca21a260 /src/jit/morph.cpp | |
parent | e472fd44778d8322db53284336c2a96e75d70244 (diff) | |
download | coreclr-00f5934a3e34977c7a1502da604f2dae90040888.tar.gz coreclr-00f5934a3e34977c7a1502da604f2dae90040888.tar.bz2 coreclr-00f5934a3e34977c7a1502da604f2dae90040888.zip |
Implement escape analysis and stack allocation of non-box objects without gc fields.
This change implements a conservative flow-insensitive escape analysis and stack allocation
of non-box objects without gc fields.
Handling of objects with gc fields, box objects, and fixed-size arrays is future work.
Escape analysis is based on the one described here: https://www.cc.gatech.edu/~harrold/6340/cs6340_fall2009/Readings/choi99escape.pdf
Main limitations of this version of the escape analysis:
1. The analysis is flow-insensitive.
2. The analysis is intra-procedural and only sees the current method and the inlined methods.
3. The analysis assumes that references passed to non-pure-helper calls escape.
4. The analysis assumes that any references assigned to fields of objects escape.
Some of these limitations will be removed in future work.
I started with prior prototypes from @echesakovMSFT and @AndyAyersMS and extended and refactored
parts of them.
I also added tests for cases that are currently handled or will be handled soon.
Diffstat (limited to 'src/jit/morph.cpp')
-rw-r--r-- | src/jit/morph.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index bb04cdb302..6a98df9ea4 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -16738,10 +16738,14 @@ void Compiler::fgMorph() // local variable allocation on the stack. ObjectAllocator objectAllocator(this); // PHASE_ALLOCATE_OBJECTS +// TODO-ObjectStackAllocation: Enable the optimization for architectures using +// JIT32_GCENCODER (i.e., x86). +#ifndef JIT32_GCENCODER if (JitConfig.JitObjectStackAllocation() && !opts.MinOpts() && !opts.compDbgCode) { objectAllocator.EnableObjectStackAllocation(); } +#endif // JIT32_GCENCODER objectAllocator.Run(); |