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

2007-11-20 Thread Paolo Molaro
On 11/19/07 Zoltan Varga wrote: 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. No, here is again

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

2007-11-20 Thread Zoltan Varga
Hi, I was referring to Mark's code which does have a managed-to-unmanaged transition. Your approach looks fine to me. Zoltan On Nov 20, 2007 10:34 AM, Paolo Molaro [EMAIL PROTECTED] wrote: On 11/19/07 Zoltan Varga wrote: The problem with the trampoline is that since the class

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

2007-11-20 Thread Mark Probst
Hi! I was referring to Mark's code which does have a managed-to-unmanaged transition. Your approach looks fine to me. The managed-to-unmanaged transition is always there to init the class, it's just that my code doesn't have the fast path (check if class inited and return immediately if it

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

2007-11-19 Thread Mark Probst
Hey! I don't really understand why a new trampoline is needed here. Since the argument to the trampoline is dynamic, it is not possible to patch the caller code, so a normal call to mono_runtime_class_init () would be sufficient. To be honest, I don't see any reason why we shouldn't use

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

2007-11-19 Thread Paolo Molaro
On 11/19/07 Mark Probst wrote: I don't really understand why a new trampoline is needed here. Since the argument to the trampoline is dynamic, it is not possible to patch the caller code, so a normal call to mono_runtime_class_init () would be sufficient. To be honest, I don't see

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

2007-11-19 Thread Zoltan Varga
Hi, A simpler solution would be to emit the code below inline instead of making a call to a trampoline at all. Zoltan deref vtable-initialized compare/and ret branch to icall so basically just 4-5 instructions

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

2007-11-19 Thread Paolo Molaro
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).

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

2007-11-19 Thread Zoltan Varga
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

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

2007-11-16 Thread Mark Probst
Hey everybody! Paolo asked me to post my generic sharing patches here so that more people can take a look at them before they are committed. Here's the next one in line: static field access. The main part of this patch is actually the introduction of a new trampoline call to initialize a

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

2007-11-16 Thread Zoltan Varga
Hi, I don't really understand why a new trampoline is needed here. Since the argument to the trampoline is dynamic, it is not possible to patch the caller code, so a normal call to mono_runtime_class_init () would be sufficient.