summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2019-12-08 09:38:40 +0100
committerAndy Wingo <wingo@pobox.com>2019-12-10 17:11:36 +0100
commit7aad56105f2b8c7769bcf2e29c31c60e59ef2a03 (patch)
treebd59b4666a898d5029e32a3f212697768efb9e98
parent8d8c52dde9ac7212875a496c2165aa906ec84210 (diff)
downloadguile-7aad56105f2b8c7769bcf2e29c31c60e59ef2a03.tar.gz
Move assert-nargs-ee slow path out of line
* libguile/jit.c (compile_assert_nargs_ee) (compile_assert_nargs_ee_slow): Move slow path out of line.
-rw-r--r--libguile/jit.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/libguile/jit.c b/libguile/jit.c
index bc0d99456..5ad85b698 100644
--- a/libguile/jit.c
+++ b/libguile/jit.c
@@ -1917,22 +1917,17 @@ compile_throw_value_and_data_slow (scm_jit_state *j, uint32_t val,
static void
compile_assert_nargs_ee (scm_jit_state *j, uint32_t nlocals)
{
- jit_reloc_t k;
- jit_gpr_t t = T0;
- uint32_t saved_state = j->register_state;
-
- k = emit_branch_if_frame_locals_count_eq (j, t, nlocals);
- emit_store_current_ip (j, t);
- emit_call_1 (j, scm_vm_intrinsics.error_wrong_num_args,
- thread_operand ());
- jit_patch_here (j->jit, k);
+ add_slow_path_patch
+ (j, emit_branch_if_frame_locals_count_not_eq (j, T0, nlocals));
- j->register_state = saved_state;
j->frame_size_min = j->frame_size_max = nlocals;
}
static void
compile_assert_nargs_ee_slow (scm_jit_state *j, uint32_t nlocals)
{
+ emit_store_current_ip (j, T0);
+ emit_call_1 (j, scm_vm_intrinsics.error_wrong_num_args,
+ thread_operand ());
}
static void
@@ -2064,14 +2059,22 @@ static void
compile_assert_nargs_ee_locals (scm_jit_state *j, uint16_t expected,
uint16_t nlocals)
{
- compile_assert_nargs_ee (j, expected);
+ jit_gpr_t t = T0;
+
+ add_slow_path_patch
+ (j, emit_branch_if_frame_locals_count_not_eq (j, t, expected));
+
if (nlocals)
compile_alloc_frame (j, expected + nlocals);
+ j->frame_size_min = j->frame_size_max = expected + nlocals;
}
static void
compile_assert_nargs_ee_locals_slow (scm_jit_state *j, uint16_t expected,
uint16_t nlocals)
{
+ emit_store_current_ip (j, T0);
+ emit_call_1 (j, scm_vm_intrinsics.error_wrong_num_args,
+ thread_operand ());
}
static void