C++/i86 thunk patch

Nathan Sidwell nathan@acm.org
Mon Jul 15 09:04:00 GMT 2002


Mark Mitchell wrote:

> You can also have your existing thunk code do a jump to subroutine,
> instead of a jump, at the end.  Then, when the subroutine returns
> you adjust the returned value and return yourself.
ah, that's what I thought - until I started to implement it and had
to decide where to store the return address! You can't push it
on the stack, as that'll change the layout of stack parms as seen
by the thunked fn. You can't memmove the parms down and put it at
the top, because you don't know where the end is for a varadic func.

> Of course, a multiple entry point implementation would be more
> efficient.  Zack is working on making multiple entry point support
> a bit more full-fledged, which will facilitate this down the road.
great!

nathan

-- 
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
           The voices in my head told me to say this
nathan@acm.org  http://www.cs.bris.ac.uk/~nathan/  nathan@cs.bris.ac.uk



More information about the Gcc-patches mailing list