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

Paolo Molaro lupus at ximian.com
Mon Nov 19 13:25:19 EST 2007

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 at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better

More information about the Mono-devel-list mailing list