[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 14/17: Move allocate-words/immediate slow path out of li
From: |
Andy Wingo |
Subject: |
[Guile-commits] 14/17: Move allocate-words/immediate slow path out of line |
Date: |
Wed, 11 Dec 2019 03:47:51 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit f1578c98b220388e8222dfc21b94e92636c0297e
Author: Andy Wingo <address@hidden>
Date: Tue Dec 10 22:33:47 2019 +0100
Move allocate-words/immediate slow path out of line
* libguile/jit.c (compile_allocate_words_immediate)
(compile_allocate_words_immediate_slow): Move slow path out of line.
---
libguile/jit.c | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/libguile/jit.c b/libguile/jit.c
index 1908f11..04d515f 100644
--- a/libguile/jit.c
+++ b/libguile/jit.c
@@ -2252,27 +2252,34 @@ compile_allocate_words_immediate (scm_jit_state *j,
uint16_t dst, uint16_t nword
ptrdiff_t offset = offsetof(struct scm_thread, 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_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_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_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
- [Guile-commits] branch master updated (4a6a7e1 -> 114198d), Andy Wingo, 2019/12/11
- [Guile-commits] 02/17: Move add/immediate, sub/immediate slow paths out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 03/17: Move add, sub slow paths out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 04/17: Move handle-interrupts slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 10/17: Add subr-call out-of-line slow path, Andy Wingo, 2019/12/11
- [Guile-commits] 09/17: Move alloc-frame slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 13/17: Move assert-nargs-le slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 14/17: Move allocate-words/immediate slow path out of line,
Andy Wingo <=
- [Guile-commits] 05/17: Move receive slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 07/17: Move assert-nargs-ee slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 06/17: Move receive-values slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 08/17: Move assert-nargs-ge slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 11/17: Add out-of-line slow path for compose-continuation, Andy Wingo, 2019/12/11
- [Guile-commits] 12/17: Add out-of-line slow path for abort, Andy Wingo, 2019/12/11
- [Guile-commits] 15/17: Move allocate-pointerless-words/immediate slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 01/17: Add infrastructure for out-of-line JIT compilation of slow paths, Andy Wingo, 2019/12/11
- [Guile-commits] 17/17: Move less? slow path out of line, Andy Wingo, 2019/12/11
- [Guile-commits] 16/17: Add fixnum fast-path for =, Andy Wingo, 2019/12/11