Re: method calls and extra indirection
Rhys Weatherley <[email protected]>
| Newsgroups | gmane.comp.gnu.dotgnu.developer |
|---|---|
| Organization | Southern Storm Software, Pty Ltd |
| Message-ID | <[email protected]> |
On Friday 02 April 2004 01:23 am, Gomi Kapoor wrote: > I am using the current release 0.6.4 > I read the pnet/engine/HACKING file and then tried to > look for the same in the code. I'll try to remember to fix that, as it is out of date. You should always check the code as well, because sometimes I forget to update the HACKING file to reflect the current situation. The instructions are very well documented in the code. > OK, so can we say there is an always an indirection > overhead for every method call? The "call" instruction takes a pointer to an ILMethod control block, which in turn contains the pointer to the start of the converted method code. So yes, an indirection is always required. However, you should not assume that just because an indirection is required that it is therefore slow. The vast majority of the method call overhead is involved in setting up the new stack frame. Fetching the method code pointer is a very small part of the total time needed. If you wish to optimize method calls, you should look at the frame setup overhead. Eliminating the need to save even one field in "ILCallFrame" would impact performance much more than fancy back-patching schemes on the "call" instruction. Cheers, Rhys.