Try and be more careful about propagation of lexical environment.
[bpt/emacs.git] / lisp / ChangeLog
CommitLineData
defb1411
SM
12010-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/bytecomp.el (byte-compile-condition-case): Use push.
4
f07a954e
SM
52010-12-13 Stefan Monnier <monnier@iro.umontreal.ca>
6
7 * subr.el (with-lexical-binding): Remove.
8
4a330052
SM
92010-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
10
11 * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
12 specialp -> special-variable-p.
13
3c3ddb98
SM
142010-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
17 Don't macroexpand before evaluating in eval-and-compile, in case
18 `body's macro expansion uses macros and functions defined in itself.
19
f43cb649
SM
202010-06-14 Stefan Monnier <monnier@iro.umontreal.ca>
21
22 * emacs-lisp/bytecomp.el (byte-compile-check-variable):
23 Update byte-compile-not-obsolete-var to byte-compile-not-obsolete-vars.
24
25 * Makefile.in (.el.elc): Increase max-lisp-eval-depth.
26
894e369d 272006-12-04 Miles Bader <miles@gnu.org>
89877f5f 28
894e369d
SM
29 * Makefile.in (COMPILE_FIRST_STACK_DEPTH): New variable.
30 (compile, compile-always): Use it.
133a8d82 31
894e369d 322005-10-24 Miles Bader <miles@gnu.org>
89877f5f 33
894e369d 34 * subr.el (functionp): Re-remove.
89877f5f 35
894e369d
SM
36 * emacs-lisp/bytecomp.el (byte-compile-closure): Add optional
37 ADD-LAMBDA argument, which we just pass to `byte-compile-lambda'.
38 (byte-compile-defun): Use ADD-LAMBDA arg to `byte-compile-closure'
39 instead of adding lambda ourselves.
9d1f18b5 40
894e369d 412004-08-09 Miles Bader <miles@gnu.org>
9d1f18b5 42
894e369d 43 Changes from merging the funvec patch:
b81a0b56 44
894e369d
SM
45 * emacs-lisp/bytecomp.el (byte-compile-make-closure): Use `curry'
46 instead of `vector' to create compiled closures.
b81a0b56 47
894e369d 48 Merge funvec patch.
b81a0b56 49
894e369d 502004-04-29 Miles Bader <miles@gnu.org>
69f18acc 51
894e369d
SM
52 * emacs-lisp/bytecomp.el (byte-compile-top-level): Add new entries
53 to `byte-compile-lexical-environment' at the start, not end.
54 (byte-compile-delay-out): Correctly default STACK-ADJUST to zero.
5fee75d4 55
894e369d
SM
56 * emacs-lisp/byte-opt.el (byte-opt-update-stack-params):
57 Don't crash on no-op lapcode entries (car is nil).
69f18acc 58
894e369d
SM
59 * emacs-lisp/byte-lexbind.el (byte-compile-make-lambda-lexenv):
60 Push a lexvar onto lexenv, not a vinfo!
9766adfb 61
894e369d 622004-04-11 Miles Bader <miles@gnu.org>
9766adfb 63
894e369d
SM
64 * emacs-lisp/bytecomp.el (byte-compile-top-level):
65 Correctly analyze lexically-bound arguments.
9766adfb 66
894e369d
SM
67 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
68 Use `append' instead of `nconc'.
56b2854f 69
894e369d
SM
70 * emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo):
71 Don't use backquote to make a mutable data-structure.
72 (byte-compile-lvarinfo-num-refs, byte-compile-lvarinfo-num-sets):
73 Rename to use `num-' instead of `num'.
74 (byte-compile-make-lambda-lexenv): Adjust accordingly.
56b2854f 75
894e369d 762004-04-10 Miles Bader <miles@gnu.org>
6534e58a 77
894e369d
SM
78 * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
79 Look at variable's global specialp state too.
d6ceb380 80
894e369d 812004-04-09 Miles Bader <miles@gnu.org>
d6ceb380 82
894e369d
SM
83 * emacs-lisp/byte-opt.el (byte-optimize-lapcode):
84 Default initial-stack-depth to 0.
85 (byte-optimize-lapcode): Discard the right number of values in
86 the stack-set+discard-->discard optimization.
c760f19e 87
894e369d 882004-04-02 Miles Bader <miles@gnu.org>
2e9b968b 89
894e369d
SM
90 * emacs-lisp/lisp-mode.el (eval-last-sexp-1): Setup the lexical
91 environment if lexical-binding is enabled.
2e9b968b 92
894e369d 932003-10-14 Miles Bader <miles@gnu.org>
6d00ce04 94
894e369d
SM
95 * emacs-lisp/macroexp.el (macroexpand-all-1): Special-case
96 `backquote-list*' to avoid stack overflows.
baf1a55e 97
894e369d 982003-04-04 Miles Bader <miles@gnu.org>
6ee21b07 99
894e369d 100 * help-fns.el (help-function-arglist): Handle interpreted closures.
f0dbdc25 101
894e369d 1022002-11-20 Miles Bader <miles@gnu.org>
f0dbdc25 103
894e369d
SM
104 * emacs-lisp/bytecomp.el (byte-compile-stack-adjustment):
105 Correctly handle discardN* operators.
106 * emacs-lisp/byte-opt.el (byte-optimize-lapcode): Fix stack-depth
107 tracking errors.
e044e4fc 108
894e369d 1092002-08-26 Miles Bader <miles@gnu.org>
e044e4fc 110
894e369d
SM
111 * international/mule.el (make-char): Macroexpand call to
112 charset-id constructed by `byte-compile' hook.
2e9b968b 113
894e369d 114 * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defconst value.
2e9b968b 115
894e369d
SM
116 * emacs-lisp/byte-opt.el (byte-opt-update-stack-params): New macro.
117 (byte-optimize-lapcode): Keep track of stack-depth in final pass too.
118 Add more optimizations for lexical binding.
119 (byte-compile-inline-expand): Macroexpand result of inlining.
baf1a55e 120
894e369d
SM
121 * emacs-lisp/bytecomp.el (byte-compile-lambda): Update call to
122 byte-compile-closure-initial-lexenv-p.
123 (byte-discardN-preserve-tos): Alias to byte-discardN.
124 (byte-compile-push-binding-init): Don't push unused variables on
125 init-lexenv.
126 (byte-compile-push-binding-init): Don't use LFORMINFO if it's nil.
127 (byte-compile-lambda): Don't look at lexical environment unless
128 we're using lexical binding.
129 (byte-compile-defmacro): Correctly generate macros.
130
131 * emacs-lisp/byte-lexbind.el (byte-compile-unbind): Optimize the
132 dynamic-bindings-only case.
133 (byte-compile-bind): Don't special-case unused lexical variables.
134
135 * emacs-lisp/disass.el (disassemble-1): Print arg for discardN ops.
136
1372002-08-19 Miles Bader <miles@gnu.org>
138
139 * emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
140 Handle `byte-discardN-preserve-tos' pseudo-op.
141 (byte-compile-side-effect-and-error-free-ops): Add `byte-stack-ref'.
142 (byte-compile-side-effect-free-ops): Add `byte-vec-ref'.
143 (byte-optimize-lapcode): Add some cases for stack-set/ref ops.
144 Add tracking of stack-depth. Unfinished code to collapse
145 lexical-unbinding sequences.
146
147 * emacs-lisp/bytecomp.el (byte-compile-lapcode):
148 Handle `byte-discardN-preserve-tos' pseudo-op.
149 (byte-compile-top-level): If there are lexical args, output a TAG
150 op to record the initial stack-depth for the optimizer.
151
1522002-08-17 Miles Bader <miles@gnu.org>
153
154 * emacs-lisp/bytecomp.el (byte-discardN): Add byte-defop.
155 (byte-compile-lapcode): Include byte-discardN.
156 (byte-compile-lambda): Fixup closure detection.
157 (byte-compile-top-level): Handle arguments for a lexical lambda.
158 (byte-compile-lexical-variable-ref, byte-compile-variable-ref)
159 (byte-compile-variable-set): Use byte-compile-stack-set/ref.
160 (byte-compile-discard): Add new parameters NUM and PRESERVE-TOS.
161 (byte-compile-stack-ref, byte-compile-stack-set): New functions.
162 (byte-compile-push-binding-init): Get the variable list properly
163 from LFORMINFO.
164
165 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
166 Ignore setq'd variables we're not interested in.
167 (byte-compile-make-lambda-lexenv): Add assertion that closed-over
168 variables be heap allocated.
169 (byte-compile-closure-initial-lexenv-p): Rename from
170 byte-compile-closure-lexenv-p.
171 (byte-compile-non-stack-bindings-p): Get the variable list
172 properly from LFORMINFO.
173 (byte-compile-maybe-push-heap-environment): Handle the
174 no-closed-over-variables case correctly.
175 (byte-compile-bind): Use byte-compile-stack-set/ref.
176 Don't bother modifying INIT-LEXENV as no one will see the changes.
177 (byte-compile-unbind): Call `byte-compile-discard' to handle
178 unbinding lexical bindings.
179
180 * emacs-lisp/disass.el (disassemble-internal): Handle closures.
181 (disassemble-1): Handle new bytecodes.
182 * emacs-lisp/byte-opt.el (disassemble-offset): Handle new bytecodes.
183
1842002-06-16 Miles Bader <miles@gnu.org>
185
186 * emacs-lisp/macroexp.el (macroexp-accumulate): New macro.
187 (macroexpand-all-forms, macroexpand-all-clauses): Use it.
188 * Makefile.in (compile): Undo previous change.
189
1902002-06-14 Miles Bader <miles@gnu.org>
191
192 * Makefile.in (COMPILE_FIRST): Add `emacs-lisp/macroexp.el'.
193 (compile): Add a special case that compiles `emacs-lisp/macroexp.el'
194 with an increased max-lisp-eval-depth.
195
196 * emacs-lisp/bytecomp.el: Provide `bytecomp-preload', at the
197 beginning of the file. Require `byte-lexbind' at compile time.
198 Add a few doc string.
199 (byte-compile-push-bytecodes)
200 (byte-compile-push-bytecode-const2): New macros.
201 (byte-compile-lapcode): Use them. Do general code cleanup.
202 (byte-compile-initial-macro-environment): Expand macros in
203 byte-compile-eval before passing to byte-compile-top-level.
204 (byte-compile): Use the `byte-compile-initial-macro-environment'.
205
206 * emacs-lisp/byte-lexbind.el: Require `bytecomp-preload' instead of
207 `bytecomp'.
208 (byte-compile-bind): Use `byte-compile-dynamic-variable-bind' to bind
209 dynamic variables.
210 (byte-compile-maybe-push-heap-environment): Fix function name typo.
211
2122002-06-13 Miles Bader <miles@gnu.org>
213
214 Byte compiler lexical binding support (not finished yet):
215 * emacs-lisp/bytecomp.el: Require `macroexp'.
216 (byte-compile-lexical-environment)
217 (byte-compile-current-heap-environment)
218 (byte-compile-current-num-closures): New variables.
219 (0, 178, 179, 180, 181): New byte-opcodes.
220 (byte-compile-lapcode): Handle stack-ref/set opcodes. Signal an
221 error if a delay-output placeholder is not filled in yet.
222 (byte-compile-file-form, byte-compile): Expand all macros with
223 `macroexpand-all'.
224 (byte-compile-file-form-defsubst, byte-compile-form): Don't expand
225 macros here.
226 (byte-compile-make-lambda-lexenv): Autoload.
227 (byte-compile-lambda): Initial code for handling lexically-bound
228 arguments and closures; doesn't work yet.
229 (byte-compile-closure-code-p, byte-compile-make-closure)
230 (byte-compile-closure): New functions.
231 (byte-compile-check-variable, byte-compile-dynamic-variable-op)
232 (byte-compile-dynamic-variable-bind)
233 (byte-compile-lexical-variable-ref, byte-compile-variable-set):
baf1a55e 234 New functions.
894e369d
SM
235 (byte-compile-variable-ref): Remove second argument. Now only
236 handles real variable references (not setting or binding).
237 (byte-compile-push-unknown-constant)
238 (byte-compile-resolve-unknown-constant): New functions.
239 (byte-compile-funarg, byte-compile-funarg-2): Functions removed.
240 (byte-compile-function-form): Use either `byte-compile-constant'
241 or `byte-compile-closure'.
242 (byte-compile-setq): Use `byte-compile-variable-set' instead of
243 `byte-compile-variable-ref'.
244 (apply, mapcar, mapatoms, mapconcat, mapc, sort):
245 `byte-defop-compiler-1's removed.
246 (byte-compile-while): Make sure lexically-bound variables inside
247 the loop don't get stored in an environment outside the loop.
248 (byte-compile-compute-lforminfo): Autoload.
249 (byte-compile-push-binding-init): New function.
250 (byte-compile-let, byte-compile-let*): Handle lexical binding.
251 (byte-compile-defun): Use `byte-compile-closure' to do the work.
252 (byte-compile-defmacro): Use `byte-compile-make-closure'.
253 (byte-compile-defvar): Expand the generated call to `push' since
254 we're past macroexpansion already.
255 (byte-compile-stack-adjustment): New function.
256 (byte-compile-out): Make second arg optional. Rewrite for clarity.
257 (byte-compile-delay-out, byte-compile-delayed-out): New functions.
258
259 * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
260 Don't expand macros here.
261
262 * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defmacro forms.
263
264 * emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo)
265 (byte-compile-lforminfo-add-var)
266 (byte-compile-lforminfo-note-closure)
267 (byte-compile-compute-lforminfo)
268 (byte-compile-lforminfo-from-lambda)
269 (byte-compile-lforminfo-analyze)
270 (byte-compile-heapenv-add-accessible-env)
271 (byte-compile-heapenv-ensure-access)
272 (byte-compile-rearrange-let-clauses, byte-compile-bind)
273 (byte-compile-unbind): Fix a bunch of typos.
274
2752002-06-12 Miles Bader <miles@gnu.org>
276
277 * emacs-lisp/byte-lexbind.el, emacs-lisp/macroexp.el: New files.
278
279 * subr.el (functionp): Function removed (now a subr).
280 * help-fns.el (describe-function-1): Handle interpreted closures.
281
282;; arch-tag: bd1b5b8b-fdb2-425d-9ac2-20689fb0ee70