diff options
author | Andy Wingo <wingo@pobox.com> | 2015-11-27 15:54:51 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2015-12-01 11:30:54 +0100 |
commit | 58153e3a08c89fd9cc84dbf65e1df27119986cca (patch) | |
tree | 3e77d5e70d1cfd5227089ee667ae7367b85be87a | |
parent | 3582787cb032da4d3a722bfb00882e6d992b0c87 (diff) | |
download | guile-58153e3a08c89fd9cc84dbf65e1df27119986cca.tar.gz |
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.
-rw-r--r-- | NEWS | 23 | ||||
-rw-r--r-- | doc/ref/api-debug.texi | 8 | ||||
-rw-r--r-- | libguile/frames.c | 13 | ||||
-rw-r--r-- | libguile/frames.h | 1 | ||||
-rw-r--r-- | test-suite/tests/eval.test | 4 |
5 files changed, 28 insertions, 21 deletions
@@ -6,7 +6,28 @@ Please send Guile bug reports to bug-guile@gnu.org. -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 958c92728..459371fa7 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 -@deffn {Scheme Procedure} frame-procedure frame -@deffnx {C Function} scm_frame_procedure (frame) -Return the procedure for @var{frame}, or @code{#f} if no -procedure is associated with @var{frame}. +@deffn {Scheme Procedure} frame-procedure-name frame +@deffnx {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 7492adfb2..2eae45fcd 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 241e3f3ad..bf3844527 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 e1837fd38..26917d762 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))) |