Commit ce5b520a authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/emacs-lisp/byte-lexbind.el: Delete.

* lisp/emacs-lisp/bytecomp.el (byte-compile-current-heap-environment)
(byte-compile-current-num-closures): Remove vars.
(byte-vec-ref, byte-vec-set): Remove byte codes.
(byte-compile-arglist-vars, byte-compile-make-lambda-lexenv): Move from
byte-lexbind.el.
(byte-compile-lambda): Never build a closure.
(byte-compile-closure-code-p, byte-compile-make-closure): Remove.
(byte-compile-closure): Simplify.
(byte-compile-top-level): Don't mess with heap environments.
(byte-compile-dynamic-variable-bind): Always maintain
byte-compile-bound-variables.
(byte-compile-variable-ref, byte-compile-variable-set): Always just use
the stack for lexical vars.
(byte-compile-push-binding-init): Simplify.
(byte-compile-not-lexical-var-p): New function, moved from cconv.el.
(byte-compile-bind, byte-compile-unbind): New functions, moved and
simplified from byte-lexbind.el.
(byte-compile-let, byte-compile-let*): Simplify.
(byte-compile-condition-case): Don't add :fun-body to the bound vars.
(byte-compile-defmacro): Simplify.
* lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops)
(byte-optimize-lapcode): Remove byte-vec-ref and byte-vec-set.
* lisp/emacs-lisp/cconv.el (cconv-not-lexical-var-p): Remove.
(cconv-freevars, cconv-analyse-function, cconv-analyse-form):
Use byte-compile-not-lexical-var-p instead.
* src/bytecode.c (Bvec_ref, Bvec_set): Remove.
(exec_byte_code): Don't handle them.
* lisp/help-fns.el (describe-function-1): Fix paren typo.
parent c530e1c2
2011-02-12 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/byte-lexbind.el: Delete.
* emacs-lisp/bytecomp.el (byte-compile-current-heap-environment)
(byte-compile-current-num-closures): Remove vars.
(byte-vec-ref, byte-vec-set): Remove byte codes.
(byte-compile-arglist-vars, byte-compile-make-lambda-lexenv): Move from
byte-lexbind.el.
(byte-compile-lambda): Never build a closure.
(byte-compile-closure-code-p, byte-compile-make-closure): Remove.
(byte-compile-closure): Simplify.
(byte-compile-top-level): Don't mess with heap environments.
(byte-compile-dynamic-variable-bind): Always maintain
byte-compile-bound-variables.
(byte-compile-variable-ref, byte-compile-variable-set): Always just use
the stack for lexical vars.
(byte-compile-push-binding-init): Simplify.
(byte-compile-not-lexical-var-p): New function, moved from cconv.el.
(byte-compile-bind, byte-compile-unbind): New functions, moved and
simplified from byte-lexbind.el.
(byte-compile-let, byte-compile-let*): Simplify.
(byte-compile-condition-case): Don't add :fun-body to the bound vars.
(byte-compile-defmacro): Simplify.
* emacs-lisp/cconv.el (cconv-not-lexical-var-p): Remove.
(cconv-freevars, cconv-analyse-function, cconv-analyse-form):
Use byte-compile-not-lexical-var-p instead.
* help-fns.el (describe-function-1): Fix paren typo.
* emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops)
(byte-optimize-lapcode): Remove byte-vec-ref and byte-vec-set.
2011-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cconv.el (cconv-closure-convert): Drop `toplevel' arg.
......
This diff is collapsed.
......@@ -1483,7 +1483,7 @@
byte-eqlsign byte-gtr byte-lss byte-leq byte-geq byte-diff byte-negate
byte-plus byte-max byte-min byte-mult byte-char-after byte-char-syntax
byte-buffer-substring byte-string= byte-string< byte-nthcdr byte-elt
byte-member byte-assq byte-quo byte-rem byte-vec-ref)
byte-member byte-assq byte-quo byte-rem)
byte-compile-side-effect-and-error-free-ops))
;; This crock is because of the way DEFVAR_BOOL variables work.
......@@ -1671,7 +1671,7 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance."
;;
((and (eq 'byte-dup (car lap0))
(eq 'byte-discard (car lap2))
(memq (car lap1) '(byte-varset byte-varbind byte-stack-set byte-vec-set)))
(memq (car lap1) '(byte-varset byte-varbind byte-stack-set)))
(byte-compile-log-lap " dup %s discard\t-->\t%s" lap1 lap1)
(setq keep-going t
rest (cdr rest)
......
This diff is collapsed.
......@@ -85,19 +85,6 @@ is less than this number.")
"List of candidates for lambda lifting.
Each candidate has the form (VAR INCLOSURE BINDER PARENTFORM).")
(defun cconv-not-lexical-var-p (var)
(or (not (symbolp var)) ; form is not a list
(if (eval-when-compile (fboundp 'special-variable-p))
(special-variable-p var)
(boundp var))
;; byte-compile-bound-variables normally holds both the
;; dynamic and lexical vars, but the bytecomp.el should
;; only call us at the top-level so there shouldn't be
;; any lexical vars in it here.
(memq var byte-compile-bound-variables)
(memq var '(nil t))
(keywordp var)))
(defun cconv-freevars (form &optional fvrs)
"Find all free variables of given form.
Arguments:
......@@ -189,7 +176,7 @@ Returns a list of free variables."
(dolist (exp body-forms)
(setq fvrs (cconv-freevars exp fvrs))) fvrs)
(_ (if (cconv-not-lexical-var-p form)
(_ (if (byte-compile-not-lexical-var-p form)
fvrs
(cons form fvrs)))))
......@@ -704,7 +691,7 @@ Returns a form where all lambdas don't have any free variables."
(defun cconv-analyse-function (args body env parentform inclosure)
(dolist (arg args)
(cond
((cconv-not-lexical-var-p arg)
((byte-compile-not-lexical-var-p arg)
(byte-compile-report-error
(format "Argument %S is not a lexical variable" arg)))
((eq ?& (aref (symbol-name arg) 0)) nil) ;Ignore &rest, &optional, ...
......@@ -738,7 +725,7 @@ lambdas if they are suitable for lambda lifting.
(cconv-analyse-form value (if (eq letsym 'let*) env orig-env)
inclosure))
(unless (cconv-not-lexical-var-p var)
(unless (byte-compile-not-lexical-var-p var)
(let ((varstruct (list var inclosure binder form)))
(push varstruct env) ; Push a new one.
......
......@@ -529,7 +529,7 @@ suitable file is found, return nil."
(high (help-highlight-arguments use doc)))
(let ((fill-begin (point)))
(insert (car high) "\n")
(fill-region fill-begin (point))))
(fill-region fill-begin (point)))
(setq doc (cdr high))))
(let* ((obsolete (and
;; function might be a lambda construct.
......@@ -545,7 +545,7 @@ suitable file is found, return nil."
(t "."))
"\n"))
(insert "\n"
(or doc "Not documented.")))))))
(or doc "Not documented."))))))))
;; Variables
......
2011-02-12 Stefan Monnier <monnier@iro.umontreal.ca>
* bytecode.c (Bvec_ref, Bvec_set): Remove.
(exec_byte_code): Don't handle them.
2010-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
* eval.c (Fdefvar): Record specialness before computing initial value.
......
......@@ -231,8 +231,6 @@ extern Lisp_Object Qand_optional, Qand_rest;
/* Bstack_ref is code 0. */
#define Bstack_set 0262
#define Bstack_set2 0263
#define Bvec_ref 0264
#define Bvec_set 0265
#define BdiscardN 0266
#define Bconstant 0300
......@@ -1722,27 +1720,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth,
case Bstack_set2:
stack.bottom[FETCH2] = POP;
break;
case Bvec_ref:
case Bvec_set:
/* These byte-codes used mostly for variable references to
lexically bound variables that are in an environment vector
instead of on the byte-interpreter stack (generally those
variables which might be shared with a closure). */
{
int index = FETCH;
Lisp_Object vec = POP;
if (! VECTORP (vec))
wrong_type_argument (Qvectorp, vec);
else if (index < 0 || index >= XVECTOR (vec)->size)
args_out_of_range (vec, make_number (index));
if (op == Bvec_ref)
PUSH (XVECTOR (vec)->contents[index]);
else
XVECTOR (vec)->contents[index] = POP;
}
break;
case BdiscardN:
op = FETCH;
if (op & 0x80)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment