Get rid of funvec.
[bpt/emacs.git] / lisp / ChangeLog
CommitLineData
876c194c
SM
12011-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * emacs-lisp/bytecomp.el (byte-compile-lapcode): Handle new form of
4 `byte-constant'.
5 (byte-compile-close-variables, displaying-byte-compile-warnings):
6 Add edebug spec.
7 (byte-compile-toplevel-file-form): New fun, split out of
8 byte-compile-file-form.
9 (byte-compile-from-buffer): Use it to avoid applying cconv
10 multiple times.
11 (byte-compile): Only strip `function' if it's present.
12 (byte-compile-lambda): Add `reserved-csts' argument.
13 Use new lexenv arg of byte-compile-top-level.
14 (byte-compile-reserved-constants): New var.
15 (byte-compile-constants-vector): Obey it.
16 (byte-compile-constants-vector): Handle new `byte-constant' form.
17 (byte-compile-top-level): Add args `lexenv' and `reserved-csts'.
18 (byte-compile-form): Don't check callargs here.
19 (byte-compile-normal-call): Do it here instead.
20 (byte-compile-push-unknown-constant)
21 (byte-compile-resolve-unknown-constant): Remove, unused.
22 (byte-compile-make-closure): Use `make-byte-code' rather than `curry',
23 putting the environment into the "constant" pool.
24 (byte-compile-get-closed-var): Use special byte-constant.
25 * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Handle new
26 intermediate special form `internal-make-vector'.
27 (byte-optimize-lapcode): Handle new form of `byte-constant'.
28 * help-fns.el (describe-function-1): Don't handle funvecs.
29 * emacs-lisp/macroexp.el (macroexpand-all-1): Only convert quote to
30 function if the content is a lambda expression, not if it's a closure.
31 * emacs-lisp/eieio-come.el: Remove.
32 * emacs-lisp/eieio.el: Don't require eieio-comp.
33 (defmethod): Do a bit more work to find the body and wrap it into
34 a function before passing it to eieio-defmethod.
35 (eieio-defmethod): New arg `code' for it.
36 * emacs-lisp/debug.el (debugger-setup-buffer): Don't hide things in
37 debugger backtrace.
38 * emacs-lisp/cl-extra.el (cl-macroexpand-all): Use backquotes, and be
39 more careful when quoting a function value.
40 * emacs-lisp/cconv.el (cconv-freevars): Accept defvar/defconst.
41 (cconv-closure-convert-rec): Catch stray `internal-make-closure'.
42 * Makefile.in (COMPILE_FIRST): Compile pcase and cconv early.
43
cb9336bd
SM
442011-02-21 Stefan Monnier <monnier@iro.umontreal.ca>
45
46 * emacs-lisp/cconv.el (cconv-closure-convert-rec): Let the byte
47 compiler choose the representation of closures.
48 (cconv--env-var): Remove.
49 * emacs-lisp/bytecomp.el (byte-compile--env-var): New var.
50 (byte-compile-make-closure, byte-compile-get-closed-var):
51 New functions.
52
3e21b6a7
SM
532011-02-21 Stefan Monnier <monnier@iro.umontreal.ca>
54
55 * subr.el (with-output-to-temp-buffer): New macro.
56
57 * simple.el (count-words-region): Don't use interactive-p.
58
59 * minibuffer.el: Use lexical-binding. Replace all uses of lexical-let.
60
61 * emacs-lisp/eieio.el (eieio-defgeneric-form-primary-only-one):
62 Call byte-compile rather than byte-compile-lambda.
63
64 * emacs-lisp/eieio-comp.el (eieio-byte-compile-file-form-defmethod):
65 Rename from byte-compile-file-form-defmethod.
66 Don't byte-compile-lambda.
67 (eieio-byte-compile-defmethod-param-convert): Rename from
68 byte-compile-defmethod-param-convert.
69
70 * emacs-lisp/cl-extra.el (cl-macroexpand-all): Don't assume that the
71 value of (function (lambda ...)) is self-quoting.
72
73 * emacs-lisp/cconv.el: Use lexical-binding.
74 (cconv--lookup-let): Rename from cconv-lookup-let.
75 (cconv-closure-convert-rec): Fix handling of captured+mutated
76 arguments in defun/defmacro.
77
78 * emacs-lisp/bytecomp.el (byte-compile-lapcode):
79 Turn stack-ref-0 into dup.
80 (byte-compile-form): Don't indirect-function since it can signal
81 errors.
82 (byte-compile-stack-ref, byte-compile-stack-set): Adjust to stack-refs
83 being relative to top rather than to bottom in the byte-code.
84 (with-output-to-temp-buffer): Remove.
85 (byte-compile-with-output-to-temp-buffer): Remove.
86
87 * emacs-lisp/byte-opt.el (byte-compile-side-effect-and-error-free-ops):
88 Remove interactive-p.
89 (byte-optimize-lapcode): Update optimizations now that stack-refs are
90 relative to the top rather than to the bottom.
91
e0f57e65
SM
922011-02-19 Stefan Monnier <monnier@iro.umontreal.ca>
93
94 * subr.el (save-window-excursion): New macro, moved from C.
95 * emacs-lisp/lisp-mode.el (save-window-excursion): Don't touch.
96 * emacs-lisp/cconv.el (cconv-closure-convert-rec, cconv-analyse-form):
97 Don't handle save-window-excursion any more.
98 * emacs-lisp/bytecomp.el (interactive-p, save-window-excursion):
99 Don't use the byte-code any more.
100 (byte-compile-form): Check macro expansion was done.
101 (byte-compile-save-window-excursion): Remove.
102 * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
103 Ignore save-window-excursion. Don't macroepand any more.
104
9a05edc4
SM
1052011-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
106
107 * emacs-lisp/pcase.el (pcase--expand, pcase--u, pcase--u1, pcase--q1):
108 Avoid destructuring-bind which results in poorer code.
109
b38b1ec0
SM
1102011-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
111
112 * files.el (lexical-binding): Add a safe-local-variable property.
113
114 * emacs-lisp/cl-macs.el (cl-byte-compile-block): Disable optimization
115 in lexbind, because it needs a different implementation.
116
117 * emacs-lisp/cconv.el (cconv--set-diff, cconv--set-diff-map)
118 (cconv--map-diff, cconv--map-diff-elem, cconv--map-diff-set): New funs.
119 (cconv--env-var): New constant.
120 (cconv-closure-convert-rec): Use it and use them. Fix a typo that
121 ended up forgetting to remove entries from lmenvs in `let'.
122 For `lambda' use the outer `fvrs' when building the closure and don't
123 forget to remove `vars' from the `emvrs' and `lmenvs' of the body.
124
125 * emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
126 Correctly extract arglist from `closure's.
127 (byte-compile-cl-warn): Compiler-macros are run earlier now.
128 (byte-compile-top-level): Bind byte-compile-lexical-environment to nil,
129 except for lambdas.
130 (byte-compile-form): Don't run the compiler-macro expander here.
131 (byte-compile-let): Merge with byte-compile-let*.
132 Don't preserve-body-value if the body's value was discarded.
133
134 * emacs-lisp/byte-opt.el (byte-inline-lapcode): Check how many elements
135 are added to the stack.
136 (byte-compile-splice-in-already-compiled-code): Don't touch lexical nor
137 byte-compile-depth now that byte-inline-lapcode does it for us.
138 (byte-compile-inline-expand): Don't inline dynbind byte code into
139 lexbind code, since it has to be done differently.
140
ce5b520a
SM
1412011-02-12 Stefan Monnier <monnier@iro.umontreal.ca>
142
143 * emacs-lisp/byte-lexbind.el: Delete.
144
145 * emacs-lisp/bytecomp.el (byte-compile-current-heap-environment)
146 (byte-compile-current-num-closures): Remove vars.
147 (byte-vec-ref, byte-vec-set): Remove byte codes.
148 (byte-compile-arglist-vars, byte-compile-make-lambda-lexenv): Move from
149 byte-lexbind.el.
150 (byte-compile-lambda): Never build a closure.
151 (byte-compile-closure-code-p, byte-compile-make-closure): Remove.
152 (byte-compile-closure): Simplify.
153 (byte-compile-top-level): Don't mess with heap environments.
154 (byte-compile-dynamic-variable-bind): Always maintain
155 byte-compile-bound-variables.
156 (byte-compile-variable-ref, byte-compile-variable-set): Always just use
157 the stack for lexical vars.
158 (byte-compile-push-binding-init): Simplify.
159 (byte-compile-not-lexical-var-p): New function, moved from cconv.el.
160 (byte-compile-bind, byte-compile-unbind): New functions, moved and
161 simplified from byte-lexbind.el.
162 (byte-compile-let, byte-compile-let*): Simplify.
163 (byte-compile-condition-case): Don't add :fun-body to the bound vars.
164 (byte-compile-defmacro): Simplify.
165
166 * emacs-lisp/cconv.el (cconv-not-lexical-var-p): Remove.
167 (cconv-freevars, cconv-analyse-function, cconv-analyse-form):
168 Use byte-compile-not-lexical-var-p instead.
169
170 * help-fns.el (describe-function-1): Fix paren typo.
171
172 * emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops)
173 (byte-optimize-lapcode): Remove byte-vec-ref and byte-vec-set.
174
295fb2ac
SM
1752011-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
176
177 * emacs-lisp/cconv.el (cconv-closure-convert): Drop `toplevel' arg.
178 (cconv-closure-convert-toplevel): Remove.
179 (cconv-lookup-let): New fun.
180 (cconv-closure-convert-rec): Don't bother with defs-are-legal.
181 Use :fun-body to handle special forms that require closing their forms.
182
183 * emacs-lisp/bytecomp.el (byte-compile-file-form, byte-compile):
184 Use cconv-closure-convert instead of cconv-closure-convert-toplevel.
185 (byte-compile-lambda, byte-compile-make-closure):
186 * emacs-lisp/byte-lexbind.el (byte-compile-maybe-push-heap-environment):
187 Make sure cconv did its job.
188
189 * emacs-lisp/byte-opt.el (byte-optimize-lapcode): Check stack-depth
190 before using it.
191
192 * dired.el (dired-desktop-buffer-misc-data): Don't use a dynamic var as
193 function argument.
194
43e67019
SM
1952011-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
196
197 * emacs-lisp/bytecomp.el (byte-compile-lambda): Fix `fun' that was not
198 renamed to `bytecomp-fun'.
199
200 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
201 Understand the :fun-body case for catch, save-window-excursion, and
202 condition-case.
203 (byte-compile-maybe-push-heap-environment): No need when nclosures is
204 zero and byte-compile-current-num-closures is -1.
205
206 * emacs-lisp/cconv.el (cconv-not-lexical-var-p): New function.
207 (cconv-freevars): Use it.
208 (cconv-closure-convert-rec): Avoid `position'.
209 (cconv-analyse-function): New function.
210 (cconv-analyse-form): Use it. `inclosure' can't be nil any more.
211 Check lexical vars at let-binding time rather than when referenced.
212 For defuns to be in an empty environment and lambdas to take lexical args.
213 Pay attention to the need to build closures in catch, unwind-protect,
214 save-window-excursion, condition-case, and track-mouse.
215 Fix defconst/defvar handling.
216
d779e73c
SM
2172011-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
218
219 * emacs-lisp/cconv.el (cconv-mutated, cconv-captured)
220 (cconv-captured+mutated, cconv-lambda-candidates): Fix up declaration.
221 (cconv-freevars): Minor cleanup. Fix handling of the error var in
222 condition-case.
223
224 * emacs-lisp/bytecomp.el (byte-compile-catch)
225 (byte-compile-unwind-protect, byte-compile-track-mouse)
226 (byte-compile-condition-case, byte-compile-save-window-excursion):
227 Provide a :fun-body alternative, so that info can be propagated from the
228 surrounding context, as is the case for lexical scoping.
229
94d11cb5
IK
2302011-02-10 Igor Kuzmin <kuzminig@iro.umontreal.ca>
231
232 * emacs-lisp/cconv.el: New file.
233 * emacs-lisp/bytecomp.el: Use cconv.
234 (byte-compile-file-form, byte-compile):
235 Call cconv-closure-convert-toplevel when requested.
236 * server.el:
237 * mpc.el:
238 * emacs-lisp/pcase.el:
239 * doc-view.el:
240 * dired.el: Use lexical-binding.
241
590130fb
SM
2422010-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
243
244 * emacs-lisp/bytecomp.el (byte-compile-track-mouse): Don't use #'.
245
a0ee6f27
SM
2462010-12-15 Stefan Monnier <monnier@iro.umontreal.ca>
247
248 * emacs-lisp/edebug.el (edebug-eval-defun, edebug-eval):
249 * emacs-lisp/lisp-mode.el (eval-last-sexp-1, eval-defun-1):
250 * ielm.el (ielm-eval-input):
251 * simple.el (eval-expression): Use new eval arg to obey lexical-binding.
252
defb1411
SM
2532010-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
254
255 * emacs-lisp/bytecomp.el (byte-compile-condition-case): Use push.
256
f07a954e
SM
2572010-12-13 Stefan Monnier <monnier@iro.umontreal.ca>
258
259 * subr.el (with-lexical-binding): Remove.
260
4a330052
SM
2612010-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
262
263 * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
264 specialp -> special-variable-p.
265
3c3ddb98
SM
2662010-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
267
268 * emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
269 Don't macroexpand before evaluating in eval-and-compile, in case
270 `body's macro expansion uses macros and functions defined in itself.
271
f43cb649
SM
2722010-06-14 Stefan Monnier <monnier@iro.umontreal.ca>
273
274 * emacs-lisp/bytecomp.el (byte-compile-check-variable):
275 Update byte-compile-not-obsolete-var to byte-compile-not-obsolete-vars.
276
277 * Makefile.in (.el.elc): Increase max-lisp-eval-depth.
278
894e369d 2792006-12-04 Miles Bader <miles@gnu.org>
89877f5f 280
894e369d
SM
281 * Makefile.in (COMPILE_FIRST_STACK_DEPTH): New variable.
282 (compile, compile-always): Use it.
133a8d82 283
894e369d 2842005-10-24 Miles Bader <miles@gnu.org>
89877f5f 285
894e369d 286 * subr.el (functionp): Re-remove.
89877f5f 287
894e369d
SM
288 * emacs-lisp/bytecomp.el (byte-compile-closure): Add optional
289 ADD-LAMBDA argument, which we just pass to `byte-compile-lambda'.
290 (byte-compile-defun): Use ADD-LAMBDA arg to `byte-compile-closure'
291 instead of adding lambda ourselves.
9d1f18b5 292
894e369d 2932004-08-09 Miles Bader <miles@gnu.org>
9d1f18b5 294
894e369d 295 Changes from merging the funvec patch:
b81a0b56 296
894e369d
SM
297 * emacs-lisp/bytecomp.el (byte-compile-make-closure): Use `curry'
298 instead of `vector' to create compiled closures.
b81a0b56 299
894e369d 300 Merge funvec patch.
b81a0b56 301
894e369d 3022004-04-29 Miles Bader <miles@gnu.org>
69f18acc 303
894e369d
SM
304 * emacs-lisp/bytecomp.el (byte-compile-top-level): Add new entries
305 to `byte-compile-lexical-environment' at the start, not end.
306 (byte-compile-delay-out): Correctly default STACK-ADJUST to zero.
5fee75d4 307
894e369d
SM
308 * emacs-lisp/byte-opt.el (byte-opt-update-stack-params):
309 Don't crash on no-op lapcode entries (car is nil).
69f18acc 310
894e369d
SM
311 * emacs-lisp/byte-lexbind.el (byte-compile-make-lambda-lexenv):
312 Push a lexvar onto lexenv, not a vinfo!
9766adfb 313
894e369d 3142004-04-11 Miles Bader <miles@gnu.org>
9766adfb 315
894e369d
SM
316 * emacs-lisp/bytecomp.el (byte-compile-top-level):
317 Correctly analyze lexically-bound arguments.
9766adfb 318
894e369d
SM
319 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
320 Use `append' instead of `nconc'.
56b2854f 321
894e369d
SM
322 * emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo):
323 Don't use backquote to make a mutable data-structure.
324 (byte-compile-lvarinfo-num-refs, byte-compile-lvarinfo-num-sets):
325 Rename to use `num-' instead of `num'.
326 (byte-compile-make-lambda-lexenv): Adjust accordingly.
56b2854f 327
894e369d 3282004-04-10 Miles Bader <miles@gnu.org>
6534e58a 329
894e369d
SM
330 * emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
331 Look at variable's global specialp state too.
d6ceb380 332
894e369d 3332004-04-09 Miles Bader <miles@gnu.org>
d6ceb380 334
894e369d
SM
335 * emacs-lisp/byte-opt.el (byte-optimize-lapcode):
336 Default initial-stack-depth to 0.
337 (byte-optimize-lapcode): Discard the right number of values in
338 the stack-set+discard-->discard optimization.
c760f19e 339
894e369d 3402004-04-02 Miles Bader <miles@gnu.org>
2e9b968b 341
894e369d
SM
342 * emacs-lisp/lisp-mode.el (eval-last-sexp-1): Setup the lexical
343 environment if lexical-binding is enabled.
2e9b968b 344
894e369d 3452003-10-14 Miles Bader <miles@gnu.org>
6d00ce04 346
894e369d
SM
347 * emacs-lisp/macroexp.el (macroexpand-all-1): Special-case
348 `backquote-list*' to avoid stack overflows.
baf1a55e 349
894e369d 3502003-04-04 Miles Bader <miles@gnu.org>
6ee21b07 351
894e369d 352 * help-fns.el (help-function-arglist): Handle interpreted closures.
f0dbdc25 353
894e369d 3542002-11-20 Miles Bader <miles@gnu.org>
f0dbdc25 355
894e369d
SM
356 * emacs-lisp/bytecomp.el (byte-compile-stack-adjustment):
357 Correctly handle discardN* operators.
358 * emacs-lisp/byte-opt.el (byte-optimize-lapcode): Fix stack-depth
359 tracking errors.
e044e4fc 360
894e369d 3612002-08-26 Miles Bader <miles@gnu.org>
e044e4fc 362
894e369d
SM
363 * international/mule.el (make-char): Macroexpand call to
364 charset-id constructed by `byte-compile' hook.
2e9b968b 365
894e369d 366 * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defconst value.
2e9b968b 367
894e369d
SM
368 * emacs-lisp/byte-opt.el (byte-opt-update-stack-params): New macro.
369 (byte-optimize-lapcode): Keep track of stack-depth in final pass too.
370 Add more optimizations for lexical binding.
371 (byte-compile-inline-expand): Macroexpand result of inlining.
baf1a55e 372
894e369d
SM
373 * emacs-lisp/bytecomp.el (byte-compile-lambda): Update call to
374 byte-compile-closure-initial-lexenv-p.
375 (byte-discardN-preserve-tos): Alias to byte-discardN.
376 (byte-compile-push-binding-init): Don't push unused variables on
377 init-lexenv.
378 (byte-compile-push-binding-init): Don't use LFORMINFO if it's nil.
379 (byte-compile-lambda): Don't look at lexical environment unless
380 we're using lexical binding.
381 (byte-compile-defmacro): Correctly generate macros.
382
383 * emacs-lisp/byte-lexbind.el (byte-compile-unbind): Optimize the
384 dynamic-bindings-only case.
385 (byte-compile-bind): Don't special-case unused lexical variables.
386
387 * emacs-lisp/disass.el (disassemble-1): Print arg for discardN ops.
388
3892002-08-19 Miles Bader <miles@gnu.org>
390
391 * emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
392 Handle `byte-discardN-preserve-tos' pseudo-op.
393 (byte-compile-side-effect-and-error-free-ops): Add `byte-stack-ref'.
394 (byte-compile-side-effect-free-ops): Add `byte-vec-ref'.
395 (byte-optimize-lapcode): Add some cases for stack-set/ref ops.
396 Add tracking of stack-depth. Unfinished code to collapse
397 lexical-unbinding sequences.
398
399 * emacs-lisp/bytecomp.el (byte-compile-lapcode):
400 Handle `byte-discardN-preserve-tos' pseudo-op.
401 (byte-compile-top-level): If there are lexical args, output a TAG
402 op to record the initial stack-depth for the optimizer.
403
4042002-08-17 Miles Bader <miles@gnu.org>
405
406 * emacs-lisp/bytecomp.el (byte-discardN): Add byte-defop.
407 (byte-compile-lapcode): Include byte-discardN.
408 (byte-compile-lambda): Fixup closure detection.
409 (byte-compile-top-level): Handle arguments for a lexical lambda.
410 (byte-compile-lexical-variable-ref, byte-compile-variable-ref)
411 (byte-compile-variable-set): Use byte-compile-stack-set/ref.
412 (byte-compile-discard): Add new parameters NUM and PRESERVE-TOS.
413 (byte-compile-stack-ref, byte-compile-stack-set): New functions.
414 (byte-compile-push-binding-init): Get the variable list properly
415 from LFORMINFO.
416
417 * emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
418 Ignore setq'd variables we're not interested in.
419 (byte-compile-make-lambda-lexenv): Add assertion that closed-over
420 variables be heap allocated.
421 (byte-compile-closure-initial-lexenv-p): Rename from
422 byte-compile-closure-lexenv-p.
423 (byte-compile-non-stack-bindings-p): Get the variable list
424 properly from LFORMINFO.
425 (byte-compile-maybe-push-heap-environment): Handle the
426 no-closed-over-variables case correctly.
427 (byte-compile-bind): Use byte-compile-stack-set/ref.
428 Don't bother modifying INIT-LEXENV as no one will see the changes.
429 (byte-compile-unbind): Call `byte-compile-discard' to handle
430 unbinding lexical bindings.
431
432 * emacs-lisp/disass.el (disassemble-internal): Handle closures.
433 (disassemble-1): Handle new bytecodes.
434 * emacs-lisp/byte-opt.el (disassemble-offset): Handle new bytecodes.
435
4362002-06-16 Miles Bader <miles@gnu.org>
437
438 * emacs-lisp/macroexp.el (macroexp-accumulate): New macro.
439 (macroexpand-all-forms, macroexpand-all-clauses): Use it.
440 * Makefile.in (compile): Undo previous change.
441
4422002-06-14 Miles Bader <miles@gnu.org>
443
444 * Makefile.in (COMPILE_FIRST): Add `emacs-lisp/macroexp.el'.
445 (compile): Add a special case that compiles `emacs-lisp/macroexp.el'
446 with an increased max-lisp-eval-depth.
447
448 * emacs-lisp/bytecomp.el: Provide `bytecomp-preload', at the
449 beginning of the file. Require `byte-lexbind' at compile time.
450 Add a few doc string.
451 (byte-compile-push-bytecodes)
452 (byte-compile-push-bytecode-const2): New macros.
453 (byte-compile-lapcode): Use them. Do general code cleanup.
454 (byte-compile-initial-macro-environment): Expand macros in
455 byte-compile-eval before passing to byte-compile-top-level.
456 (byte-compile): Use the `byte-compile-initial-macro-environment'.
457
458 * emacs-lisp/byte-lexbind.el: Require `bytecomp-preload' instead of
459 `bytecomp'.
460 (byte-compile-bind): Use `byte-compile-dynamic-variable-bind' to bind
461 dynamic variables.
462 (byte-compile-maybe-push-heap-environment): Fix function name typo.
463
4642002-06-13 Miles Bader <miles@gnu.org>
465
466 Byte compiler lexical binding support (not finished yet):
467 * emacs-lisp/bytecomp.el: Require `macroexp'.
468 (byte-compile-lexical-environment)
469 (byte-compile-current-heap-environment)
470 (byte-compile-current-num-closures): New variables.
471 (0, 178, 179, 180, 181): New byte-opcodes.
472 (byte-compile-lapcode): Handle stack-ref/set opcodes. Signal an
473 error if a delay-output placeholder is not filled in yet.
474 (byte-compile-file-form, byte-compile): Expand all macros with
475 `macroexpand-all'.
476 (byte-compile-file-form-defsubst, byte-compile-form): Don't expand
477 macros here.
478 (byte-compile-make-lambda-lexenv): Autoload.
479 (byte-compile-lambda): Initial code for handling lexically-bound
480 arguments and closures; doesn't work yet.
481 (byte-compile-closure-code-p, byte-compile-make-closure)
482 (byte-compile-closure): New functions.
483 (byte-compile-check-variable, byte-compile-dynamic-variable-op)
484 (byte-compile-dynamic-variable-bind)
485 (byte-compile-lexical-variable-ref, byte-compile-variable-set):
baf1a55e 486 New functions.
894e369d
SM
487 (byte-compile-variable-ref): Remove second argument. Now only
488 handles real variable references (not setting or binding).
489 (byte-compile-push-unknown-constant)
490 (byte-compile-resolve-unknown-constant): New functions.
491 (byte-compile-funarg, byte-compile-funarg-2): Functions removed.
492 (byte-compile-function-form): Use either `byte-compile-constant'
493 or `byte-compile-closure'.
494 (byte-compile-setq): Use `byte-compile-variable-set' instead of
495 `byte-compile-variable-ref'.
496 (apply, mapcar, mapatoms, mapconcat, mapc, sort):
497 `byte-defop-compiler-1's removed.
498 (byte-compile-while): Make sure lexically-bound variables inside
499 the loop don't get stored in an environment outside the loop.
500 (byte-compile-compute-lforminfo): Autoload.
501 (byte-compile-push-binding-init): New function.
502 (byte-compile-let, byte-compile-let*): Handle lexical binding.
503 (byte-compile-defun): Use `byte-compile-closure' to do the work.
504 (byte-compile-defmacro): Use `byte-compile-make-closure'.
505 (byte-compile-defvar): Expand the generated call to `push' since
506 we're past macroexpansion already.
507 (byte-compile-stack-adjustment): New function.
508 (byte-compile-out): Make second arg optional. Rewrite for clarity.
509 (byte-compile-delay-out, byte-compile-delayed-out): New functions.
510
511 * emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
512 Don't expand macros here.
513
514 * emacs-lisp/macroexp.el (macroexpand-all-1): Expand defmacro forms.
515
516 * emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo)
517 (byte-compile-lforminfo-add-var)
518 (byte-compile-lforminfo-note-closure)
519 (byte-compile-compute-lforminfo)
520 (byte-compile-lforminfo-from-lambda)
521 (byte-compile-lforminfo-analyze)
522 (byte-compile-heapenv-add-accessible-env)
523 (byte-compile-heapenv-ensure-access)
524 (byte-compile-rearrange-let-clauses, byte-compile-bind)
525 (byte-compile-unbind): Fix a bunch of typos.
526
5272002-06-12 Miles Bader <miles@gnu.org>
528
529 * emacs-lisp/byte-lexbind.el, emacs-lisp/macroexp.el: New files.
530
531 * subr.el (functionp): Function removed (now a subr).
532 * help-fns.el (describe-function-1): Handle interpreted closures.
533
534;; arch-tag: bd1b5b8b-fdb2-425d-9ac2-20689fb0ee70