[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 15/41: Remove frame-procedure
From: |
Andy Wingo |
Subject: |
[Guile-commits] 15/41: Remove frame-procedure |
Date: |
Wed, 02 Dec 2015 08:06:50 +0000 |
wingo pushed a commit to branch master
in repository guile.
commit 58153e3a08c89fd9cc84dbf65e1df27119986cca
Author: Andy Wingo <address@hidden>
Date: Fri Nov 27 15:54:51 2015 +0100
Remove frame-procedure
* libguile/frames.h:
* libguile/frames.c (scm_frame_procedure): Remove.
* test-suite/tests/eval.test ("stacks"): Adapt test.
* NEWS: Add news item.
* doc/ref/api-debug.texi (Frames): Document frame-procedure-name instead
of frame-procedure.
---
NEWS | 23 ++++++++++++++++++++++-
doc/ref/api-debug.texi | 8 ++++----
libguile/frames.c | 13 -------------
libguile/frames.h | 1 -
test-suite/tests/eval.test | 4 ++--
5 files changed, 28 insertions(+), 21 deletions(-)
diff --git a/NEWS b/NEWS
index 6041134..ce38879 100644
--- a/NEWS
+++ b/NEWS
@@ -6,7 +6,28 @@ Please send Guile bug reports to address@hidden
-Changes in 2.1.1 (changes since the 2.0.x series):
+Changes in 2.1.2 (changes since the 2.1.1 alpha release):
+
+* Incompatible changes
+
+** Remove frame-procedure
+
+Several optimizations in Guile make `frame-procedure' an interface that
+we can no longer support. For background, `frame-procedure' used to
+return the value at slot 0 in a frame, which usually corresponds to the
+SCM value of the procedure being applied. However it could be that this
+slot is re-used for some other value, because the closure was not needed
+in the function. Such a re-use might even be for an untagged value, in
+which case treating slot 0 as a SCM value is quite dangerous. It's also
+possible that so-called "well-known" closures (closures whose callers
+are all known) are optimized in such a way that slot 0 is not a
+procedure but some optimized representation of the procedure's free
+variables. Instead, developers building debugging tools that would like
+access to `frame-procedure' are invited to look at the source for the
+`(system vm frame)' for alternate interfaces.
+
+
+Changes in 2.1.x (changes since the 2.0.x series):
* Notable changes
diff --git a/doc/ref/api-debug.texi b/doc/ref/api-debug.texi
index 958c927..459371f 100644
--- a/doc/ref/api-debug.texi
+++ b/doc/ref/api-debug.texi
@@ -177,10 +177,10 @@ Return the previous frame of @var{frame}, or @code{#f} if
@var{frame} is the first frame in its stack.
@end deffn
address@hidden {Scheme Procedure} frame-procedure frame
address@hidden {C Function} scm_frame_procedure (frame)
-Return the procedure for @var{frame}, or @code{#f} if no
-procedure is associated with @var{frame}.
address@hidden {Scheme Procedure} frame-procedure-name frame
address@hidden {C Function} scm_frame_procedure_name (frame)
+Return the name of the procedure being applied in @var{frame}, as a
+symbol, or @code{#f} if the procedure has no name.
@end deffn
@deffn {Scheme Procedure} frame-arguments frame
diff --git a/libguile/frames.c b/libguile/frames.c
index 7492adf..2eae45f 100644
--- a/libguile/frames.c
+++ b/libguile/frames.c
@@ -144,19 +144,6 @@ scm_c_frame_closure (enum scm_vm_frame_kind kind, const
struct scm_frame *frame)
return SCM_BOOL_F;
}
-SCM_DEFINE (scm_frame_procedure, "frame-procedure", 1, 0, 0,
- (SCM frame),
- "")
-#define FUNC_NAME s_scm_frame_procedure
-{
- SCM_VALIDATE_VM_FRAME (1, frame);
-
- /* FIXME: Retrieve procedure from address? */
- return scm_c_frame_closure (SCM_VM_FRAME_KIND (frame),
- SCM_VM_FRAME_DATA (frame));
-}
-#undef FUNC_NAME
-
static SCM frame_procedure_name_var;
static void
diff --git a/libguile/frames.h b/libguile/frames.h
index 241e3f3..bf38445 100644
--- a/libguile/frames.h
+++ b/libguile/frames.h
@@ -156,7 +156,6 @@ SCM_INTERNAL int scm_c_frame_previous (enum
scm_vm_frame_kind kind,
#endif
SCM_API SCM scm_frame_p (SCM obj);
-SCM_API SCM scm_frame_procedure (SCM frame);
SCM_API SCM scm_frame_procedure_name (SCM frame);
SCM_API SCM scm_frame_call_representation (SCM frame);
SCM_API SCM scm_frame_arguments (SCM frame);
diff --git a/test-suite/tests/eval.test b/test-suite/tests/eval.test
index e1837fd..26917d7 100644
--- a/test-suite/tests/eval.test
+++ b/test-suite/tests/eval.test
@@ -365,8 +365,8 @@
;; stack.
(let* ((stack (make-tagged-trimmed-stack tag '(#t)))
(frames (stack->frames stack))
- (num (count (lambda (frame) (eq? (frame-procedure frame)
- substring))
+ (num (count (lambda (frame) (eq? (frame-procedure-name frame)
+ 'substring))
frames)))
(= num 1)))
- [Guile-commits] 04/41: Identify boot continuations by code, not closure, (continued)
- [Guile-commits] 04/41: Identify boot continuations by code, not closure, Andy Wingo, 2015/12/02
- [Guile-commits] 01/41: Fix miscompilation of closures allocated as vectors, Andy Wingo, 2015/12/02
- [Guile-commits] 08/41: Add frame-procedure-name, Andy Wingo, 2015/12/02
- [Guile-commits] 06/41: Apply of non-programs has IP that is not from prev frame, Andy Wingo, 2015/12/02
- [Guile-commits] 07/41: Remove primitive?, add primitive-code?, Andy Wingo, 2015/12/02
- [Guile-commits] 10/41: More robust low-level frame printer, Andy Wingo, 2015/12/02
- [Guile-commits] 05/41: All arities serialize a "closure" binding, Andy Wingo, 2015/12/02
- [Guile-commits] 12/41: ,registers doesn't use frame-procedure, Andy Wingo, 2015/12/02
- [Guile-commits] 11/41: Better frame-call-representation printing of GC clobbers, Andy Wingo, 2015/12/02
- [Guile-commits] 09/41: frame-call-representation avoids frame-procedure., Andy Wingo, 2015/12/02
- [Guile-commits] 15/41: Remove frame-procedure,
Andy Wingo <=
- [Guile-commits] 13/41: Remove `procedure' repl command, Andy Wingo, 2015/12/02
- [Guile-commits] 14/41: VM traps don't match on value of slot 0, Andy Wingo, 2015/12/02
- [Guile-commits] 17/41: Remove frame->module, Andy Wingo, 2015/12/02
- [Guile-commits] 19/41: Add bv-length instruction, Andy Wingo, 2015/12/02
- [Guile-commits] 18/41: Range inference over the full U64+S64 range, Andy Wingo, 2015/12/02
- [Guile-commits] 20/41: bv-f{32, 64}-{ref, set!} take unboxed u64 index, Andy Wingo, 2015/12/02
- [Guile-commits] 23/41: Beginning of u64 phi unboxing, Andy Wingo, 2015/12/02
- [Guile-commits] 16/41: Add low-level support for unboxed 64-bit unsigned ints, Andy Wingo, 2015/12/02
- [Guile-commits] 22/41: Specialize u64 comparisons, Andy Wingo, 2015/12/02
- [Guile-commits] 26/41: Slower range saturation in type inference, Andy Wingo, 2015/12/02