[Mono-dev] [PATCH] Generic sharing: Static field access

Zoltan Varga vargaz at gmail.com
Mon Nov 19 16:11:36 EST 2007


     Hi,

  The problem with the trampoline is that since the class to init is dynamically
decided, there is nothing to patch, so all calls will go through the
generic trampoline
code, which is much slower than a simple managed-to-native transition.

                Zoltan

On Nov 19, 2007 7:25 PM, Paolo Molaro <lupus at ximian.com> wrote:
> On 11/19/07 Zoltan Varga wrote:
> > A simpler solution would be to emit the code below inline instead of
> > making a call
> > to a trampoline at all.
>
> This moves the memory overhead at the callsite, increasing icache
> footprint (we're talking about 10 bytes for x86 and 16+ bytes
> for other architectures).
> This means about 4 KB more code for mscorlib and 24 KB for a mcs
> compile (we should investigate what's up with mcs, though: the number of
> class inits we insert seems excessive).
>
> The trampoline would instead be shared between all the types in
> both generics and AOT (and there is a single conditional branch
> in the whole process instead of hundreds scattered around, saving
> also on the needed branch predictor resources).
> Inlining the check also means introducing additional basic blocks,
> making the existing ones smaller, which can have other side effects on
> the quality of the generated code.
>
>
> lupus
>
> --
> -----------------------------------------------------------------
> lupus at debian.org                                     debian/rules
> lupus at ximian.com                             Monkeys do it better
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



More information about the Mono-devel-list mailing list