[Stackless] Ann: Stackless Python (Linux x86 issues)

Christian Häggström c00chm at cs.umu.se
Sat Jan 19 20:06:47 CET 2002

> >>Seems like this could run into trouble with an optimizing
> >>compiler...
> >>
> >
> >There may well be a conflict, but it's confined to one C 
> >call, (and one that probably defies most optimizations 
> >anyway). As Tim pointed out in an off-list email, there's
> >deep magic required on platforms that have specialized
> >HW stacks (he used ICON on SPARK as an example).
> Yes, but I don't intend to switch to a different stack,
> I just modify some entries and the stack pointer, nothing
> else than the C compiler does. How can this be so complicated?

I have tried to do the same thing once, but I got problems, the compiler
(gcc for i386) assumes that the stack pointer does not change during
a function call.
For example, the function prologue/epilogue thing to help debugging:

    pushl   %ebp
    movl    %esp, %ebp
	...function body code...
	movl    %ebp, %esp
	pop     %ebp

will break the whole thing, because a copy of stack-pointer was stored on the
stack and then restored.

With the flag -fomit-frame-pointer I have been able to do limited
things, however things like alloca (dynamic stack-allocation) may complicate
things further.

On Linux the stack segment is the same as data segments, but that may
not be true on all operating systems. (but that's easy to workaround)

Btw, I have also only used continuation.caller()

Thanks for bringing up this discussion / Christian Häggström
Stackless mailing list
Stackless at www.tismer.com

More information about the Stackless mailing list