• Russ Cox's avatar
    cmd/gc: move genembedtramp into portable code · 1f51d279
    Russ Cox authored
    Requires adding new linker instruction
            RET	f(SB)
    meaning return but then immediately call f.
    This is what you'd use to implement a tail call after
    fiddling with the arguments, but the compiler only
    uses it in genwrapper.
    
    This CL eliminates the copy-and-paste genembedtramp
    functions from 5g/8g/6g and makes the code run on ARM
    for the first time. It removes a small special case for function
    generation, which should help Carl a bit, but at the same time
    it does not bother to implement general tail call optimization,
    which we do not want anyway.
    
    Fixes #5627.
    
    R=ken2
    CC=golang-dev
    https://golang.org/cl/10057044
    1f51d279
order.c 6.26 KB