4 ms·
Here seems to be the ABI, but I am not sure it is the right one and I am not sure if there are not different ABIs around. https://go.googlesource.com/go/+/refs
by uecker 23d ago
Here seems to be the ABI, but I am not sure it is the right one and I am not sure if there are not different ABIs around. https://go.googlesource.com/go/+/refs/heads/dev.regabi/src/cmd/compile/internal-abi.md https://go.googlesource.com/go/+/refs/heads/dev.regabi/src/c...
"Closure calls follow the same conventions as static function and method calls, with one addition. Each architecture specifies a closure context pointer register and calls to closures store the address of the closure object in the closure context pointer register prior to the call."
In any case, the documented use of __builtin_call_with_static_chain in GCC and Clang is to be able to call closures of other languages, and for GCC Go is explicitly mentioned.
GCC: https://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html https://gcc.gnu.org/onlinedocs/gcc/Constructing-Calls.html
"This built-in can be used to call Go closures from C, .."
https://clang.llvm.org/docs/LanguageExtensions.html https://clang.llvm.org/docs/LanguageExtensions.html
"... as used by some language to implement closures or nested functions."
Yes, it is true that I completely fail to understand the opposition to this.
- deleted 22d ago[deleted]