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

Zoltan Varga vargaz at gmail.com
Mon Nov 19 11:44:33 EST 2007


A simpler solution would be to emit the code below inline instead of
making a call
to a trampoline at all.


>         deref vtable->initialized
>         compare/and
>         ret
>         branch to icall
> so basically just 4-5 instructions executed in the common case instead
> of all the cost of going to unmanaged and back.
> There is an alternative solution which we could implement as well,
> though this requires one additional pointer per MonoVTable.
> When the MonoVTable is created this pointer is set to the icall and once
> the type is initialized it is set to a tiny function that just does:
>         ret
> With this the initialization becomes a memory dereference and an
> indirect call+ret. The runtime cost is similar to the above solution
> (in AOT code we'd even avoid a PLT call), but it has the additional
> memory overhead.
> Other suggestions for optimizing this codepath are welcome as well.
> 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