diff options
author | Andy Wingo <wingo@pobox.com> | 2019-12-10 22:38:45 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2019-12-10 22:38:45 +0100 |
commit | 6b335506ef3e2f903e3ff3839d7370e7bbea490b (patch) | |
tree | d7364fbcb3811b077ee0487f495b386f1064feed /libguile/jit.c | |
parent | f1578c98b220388e8222dfc21b94e92636c0297e (diff) | |
download | guile-6b335506ef3e2f903e3ff3839d7370e7bbea490b.tar.gz |
Move allocate-pointerless-words/immediate slow path out of line
* libguile/jit.c (compile_allocate_pointerless_words_immediate)
(compile_allocate_pointerless_words_immediate_slow): Move slow path
out of line.
Diffstat (limited to 'libguile/jit.c')
-rw-r--r-- | libguile/jit.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/libguile/jit.c b/libguile/jit.c index 04d515f30..6f2d41176 100644 --- a/libguile/jit.c +++ b/libguile/jit.c @@ -2321,27 +2321,34 @@ compile_allocate_pointerless_words_immediate (scm_jit_state *j, uint16_t dst, ui ptrdiff_t offset = offsetof(struct scm_thread, pointerless_freelists); offset += idx * sizeof(void*); emit_ldxi (j, res, THREAD, offset); - jit_reloc_t fast = jit_bnei (j->jit, res, 0); - emit_store_current_ip (j, res); - emit_call_2 (j, scm_vm_intrinsics.allocate_pointerless_words_with_freelist, - thread_operand (), - jit_operand_imm (JIT_OPERAND_ABI_WORD, idx)); - emit_retval (j, res); - emit_reload_sp (j); - jit_reloc_t done = jit_jmp (j->jit); - - jit_patch_here (j->jit, fast); + add_slow_path_patch (j, jit_beqi (j->jit, res, 0)); jit_gpr_t new_freelist = T1; emit_ldr (j, new_freelist, res); jit_stxi (j->jit, offset, THREAD, new_freelist); - - jit_patch_here (j->jit, done); emit_sp_set_scm (j, dst, res); } } static void compile_allocate_pointerless_words_immediate_slow (scm_jit_state *j, uint16_t dst, uint16_t nwords) { + size_t bytes = nwords * sizeof(SCM); + size_t idx = scm_inline_gc_bytes_to_freelist_index (bytes); + + if (SCM_UNLIKELY (idx >= SCM_INLINE_GC_FREELIST_COUNT)) + { + } + else + { + jit_gpr_t res = T0; + emit_store_current_ip (j, res); + emit_call_2 (j, scm_vm_intrinsics.allocate_pointerless_words_with_freelist, + thread_operand (), + jit_operand_imm (JIT_OPERAND_ABI_WORD, idx)); + emit_retval (j, res); + emit_reload_sp (j); + emit_sp_set_scm (j, dst, res); + continue_after_slow_path (j, j->next_ip); + } } static void |