[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
construction of lists
Rob,
Given that allocators are going to have to be more complicated under
generational-gc, building lists out of successive calls to cons is
seriously sub-optimal. But allowing assembly routines to take a variable
number of arguments would be a pain.
I see two possible approaches. The first one is to have a several
fixed-arg assembly routines, list-2, list-3, list-4, list*-2, list*-3, etc.
There would be a compiler transform that would break calls to list up into
several calls to list* and one to list.
But that doesn't help %listify-rest-args. And having calls to list busted
up like that would result in strange source locations.
My second idea is to offer one assembly routine that translates make-list.
The list vop and %listify-rest-args would just call this assembly routine
with the correct number of cells, then iterate over the resultant list
storing the correct values in it. These stores would not have to be
entered in the write-list because there is no way one of the arguments
could be newer than the list (unless some bozo interrupts the filling loop
and uses some debugger command to change one of the values about to be
stored). You have to iterate down the list, because GC might move it for
you.
Well, comments?
-William