summaryrefslogtreecommitdiff
path: root/py/asmx86.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2018-10-13 13:59:19 +1100
committerDamien George <damien.p.george@gmail.com>2018-10-13 15:16:33 +1100
commit355eb8eafb1a0b0e096cd452d1107ab45bbf72c4 (patch)
treeb79f788c6347514d43c78f91e21ebdd7e31365f4 /py/asmx86.h
parentb7c6f859d06a3a4270f98561827ba5ae360fee74 (diff)
py/asmx86: Change indirect calls to load fun ptr from the native table.
Instead of storing the function pointer directly in the assembly code. This makes the generated code more independent of the runtime (so easier to relocate the code), and reduces the generated code size.
Diffstat (limited to 'py/asmx86.h')
-rw-r--r--py/asmx86.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/py/asmx86.h b/py/asmx86.h
index 15518d98c..a5535b548 100644
--- a/py/asmx86.h
+++ b/py/asmx86.h
@@ -112,7 +112,7 @@ void asm_x86_mov_local_to_r32(asm_x86_t* as, int src_local_num, int dest_r32);
void asm_x86_mov_r32_to_local(asm_x86_t* as, int src_r32, int dest_local_num);
void asm_x86_mov_local_addr_to_r32(asm_x86_t* as, int local_num, int dest_r32);
void asm_x86_mov_reg_pcrel(asm_x86_t *as, int dest_r64, mp_uint_t label);
-void asm_x86_call_ind(asm_x86_t* as, void* ptr, mp_uint_t n_args, int temp_r32);
+void asm_x86_call_ind(asm_x86_t* as, size_t fun_id, mp_uint_t n_args, int temp_r32);
#if GENERIC_ASM_API
@@ -169,7 +169,7 @@ void asm_x86_call_ind(asm_x86_t* as, void* ptr, mp_uint_t n_args, int temp_r32);
asm_x86_jcc_label(as, ASM_X86_CC_JE, label); \
} while (0)
#define ASM_JUMP_REG(as, reg) asm_x86_jmp_reg((as), (reg))
-#define ASM_CALL_IND(as, ptr, idx) asm_x86_call_ind(as, ptr, mp_f_n_args[idx], ASM_X86_REG_EAX)
+#define ASM_CALL_IND(as, ptr, idx) asm_x86_call_ind(as, idx, mp_f_n_args[idx], ASM_X86_REG_EAX)
#define ASM_MOV_LOCAL_REG(as, local_num, reg_src) asm_x86_mov_r32_to_local((as), (reg_src), (local_num))
#define ASM_MOV_REG_IMM(as, reg_dest, imm) asm_x86_mov_i32_to_r32((as), (imm), (reg_dest))