This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Interface dispatch table optimization


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]