Implement variadic C func calls

This commit is contained in:
Takashi Kokubun 2023-02-10 22:07:34 -08:00
parent e111d3ae8d
commit 39b7874481
Notes: git 2023-03-06 07:30:07 +00:00
3 changed files with 21 additions and 18 deletions

View file

@ -3,8 +3,9 @@ module RubyVM::MJIT
# 32-bit memory access
class DwordPtr < Data.define(:reg, :disp); end
# C call argument registers
C_ARG_OPNDS = [:rdi, :rsi, :rdx, :rcx, :r8, :r9]
# SystemV x64 calling convention
C_ARGS = [:rdi, :rsi, :rdx, :rcx, :r8, :r9]
C_RET = :rax
# https://www.intel.com/content/dam/develop/public/us/en/documents/325383-sdm-vol-2abcd.pdf
# Mostly an x86_64 assembler, but this also has some stuff that is useful for any architecture.