On 2010-12-30, at 8:16 AM, Roman Marynchak wrote:
> It would be nice to remove other magic numbers from the patch as well. I
> have seen several "4" hardcoded in the patch (mostly in SB-VM part of it).
> It looks like the 32-bit pointer size, but this is not a justification.
> In general (not in this patch), magic numbers are quite common in SBCL's
> SB-VM code, and this is a problem. When I look at this code from call.lisp,
> I wonder why don't we name the things properly?
> (+ (if named 5 0)
> (if variable 19 1)
> (if (eq return :tail) 0 10)
> (if (eq return :unknown) 25 0))
I don't even have to look at the source to tell that this is computing a VOP's cost. Those are currently almost arbitrary, except for the total order between equally applicable VOPs. Frankly, I have no idea how one would give a name to these value, except for the obvious name from the condition they depend on.