[Mono-dev] (Delegate) Trampoline executed twice?

Martin Däumler mdae at cs.tu-chemnitz.de
Tue Dec 7 07:13:59 EST 2010


On 07.12.10 10:54, Robert Jordan wrote:
> On 07.12.2010 08:52, Martin Däumler wrote:
>>
>> I expected a delegate trampoline to be executed only once
>> like "common" JIT trampolines for a single call instruction.
>> However, it might be executed twice.
>
> It could be related to the fact that the code behind
> Thread.Start () is eventually calling delegate's Invoke
> method via mono_runtime_invoke ().

Hello,

thank you for the answer. As you say, the delegate trampoline is
called a second time through mono_runtime_invoke(). So I want to
know if there might be other trampoline types that might be
called a second time.

A simple JIT trampoline patches the callsite so it is not possible
that this JIT trampoline is called from that memory address. But
obviously, this does not hold for delegate trampolines.

So, I want to know, if there are other trampoline types that might
be called a second time in that way?


With kind regards,
Martin Däumler


More information about the Mono-devel-list mailing list