3 ms·
http://en.wikipedia.org/wiki/Escape_analysis http://en.wikipedia.org/wiki/Escape_analysis In a nutshell, figuring out whether a variable or object is going to
by idlewords 17y ago
http://en.wikipedia.org/wiki/Escape_analysis http://en.wikipedia.org/wiki/Escape_analysis
In a nutshell, figuring out whether a variable or object is going to be entirely confined to a single thread and scope and using that information to perform optimizations (like sticking things into registers) or avoid unnecessary locking.
- sb 17y agoafair, the most important optimization there is that something can be allocated on the stack instead of the heap, which is quite an optimization. EDIT: it does not actually have anything to do what you can stick in registers--at least nothing comes to my mind w/o thinking too hard about it... relevant papers directly from the hotspot-jvm are: -kotzmann, moessenboeck, "escape analysis in the context of dynamic compilation and deoptimization" http://www.usenix.org/events/vee05/full_papers/p111-kotzmann.pdf http://www.usenix.org/events/vee05/full_papers/p111-kotzmann... -kotzmann, moessenboeck: "run-time support for optimizations based on escape analysis" http://ftp.ssw.uni-linz.ac.at/Research/Papers/Ko07/Ko07.pdf http://ftp.ssw.uni-linz.ac.at/Research/Papers/Ko07/Ko07.pdf
- slava_pestov 17y agoActually, once you've figured out that you can stack allocate an object, you can stick its instance variables in registers. This can be a huge win.
- deleted 17y ago[deleted]