This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: Interface dispatch table optimization
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: java-patches at gcc dot gnu dot org
- Date: Thu, 09 Feb 2006 10:59:53 -0500
- Subject: Re: Patch: Interface dispatch table optimization
- References: <200602091558.k19FwT3j029875@earth.phy.uc.edu>
Andrew Pinski wrote:
It turns out that we can allocate interface dispatch (jclass->idt)
tables as a single struct, rather than a struct that contains a pointer
to another table. This means that only one idt allocation is required
for each class/interface, and _Jv_AllocBytes can be used to reduce the
memory that needs to be scanned by the GC.
In addition, this means that two less pointer dereferences are required
for every interface call!
I'm going to test this a bit more, then check it in to trunk.
Bryce
-static _Jv_IDispatchTable null_idt = { {SHRT_MAX, 0, NULL} };
+static _Jv_IDispatchTable null_idt = { {SHRT_MAX, 0, {}} };
I cannot remember if {} is valid C++, I think it is but I am not sure.
I know it is invalid C.
Is there an alternative? It seems to accept it without any complaints.
Bryce