*byte) TEXT ·callJava(SB), 0, $96-16 NO_LOCAL_POINTERS MOVQ code+8(FP), CX JCALL(CX) RET gocall: CALL CX JMP -8(BP) Saves following RET inst addr and Jumps to CX (see next slide)
since Go has no real RIP-relative // addressing mode. #define JCALL(fnreg) \ BYTE $0x48; … 8d0509000000 \ // Lea MOVQ AX, (SI) \ // Store RET addr ADDQ $16, SI \ // Move to next slot JMP fnreg // Run JIT code
its code into the old executable buffer, method address will change... This requires re-linking all method callers. If calls were inlined it’s even harder.