mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
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.
This commit is contained in:
parent
3582787cb0
commit
58153e3a08
5 changed files with 28 additions and 21 deletions
23
NEWS
23
NEWS
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue