summaryrefslogtreecommitdiff
path: root/libguile/jit.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2019-06-06 17:39:53 +0200
committerAndy Wingo <wingo@pobox.com>2019-06-06 17:39:53 +0200
commitf07fadc72e148d13bb4b42a3d9ecde6ab7a2296c (patch)
treea63fdbad6a8e8d007ff4f0f44d0586dc3caf2a1a /libguile/jit.c
parentc86758c298fdd06456939d16d604f9ff9a6c7b10 (diff)
downloadguile-f07fadc72e148d13bb4b42a3d9ecde6ab7a2296c.tar.gz
VM does not initialize stack frames
* libguile/jit.c (compile_alloc_frame): Stop initializing locals. (compile_bind_rest): Use emit_alloc_frame. * libguile/vm-engine.c (assert_nargs_ee_locals, allocate_frame): Don't initialize locals. (bind_rest): Don't initialize locals, and assert that the locals count has a minimum.
Diffstat (limited to 'libguile/jit.c')
-rw-r--r--libguile/jit.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/libguile/jit.c b/libguile/jit.c
index 6e9273017..ed95ba5d2 100644
--- a/libguile/jit.c
+++ b/libguile/jit.c
@@ -1851,38 +1851,8 @@ compile_assert_nargs_le (scm_jit_state *j, uint32_t nlocals)
static void
compile_alloc_frame (scm_jit_state *j, uint32_t nlocals)
{
- jit_gpr_t t = T0, saved_frame_size = T1_PRESERVED;
-
- if (j->frame_size_min != j->frame_size_max)
- jit_subr (j->jit, saved_frame_size, FP, SP);
-
/* This will clear the regalloc, so no need to track clobbers. */
- emit_alloc_frame (j, t, nlocals);
-
- if (j->frame_size_min == j->frame_size_max)
- {
- int32_t slots = nlocals - j->frame_size_min;
-
- if (slots > 0)
- {
- jit_movi (j->jit, t, SCM_UNPACK (SCM_UNDEFINED));
- while (slots-- > 0)
- emit_sp_set_scm (j, slots, t);
- }
- }
- else
- {
- jit_gpr_t walk = saved_frame_size;
-
- jit_subr (j->jit, walk, FP, saved_frame_size);
- jit_reloc_t k = jit_bler (j->jit, walk, SP);
- jit_movi (j->jit, t, SCM_UNPACK (SCM_UNDEFINED));
- void *head = jit_address (j->jit);
- jit_subi (j->jit, walk, walk, sizeof (union scm_vm_stack_element));
- jit_str (j->jit, walk, t);
- jit_patch_there (j->jit, jit_bner (j->jit, walk, SP), head);
- jit_patch_here (j->jit, k);
- }
+ emit_alloc_frame (j, T0, nlocals);
j->frame_size_min = j->frame_size_max = nlocals;
}
@@ -2007,7 +1977,7 @@ compile_bind_rest (scm_jit_state *j, uint32_t dst)
cons = emit_branch_if_frame_locals_count_greater_than (j, t, dst);
- compile_alloc_frame (j, dst + 1);
+ emit_alloc_frame (j, t, dst + 1);
emit_movi (j, t, SCM_UNPACK (SCM_EOL));
emit_sp_set_scm (j, 0, t);
k = jit_jmp (j->jit);