[Mono-devel-list] [PATCH] Remove static and non-virtual methods from the VTable

Ben Maurer bmaurer at users.sourceforge.net
Sat Mar 13 00:12:02 EST 2004


Hello,

I decided to tackle one of the Mono TODO items on the website. The
following patch addresses the first TODO item, Optimize method vtable.

A change log (for miguel ;-):

* class.c : do not include static or non-virtual methods in the vtable.
* icall.c, mono-debug-debugger.c: when checking if a search has already
found an overriden version of a method, we may encounter a method with a
->slot of -1, because it is not in the vtable. However, we know that
such a method can't be overriden, so we do not need to insert it in the
hashtable.
* object.c : Account for the fact that some methods dont have a vtable
slot.

I was able to do a bootstrap with this patch in place.

Before the patch, when bootstrapping MCS the vtable size was 120924.
With the patch applied, the vtable size is 45604. So, this is a 2/3
improvement. (you can get this number by running make ctest
RUNTIME="mono --stats" in mcs/mcs).

-- Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: metadata-small-vtable.patch
Type: text/x-patch
Size: 3568 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040313/b954588c/attachment.bin 


More information about the Mono-devel-list mailing list