This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


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

Re: librep's indirect threaded bytecode interpretter


"Jorgen 'forcer' Schaefer" <forcer@mindless.com> writes:

> support for variable-length functions, etc.

Not a problem.  In the case of optional parameters, I generate one
Java method for each argument length.  One method contains the real
procedure body, the rest are stubs that call the former.  By calling
the virtual "apply" method, the right method gets gets called, which
evalutes the needed default expressions.  If there are at most 4
parameters, this is done without creating any extra objects, which I'm
sure is more efficient than Guile.

If there are more than 4 parameters, or if the procedure has an
unbounded parameter length limit (#!rest rather than #!optional, or
uses the standard Scheme 'dot'-notation), then either a Java array
or a Scheme list is created.  (By default a Java array is allocated,
but if the called procedure is known and expects a list, then
the compiler will generate code to create a list.)
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

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