1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 23:50:19 +02:00

Remove vm->sp_min_since_gc

* libguile/jit.c (emit_alloc_frame_for_sp):
* libguile/vm-engine.c (ALLOC_FRAME, RESET_FRAME):
* libguile/vm.c (vm_increase_sp, scm_i_vm_prepare_stack):
  (return_unused_stack_to_os, vm_expand_stack, alloc_frame):
  (scm_call_with_stack_overflow_handler):
* libguile/vm.h (struct scm_vm): Remove sp_min_since_gc handling.  It
  was a very minor optimization when it was centralized in vm.c, but now
  with JIT it's causing too much duplicate code generation.
This commit is contained in:
Andy Wingo 2019-12-07 22:54:32 +01:00
parent 70ad8a2e72
commit 4a6a7e15d6
4 changed files with 13 additions and 50 deletions

View file

@ -176,16 +176,11 @@
#define ALLOC_FRAME(n) \
do { \
sp = VP->fp - (n); \
if (sp < VP->sp_min_since_gc) \
if (SCM_UNLIKELY (sp < VP->stack_limit)) \
{ \
if (SCM_UNLIKELY (sp < VP->stack_limit)) \
{ \
SYNC_IP (); \
CALL_INTRINSIC (expand_stack, (thread, sp)); \
CACHE_SP (); \
} \
else \
VP->sp_min_since_gc = VP->sp = sp; \
SYNC_IP (); \
CALL_INTRINSIC (expand_stack, (thread, sp)); \
CACHE_SP (); \
} \
else \
VP->sp = sp; \
@ -195,12 +190,7 @@
stack expansion is needed. Note that in some cases this may lower
SP, e.g. after a return but where there are more locals below, but we
know it was preceded by an alloc-frame in that case, so no stack need
be allocated.
As an optimization, we don't update sp_min_since_gc in this case; the
principal place stacks are expanded is in ALLOC_FRAME. it doesn't
need to strictly be the min since GC, as it's just an optimization to
prevent passing too-large of a range to madvise. */
be allocated. */
#define RESET_FRAME(n) \
do { \
VP->sp = sp = VP->fp - (n); \