[Mono-dev] IMT patch

Paolo Molaro lupus at ximian.com
Fri Jun 1 12:17:08 EDT 2007


On 05/31/07 Rodrigo Kumpera wrote:
> Do you have any measurements of the collision rates the hash function
> generates over corlib? This should provide enough data to verify the hash
> quality. If collision is too bad, you could store the IMT slot in MonoMethod
> and do slot distribution when the interface is loaded.

We won't store the imt slot in MonoMethod, because it would be an
additional field and waste memory for something seldomly used. Besides
it's cheap to calculate the hash and that happens only in
non-performance critical codepaths.

> You are using indirect absolute jmps over the vtable pointer, which is
> slower than relative jmps. The code could check if the target method is
> already compiled and issue a relative jump directly. The compile trampolines
> could patch the thunks, but this could end been really tricky.

We used the indirect jumps to avoid having to patch the thunks
(which would required either to decode the instructions or to keep
additional info in memory).

> How fast is the hash function? Shouldn't the IMT slot be cached in
> MonoMethod?

See above, it doesn't matter if the hash is slow and using more runtime
memory is a bigger issue.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list