mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-11 10:18:21 +09:00
Stack allocate unescaped boxes (#103361)
Enable object stack allocation for ref classes and extend the support to include boxed value classes. Use a specialized unbox helper for stack allocated boxes, both to avoid apparent escape of the box by the helper, and to ensure all box field accesses are visible to the JIT. Update the local address visitor to rewrite trees involving address of stack allocated boxes in some cases to avoid address exposure. Disable old promotion for stack allocated boxes (since we have no field handles) and allow physical promotion to enregister the box method table and/or payload as appropriate. In OSR methods handle the fact that the stack allocation may actually have been a heap allocation by the Tier0 method. The analysis TP cost is around 0.4-0.7% (notes below). Boxes are much less likely to escape than ref classes (roughly ~90% of boxes escape, ~99.8% of ref classes escape). Codegen impact is diminished somewhat because many of the boxes are dead and were already getting optimized away. Fixes #4584, #9118, #10195, #11192, #53585, #58554, #85570 --------- Co-authored-by: Jakob Botsch Nielsen <jakob.botsch.nielsen@gmail.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com>
This commit is contained in:
parent
8366f6ad79
commit
53a8a01fe1
39 changed files with 833 additions and 189 deletions
|
@ -13404,6 +13404,10 @@ VNFunc Compiler::fgValueNumberJitHelperMethodVNFunc(CorInfoHelpFunc helpFunc)
|
|||
vnf = VNF_Unbox;
|
||||
break;
|
||||
|
||||
case CORINFO_HELP_UNBOX_TYPETEST:
|
||||
vnf = VNF_Unbox_TypeTest;
|
||||
break;
|
||||
|
||||
// A constant within any method.
|
||||
case CORINFO_HELP_GETCURRENTMANAGEDTHREADID:
|
||||
vnf = VNF_ManagedThreadId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue