[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 01/13: Minor optimization in RESET_FRAME
From: |
Andy Wingo |
Subject: |
[Guile-commits] 01/13: Minor optimization in RESET_FRAME |
Date: |
Sun, 19 Aug 2018 04:44:15 -0400 (EDT) |
wingo pushed a commit to branch lightning
in repository guile.
commit b7dbc7251f4cf58dbaeb8cff9229f325680690fd
Author: Andy Wingo <address@hidden>
Date: Wed Aug 8 14:48:32 2018 +0200
Minor optimization in RESET_FRAME
* libguile/vm-engine.c (RESET_FRAME): Remove update of sp_min_since_gc.
---
libguile/vm-engine.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 41b62bb..65342b6 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -192,12 +192,18 @@
} while (0)
/* Reset the current frame to hold N locals. Used when we know that no
- stack expansion is needed. */
+ 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. */
#define RESET_FRAME(n) \
do { \
VP->sp = sp = VP->fp - (n); \
- if (sp < VP->sp_min_since_gc) \
- VP->sp_min_since_gc = sp; \
} while (0)
/* Compute the number of locals in the frame. At a call, this is equal
- [Guile-commits] branch lightning updated (0d00164 -> 3827769), Andy Wingo, 2018/08/19
- [Guile-commits] 01/13: Minor optimization in RESET_FRAME,
Andy Wingo <=
- [Guile-commits] 04/13: Add unpack-values-object intrinsic, Andy Wingo, 2018/08/19
- [Guile-commits] 03/13: Change call/cc inst to capture-continuation, Andy Wingo, 2018/08/19
- [Guile-commits] 09/13: Update error-wrong-num-args intrinsic prototype, Andy Wingo, 2018/08/19
- [Guile-commits] 02/13: Rework program->ip mapping in VM to always call intrinsic, Andy Wingo, 2018/08/19
- [Guile-commits] 12/13: Define intrinsics for atomic ops, Andy Wingo, 2018/08/19
- [Guile-commits] 07/13: Continuations capture machine code address, Andy Wingo, 2018/08/19
- [Guile-commits] 05/13: Invoke VM hooks through intrinsics, Andy Wingo, 2018/08/19
- [Guile-commits] 06/13: Rework foreign-call trampoline, Andy Wingo, 2018/08/19
- [Guile-commits] 08/13: Adapt JIT calling convention; continuations take mra from stack, Andy Wingo, 2018/08/19
- [Guile-commits] 11/13: 64-bit intrinsic args and return values passed indirectly on 32-bit, Andy Wingo, 2018/08/19