MCPcopy Create free account
hub / github.com/WheretIB/nullc / GenCodeCmdCallProlog

Function GenCodeCmdCallProlog

NULLC/CodeGen_X86.cpp:1928–1969  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1926
1927
1928void GenCodeCmdCallProlog(VMCmd cmd)
1929{
1930 if(cmd.helper & bitRetSimple)
1931 {
1932 if((asmOperType)(cmd.helper & 0x0FFF) == OTYPE_INT)
1933 {
1934 EMIT_OP_REG(o_push, rEAX);
1935 }else{ // double or long
1936 EMIT_OP_REG(o_push, rEAX);
1937 EMIT_OP_REG(o_push, rEDX);
1938 }
1939 }else{
1940 assert(cmd.helper % 4 == 0);
1941 if(cmd.helper == 4)
1942 {
1943 EMIT_OP_REG(o_push, rEAX);
1944 }else if(cmd.helper == 8){
1945 EMIT_OP_REG(o_push, rEAX);
1946 EMIT_OP_REG(o_push, rEDX);
1947 }else if(cmd.helper == 12){
1948 EMIT_OP_REG(o_push, rEAX);
1949 EMIT_OP_REG(o_push, rEDX);
1950 EMIT_OP_REG(o_push, rECX);
1951 }else if(cmd.helper == 16){
1952 EMIT_OP_REG(o_push, rEAX);
1953 EMIT_OP_REG(o_push, rEDX);
1954 EMIT_OP_REG(o_push, rECX);
1955 EMIT_OP_REG(o_push, rEBX);
1956 }else if(cmd.helper > 16){
1957 EMIT_OP_REG_NUM(o_sub, rESP, cmd.helper);
1958
1959 EMIT_OP_REG_REG(o_mov, rEBX, rEDI);
1960
1961 EMIT_OP_REG_RPTR(o_lea, rESI, sNONE, rEAX, paramBase);
1962 EMIT_OP_REG_REG(o_mov, rEDI, rESP);
1963 EMIT_OP_REG_NUM(o_mov, rECX, cmd.helper >> 2);
1964 EMIT_OP(o_rep_movsd);
1965
1966 EMIT_OP_REG_REG(o_mov, rEDI, rEBX);
1967 }
1968 }
1969}
1970
1971void GenCodeCmdCall(VMCmd cmd)
1972{

Callers 2

GenCodeCmdCallFunction · 0.85
GenCodeCmdCallPtrFunction · 0.85

Calls 6

EMIT_OP_REGFunction · 0.85
assertFunction · 0.85
EMIT_OP_REG_NUMFunction · 0.85
EMIT_OP_REG_REGFunction · 0.85
EMIT_OP_REG_RPTRFunction · 0.85
EMIT_OPFunction · 0.85

Tested by

no test coverage detected