diff options
| author | Stefan Monnier | 2011-03-05 23:48:17 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2011-03-05 23:48:17 -0500 |
| commit | e2abe5a13dffb08d6371b6a611bc39c3a9ac2bc6 (patch) | |
| tree | b9fb87041279f75ba8b6b304e0765bf412377af6 /src/alloc.c | |
| parent | d032d5e7dfabfae60f3304da02c97cd1e189b9a2 (diff) | |
| download | emacs-e2abe5a13dffb08d6371b6a611bc39c3a9ac2bc6.tar.gz emacs-e2abe5a13dffb08d6371b6a611bc39c3a9ac2bc6.zip | |
Fix pcase memoizing; change lexbound byte-code marker.
* src/bytecode.c (exec_byte_code): Remove old lexical binding slot handling
and replace it with the a integer args-desc handling.
* eval.c (funcall_lambda): Adjust arglist test accordingly.
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-signature):
Handle integer arglist descriptor.
(byte-compile-make-args-desc): Make integer arglist descriptor.
(byte-compile-lambda): Use integer arglist descriptor to mark lexical
byte-coded functions instead of an extra slot.
* lisp/help-fns.el (help-add-fundoc-usage): Don't add a dummy doc.
(help-split-fundoc): Return a nil doc if there was no actual doc.
(help-function-arglist): Generate an arglist from an integer arg-desc.
* lisp/emacs-lisp/pcase.el (pcase--memoize): Rename from pcase-memoize;
Make only the key weak.
(pcase): Change the key used in the memoization table, so it does not
always get GC'd away.
* lisp/emacs-lisp/macroexp.el (macroexpand-all-1): Slight change to the
pcase pattern to generate slightly better code.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/alloc.c b/src/alloc.c index 0b7db7ec627..c7fd8747f74 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2945,10 +2945,19 @@ usage: (vector &rest OBJECTS) */) | |||
| 2945 | 2945 | ||
| 2946 | DEFUN ("make-byte-code", Fmake_byte_code, Smake_byte_code, 4, MANY, 0, | 2946 | DEFUN ("make-byte-code", Fmake_byte_code, Smake_byte_code, 4, MANY, 0, |
| 2947 | doc: /* Create a byte-code object with specified arguments as elements. | 2947 | doc: /* Create a byte-code object with specified arguments as elements. |
| 2948 | The arguments should be the arglist, bytecode-string, constant vector, | 2948 | The arguments should be the ARGLIST, bytecode-string BYTE-CODE, constant |
| 2949 | stack size, (optional) doc string, and (optional) interactive spec. | 2949 | vector CONSTANTS, maximum stack size DEPTH, (optional) DOCSTRING, |
| 2950 | and (optional) INTERACTIVE-SPEC. | ||
| 2950 | The first four arguments are required; at most six have any | 2951 | The first four arguments are required; at most six have any |
| 2951 | significance. | 2952 | significance. |
| 2953 | The ARGLIST can be either like the one of `lambda', in which case the arguments | ||
| 2954 | will be dynamically bound before executing the byte code, or it can be an | ||
| 2955 | integer of the form NNNNNNNRMMMMMMM where the 7bit MMMMMMM specifies the | ||
| 2956 | minimum number of arguments, the 7-bit NNNNNNN specifies the maximum number | ||
| 2957 | of arguments (ignoring &rest) and the R bit specifies whether there is a &rest | ||
| 2958 | argument to catch the left-over arguments. If such an integer is used, the | ||
| 2959 | arguments will not be dynamically bound but will be instead pushed on the | ||
| 2960 | stack before executing the byte-code. | ||
| 2952 | usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */) | 2961 | usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */) |
| 2953 | (register int nargs, Lisp_Object *args) | 2962 | (register int nargs, Lisp_Object *args) |
| 2954 | { | 2963 | { |