[armedbear-devel] Inline primitives as static method calls

logicmoo at gmail.com logicmoo at gmail.com
Tue Nov 10 08:01:14 UTC 2009

Excellent Work!

Your .patch is what I meant.

> when compiled it is translated as a direct call to the static
> method, without passing through the symbol, which is faster than now
Perfect - Yeah

A Side note:
> When interpreted or passed as a higher-order function an
> InlinedPrimitive calls the static method through reflection, resulting
> in slower performance than now.

I wrote a workaround for this into LarKC because of the performance degradation.

So later on....
Like after we have everything working/vetted calling static inlines as much as possible.
And using InlinePrimtives to call reflection...

We'll have some options like: "FixedArityFunctor":


What I did was created a new Class via ASM that contains a single execute(a,b,c,d,e,f) signature per "args used".
That simply calls the static method .

So in InlinePrimitive later suplimented with some extras like:

//The  methodWith0Args - methodWithNArgs is what that .java url above generates.
LispObject execute() {
   return methodWith0Args.evaluate();
LispObject execute(LispObject a0) {
   return methodWith1Args.evaluate(a0);
LispObject execute(LispObject a0,LispObject a1) {
   return methodWith2Args.evaluate(a0,a1);

Figured I should mention the "FixedArityFunctor" so we dont get scared off by any performance
degration of higher level calls before we learn all the benefits of inlining static functions!

More information about the armedbear-devel mailing list