diff options
author | Andy Wingo <wingo@pobox.com> | 2019-12-07 22:54:32 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2019-12-09 22:03:34 +0100 |
commit | 4a6a7e15d619c5cc2d0990ffd1da0f737586fa73 (patch) | |
tree | 8a92c43dbd03cf4414479f586a64f00e4ededdd9 /libguile/vm-engine.c | |
parent | 70ad8a2e728417cf524eede9dafa0c979cafda55 (diff) | |
download | guile-4a6a7e15d619c5cc2d0990ffd1da0f737586fa73.tar.gz |
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.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r-- | libguile/vm-engine.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c index 8c42ecee5..a57a8ccc6 100644 --- a/libguile/vm-engine.c +++ b/libguile/vm-engine.c @@ -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); \ |