diff options
Diffstat (limited to 'py/asmx64.c')
-rw-r--r-- | py/asmx64.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/py/asmx64.c b/py/asmx64.c index 59c8113bc4..ca461e0c2e 100644 --- a/py/asmx64.c +++ b/py/asmx64.c @@ -113,7 +113,8 @@ asm_x64_t* asm_x64_new() { void asm_x64_free(asm_x64_t* as, bool free_code) { if (free_code) { - m_free(as->code_base); + // need to un-mmap + //m_free(as->code_base); } /* if (as->label != NULL) { @@ -154,6 +155,8 @@ void asm_x64_end_pass(asm_x64_t *as) { // calculate size of code in bytes as->code_size = as->code_offset; as->code_base = m_new(byte, as->code_size); + //uint actual_alloc; + //as->code_base = alloc_mem(as->code_size, &actual_alloc, true); printf("code_size: %u\n", as->code_size); } @@ -611,11 +614,12 @@ void asm_x64_call_i1(asm_x64_t* as, void* func, int i1) */ void asm_x64_call_ind(asm_x64_t* as, void *ptr, int temp_r64) { - /* asm_x64_mov_i64_to_r64_optimised(as, (int64_t)ptr, temp_r64); asm_x64_write_byte_2(as, OPCODE_CALL_RM32, MODRM_R64(2) | MODRM_RM_REG | MODRM_RM_R64(temp_r64)); - */ // this reduces code size by 2 bytes per call, but doesn't seem to speed it up at all + // doesn't work anymore because calls are 64 bits away + /* asm_x64_write_byte_1(as, OPCODE_CALL_REL32); asm_x64_write_word32(as, ptr - (void*)(as->code_base + as->code_offset + 4)); + */ } |