asm_trampoline.S 776 B

12345678910111213141516171819202122232425262728
  1. .text
  2. .globl _Py_trampoline_func_start
  3. # The following assembly is equivalent to:
  4. # PyObject *
  5. # trampoline(PyThreadState *ts, _PyInterpreterFrame *f,
  6. # int throwflag, py_evaluator evaluator)
  7. # {
  8. # return evaluator(ts, f, throwflag);
  9. # }
  10. _Py_trampoline_func_start:
  11. #ifdef __x86_64__
  12. sub $8, %rsp
  13. call *%rcx
  14. add $8, %rsp
  15. ret
  16. #endif // __x86_64__
  17. #if defined(__aarch64__) && defined(__AARCH64EL__) && !defined(__ILP32__)
  18. // ARM64 little endian, 64bit ABI
  19. // generate with aarch64-linux-gnu-gcc 12.1
  20. stp x29, x30, [sp, -16]!
  21. mov x29, sp
  22. blr x3
  23. ldp x29, x30, [sp], 16
  24. ret
  25. #endif
  26. .globl _Py_trampoline_func_end
  27. _Py_trampoline_func_end:
  28. .section .note.GNU-stack,"",@progbits