Another option would be to put the responsibility of popping the frame on the caller. But that would probably screw things up...
Hmm, when I read my copy of an early pike 7.4, it seems that this is how it used to work whenever the function call originated from mega_apply(). Tail recursion would cause F_RETURN to free the frame, but in a tailrecursion call there would always be at least one more reference to the current program, so that shouldn't be a problem.
I assume this has changed? (Too lazy to read the new source right now...)
/ Fredrik (Naranek) Hubinette (Real Build Master)
Previous text:
2003-08-08 00:01: Subject: Machine code efficiency
Another option would be to put the responsibility of popping the frame on the caller. But that would probably screw things up...
Hmm, I haven't looked at the source in a while, but just where does an F_RETURN jump to? Shouldn't F_RETURN just do a return? Ie, shouldn't F_RETURN be compiled as:
jmp F_RETURN
instead of
jsr F_RETURN jmp *%eax
?
/ Fredrik (Naranek) Hubinette (Real Build Master)