ChangeLog 13.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2011-02-11  Stefan Monnier  <monnier@iro.umontreal.ca>

	* emacs-lisp/cconv.el (cconv-closure-convert): Drop `toplevel' arg.
	(cconv-closure-convert-toplevel): Remove.
	(cconv-lookup-let): New fun.
	(cconv-closure-convert-rec): Don't bother with defs-are-legal.
	Use :fun-body to handle special forms that require closing their forms.

	* emacs-lisp/bytecomp.el (byte-compile-file-form, byte-compile):
	Use cconv-closure-convert instead of cconv-closure-convert-toplevel.
	(byte-compile-lambda, byte-compile-make-closure):
	* emacs-lisp/byte-lexbind.el (byte-compile-maybe-push-heap-environment):
	Make sure cconv did its job.

	* emacs-lisp/byte-opt.el (byte-optimize-lapcode): Check stack-depth
	before using it.

	* dired.el (dired-desktop-buffer-misc-data): Don't use a dynamic var as
	function argument.

21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
2011-02-11  Stefan Monnier  <monnier@iro.umontreal.ca>

	* emacs-lisp/bytecomp.el (byte-compile-lambda): Fix `fun' that was not
	renamed to `bytecomp-fun'.

	* emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
	Understand the :fun-body case for catch, save-window-excursion, and
	condition-case.
	(byte-compile-maybe-push-heap-environment): No need when nclosures is
	zero and byte-compile-current-num-closures is -1.

	* emacs-lisp/cconv.el (cconv-not-lexical-var-p): New function.
	(cconv-freevars): Use it.
	(cconv-closure-convert-rec): Avoid `position'.
	(cconv-analyse-function): New function.
	(cconv-analyse-form): Use it.  `inclosure' can't be nil any more.
	Check lexical vars at let-binding time rather than when referenced.
	For defuns to be in an empty environment and lambdas to take lexical args.
	Pay attention to the need to build closures in catch, unwind-protect,
	save-window-excursion, condition-case, and track-mouse.
	Fix defconst/defvar handling.

43 44 45 46 47 48 49 50 51 52 53 54 55
2011-02-10  Stefan Monnier  <monnier@iro.umontreal.ca>

	* emacs-lisp/cconv.el (cconv-mutated, cconv-captured)
	(cconv-captured+mutated, cconv-lambda-candidates): Fix up declaration.
	(cconv-freevars): Minor cleanup.  Fix handling of the error var in
	condition-case.

	* emacs-lisp/bytecomp.el (byte-compile-catch)
	(byte-compile-unwind-protect, byte-compile-track-mouse)
	(byte-compile-condition-case, byte-compile-save-window-excursion):
	Provide a :fun-body alternative, so that info can be propagated from the
	surrounding context, as is the case for lexical scoping.

56 57 58 59 60 61 62 63 64 65 66 67
2011-02-10  Igor Kuzmin  <kuzminig@iro.umontreal.ca>

	* emacs-lisp/cconv.el: New file.
	* emacs-lisp/bytecomp.el: Use cconv.
	(byte-compile-file-form, byte-compile):
	Call cconv-closure-convert-toplevel when requested.
	* server.el:
	* mpc.el:
	* emacs-lisp/pcase.el:
	* doc-view.el:
	* dired.el: Use lexical-binding.

68 69 70 71
2010-12-27  Stefan Monnier  <monnier@iro.umontreal.ca>

	* emacs-lisp/bytecomp.el (byte-compile-track-mouse): Don't use #'.

72 73 74 75 76 77 78
2010-12-15  Stefan Monnier  <monnier@iro.umontreal.ca>

	* emacs-lisp/edebug.el (edebug-eval-defun, edebug-eval):
	* emacs-lisp/lisp-mode.el (eval-last-sexp-1, eval-defun-1):
	* ielm.el (ielm-eval-input):
	* simple.el (eval-expression): Use new eval arg to obey lexical-binding.

79 80 81 82
2010-12-14  Stefan Monnier  <monnier@iro.umontreal.ca>

	* emacs-lisp/bytecomp.el (byte-compile-condition-case): Use push.

83 84 85 86
2010-12-13  Stefan Monnier  <monnier@iro.umontreal.ca>

	* subr.el (with-lexical-binding): Remove.

87 88 89 90 91
2010-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>

	* emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
	specialp -> special-variable-p.

92 93 94 95 96 97
2010-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>

	* emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment):
	Don't macroexpand before evaluating in eval-and-compile, in case
	`body's macro expansion uses macros and functions defined in itself.

98 99 100 101 102 103 104
2010-06-14  Stefan Monnier  <monnier@iro.umontreal.ca>

	* emacs-lisp/bytecomp.el (byte-compile-check-variable):
	Update byte-compile-not-obsolete-var to byte-compile-not-obsolete-vars.

	* Makefile.in (.el.elc): Increase max-lisp-eval-depth.

Stefan Monnier's avatar
Stefan Monnier committed
105
2006-12-04  Miles Bader  <miles@gnu.org>
106

Stefan Monnier's avatar
Stefan Monnier committed
107 108
	* Makefile.in (COMPILE_FIRST_STACK_DEPTH): New variable.
	(compile, compile-always): Use it.
109

Stefan Monnier's avatar
Stefan Monnier committed
110
2005-10-24  Miles Bader  <miles@gnu.org>
111

Stefan Monnier's avatar
Stefan Monnier committed
112
	* subr.el (functionp): Re-remove.
113

Stefan Monnier's avatar
Stefan Monnier committed
114 115 116 117
	* emacs-lisp/bytecomp.el (byte-compile-closure): Add optional
	ADD-LAMBDA argument, which we just pass to `byte-compile-lambda'.
	(byte-compile-defun): Use ADD-LAMBDA arg to `byte-compile-closure'
	instead of adding lambda ourselves.
Eli Zaretskii's avatar
Eli Zaretskii committed
118

Stefan Monnier's avatar
Stefan Monnier committed
119
2004-08-09  Miles Bader  <miles@gnu.org>
Eli Zaretskii's avatar
Eli Zaretskii committed
120

Stefan Monnier's avatar
Stefan Monnier committed
121
	Changes from merging the funvec patch:
122

Stefan Monnier's avatar
Stefan Monnier committed
123 124
	* emacs-lisp/bytecomp.el (byte-compile-make-closure): Use `curry'
	instead of `vector' to create compiled closures.
125

Stefan Monnier's avatar
Stefan Monnier committed
126
	Merge funvec patch.
127

Stefan Monnier's avatar
Stefan Monnier committed
128
2004-04-29  Miles Bader  <miles@gnu.org>
129

Stefan Monnier's avatar
Stefan Monnier committed
130 131 132
	* emacs-lisp/bytecomp.el (byte-compile-top-level): Add new entries
	to `byte-compile-lexical-environment' at the start, not end.
	(byte-compile-delay-out): Correctly default STACK-ADJUST to zero.
133

Stefan Monnier's avatar
Stefan Monnier committed
134 135
	* emacs-lisp/byte-opt.el (byte-opt-update-stack-params):
	Don't crash on no-op lapcode entries (car is nil).
136

Stefan Monnier's avatar
Stefan Monnier committed
137 138
	* emacs-lisp/byte-lexbind.el (byte-compile-make-lambda-lexenv):
	Push a lexvar onto lexenv, not a vinfo!
139

Stefan Monnier's avatar
Stefan Monnier committed
140
2004-04-11  Miles Bader  <miles@gnu.org>
141

Stefan Monnier's avatar
Stefan Monnier committed
142 143
	* emacs-lisp/bytecomp.el (byte-compile-top-level):
	Correctly analyze lexically-bound arguments.
144

Stefan Monnier's avatar
Stefan Monnier committed
145 146
	* emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
	Use `append' instead of `nconc'.
147

Stefan Monnier's avatar
Stefan Monnier committed
148 149 150 151 152
	* emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo):
	Don't use backquote to make a mutable data-structure.
	(byte-compile-lvarinfo-num-refs, byte-compile-lvarinfo-num-sets):
	Rename to use `num-' instead of `num'.
	(byte-compile-make-lambda-lexenv): Adjust accordingly.
153

Stefan Monnier's avatar
Stefan Monnier committed
154
2004-04-10  Miles Bader  <miles@gnu.org>
155

Stefan Monnier's avatar
Stefan Monnier committed
156 157
	* emacs-lisp/byte-lexbind.el (byte-compile-compute-lforminfo):
	Look at variable's global specialp state too.
158

Stefan Monnier's avatar
Stefan Monnier committed
159
2004-04-09  Miles Bader  <miles@gnu.org>
160

Stefan Monnier's avatar
Stefan Monnier committed
161 162 163 164
	* emacs-lisp/byte-opt.el (byte-optimize-lapcode):
	Default initial-stack-depth to 0.
	(byte-optimize-lapcode): Discard the right number of values in
	the stack-set+discard-->discard optimization.
165

Stefan Monnier's avatar
Stefan Monnier committed
166
2004-04-02  Miles Bader  <miles@gnu.org>
167

Stefan Monnier's avatar
Stefan Monnier committed
168 169
	* emacs-lisp/lisp-mode.el (eval-last-sexp-1): Setup the lexical
	environment if lexical-binding is enabled.
170

Stefan Monnier's avatar
Stefan Monnier committed
171
2003-10-14  Miles Bader  <miles@gnu.org>
172

Stefan Monnier's avatar
Stefan Monnier committed
173 174
	* emacs-lisp/macroexp.el (macroexpand-all-1): Special-case
	`backquote-list*' to avoid stack overflows.
175

Stefan Monnier's avatar
Stefan Monnier committed
176
2003-04-04  Miles Bader  <miles@gnu.org>
177

Stefan Monnier's avatar
Stefan Monnier committed
178
	* help-fns.el (help-function-arglist): Handle interpreted closures.
179

Stefan Monnier's avatar
Stefan Monnier committed
180
2002-11-20  Miles Bader  <miles@gnu.org>
181

Stefan Monnier's avatar
Stefan Monnier committed
182 183 184 185
	* emacs-lisp/bytecomp.el (byte-compile-stack-adjustment):
	Correctly handle discardN* operators.
	* emacs-lisp/byte-opt.el (byte-optimize-lapcode): Fix stack-depth
	tracking errors.
186

Stefan Monnier's avatar
Stefan Monnier committed
187
2002-08-26  Miles Bader  <miles@gnu.org>
188

Stefan Monnier's avatar
Stefan Monnier committed
189 190
	* international/mule.el (make-char): Macroexpand call to
	charset-id constructed by `byte-compile' hook.
191

Stefan Monnier's avatar
Stefan Monnier committed
192
	* emacs-lisp/macroexp.el (macroexpand-all-1): Expand defconst value.
193

Stefan Monnier's avatar
Stefan Monnier committed
194 195 196 197
	* emacs-lisp/byte-opt.el (byte-opt-update-stack-params): New macro.
	(byte-optimize-lapcode): Keep track of stack-depth in final pass too.
	Add more optimizations for lexical binding.
	(byte-compile-inline-expand): Macroexpand result of inlining.
198

Stefan Monnier's avatar
Stefan Monnier committed
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
	* emacs-lisp/bytecomp.el (byte-compile-lambda): Update call to
	byte-compile-closure-initial-lexenv-p.
	(byte-discardN-preserve-tos): Alias to byte-discardN.
	(byte-compile-push-binding-init): Don't push unused variables on
	init-lexenv.
	(byte-compile-push-binding-init): Don't use LFORMINFO if it's nil.
	(byte-compile-lambda): Don't look at lexical environment unless
	we're using lexical binding.
	(byte-compile-defmacro): Correctly generate macros.

	* emacs-lisp/byte-lexbind.el (byte-compile-unbind): Optimize the
	dynamic-bindings-only case.
	(byte-compile-bind): Don't special-case unused lexical variables.

	* emacs-lisp/disass.el (disassemble-1): Print arg for discardN ops.

2002-08-19  Miles Bader  <miles@gnu.org>

	* emacs-lisp/byte-opt.el (byte-decompile-bytecode-1):
	Handle `byte-discardN-preserve-tos' pseudo-op.
	(byte-compile-side-effect-and-error-free-ops): Add `byte-stack-ref'.
	(byte-compile-side-effect-free-ops): Add `byte-vec-ref'.
	(byte-optimize-lapcode): Add some cases for stack-set/ref ops.
	Add tracking of stack-depth.  Unfinished code to collapse
	lexical-unbinding sequences.

	* emacs-lisp/bytecomp.el (byte-compile-lapcode):
	Handle `byte-discardN-preserve-tos' pseudo-op.
	(byte-compile-top-level): If there are lexical args, output a TAG
	op to record the initial stack-depth for the optimizer.

2002-08-17  Miles Bader  <miles@gnu.org>

	* emacs-lisp/bytecomp.el (byte-discardN): Add byte-defop.
	(byte-compile-lapcode): Include byte-discardN.
	(byte-compile-lambda): Fixup closure detection.
	(byte-compile-top-level): Handle arguments for a lexical lambda.
	(byte-compile-lexical-variable-ref, byte-compile-variable-ref)
	(byte-compile-variable-set): Use byte-compile-stack-set/ref.
	(byte-compile-discard): Add new parameters NUM and PRESERVE-TOS.
	(byte-compile-stack-ref, byte-compile-stack-set): New functions.
	(byte-compile-push-binding-init): Get the variable list properly
	from LFORMINFO.

	* emacs-lisp/byte-lexbind.el (byte-compile-lforminfo-analyze):
	Ignore setq'd variables we're not interested in.
	(byte-compile-make-lambda-lexenv): Add assertion that closed-over
	variables be heap allocated.
	(byte-compile-closure-initial-lexenv-p): Rename from
	byte-compile-closure-lexenv-p.
	(byte-compile-non-stack-bindings-p): Get the variable list
	properly from LFORMINFO.
	(byte-compile-maybe-push-heap-environment): Handle the
	no-closed-over-variables case correctly.
	(byte-compile-bind): Use byte-compile-stack-set/ref.
	Don't bother modifying INIT-LEXENV as no one will see the changes.
	(byte-compile-unbind): Call `byte-compile-discard' to handle
	unbinding lexical bindings.

	* emacs-lisp/disass.el (disassemble-internal): Handle closures.
	(disassemble-1): Handle new bytecodes.
	* emacs-lisp/byte-opt.el (disassemble-offset): Handle new bytecodes.

2002-06-16  Miles Bader  <miles@gnu.org>

	* emacs-lisp/macroexp.el (macroexp-accumulate): New macro.
	(macroexpand-all-forms, macroexpand-all-clauses): Use it.
	* Makefile.in (compile): Undo previous change.

2002-06-14  Miles Bader  <miles@gnu.org>

	* Makefile.in (COMPILE_FIRST): Add `emacs-lisp/macroexp.el'.
	(compile): Add a special case that compiles `emacs-lisp/macroexp.el'
	with an increased max-lisp-eval-depth.

	* emacs-lisp/bytecomp.el: Provide `bytecomp-preload', at the
	beginning of the file.  Require `byte-lexbind' at compile time.
	Add a few doc string.
	(byte-compile-push-bytecodes)
	(byte-compile-push-bytecode-const2): New macros.
	(byte-compile-lapcode): Use them.  Do general code cleanup.
	(byte-compile-initial-macro-environment): Expand macros in
	byte-compile-eval before passing to byte-compile-top-level.
	(byte-compile): Use the `byte-compile-initial-macro-environment'.

	* emacs-lisp/byte-lexbind.el: Require `bytecomp-preload' instead of
	`bytecomp'.
	(byte-compile-bind): Use `byte-compile-dynamic-variable-bind' to bind
	dynamic variables.
	(byte-compile-maybe-push-heap-environment): Fix function name typo.

2002-06-13  Miles Bader  <miles@gnu.org>

	Byte compiler lexical binding support (not finished yet):
	* emacs-lisp/bytecomp.el: Require `macroexp'.
	(byte-compile-lexical-environment)
	(byte-compile-current-heap-environment)
	(byte-compile-current-num-closures): New variables.
	(0, 178, 179, 180, 181): New byte-opcodes.
	(byte-compile-lapcode): Handle stack-ref/set opcodes.  Signal an
	error if a delay-output placeholder is not filled in yet.
	(byte-compile-file-form, byte-compile): Expand all macros with
	`macroexpand-all'.
	(byte-compile-file-form-defsubst, byte-compile-form): Don't expand
	macros here.
	(byte-compile-make-lambda-lexenv): Autoload.
	(byte-compile-lambda): Initial code for handling lexically-bound
	arguments and closures; doesn't work yet.
	(byte-compile-closure-code-p, byte-compile-make-closure)
	(byte-compile-closure): New functions.
	(byte-compile-check-variable, byte-compile-dynamic-variable-op)
	(byte-compile-dynamic-variable-bind)
	(byte-compile-lexical-variable-ref, byte-compile-variable-set):
312
	New functions.
Stefan Monnier's avatar
Stefan Monnier committed
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360
	(byte-compile-variable-ref): Remove second argument.  Now only
	handles real variable references (not setting or binding).
	(byte-compile-push-unknown-constant)
	(byte-compile-resolve-unknown-constant): New functions.
	(byte-compile-funarg, byte-compile-funarg-2): Functions removed.
	(byte-compile-function-form): Use either `byte-compile-constant'
	or `byte-compile-closure'.
	(byte-compile-setq): Use `byte-compile-variable-set' instead of
	`byte-compile-variable-ref'.
	(apply, mapcar, mapatoms, mapconcat, mapc, sort):
	`byte-defop-compiler-1's removed.
	(byte-compile-while): Make sure lexically-bound variables inside
	the loop don't get stored in an environment outside the loop.
	(byte-compile-compute-lforminfo): Autoload.
	(byte-compile-push-binding-init): New function.
	(byte-compile-let, byte-compile-let*): Handle lexical binding.
	(byte-compile-defun): Use `byte-compile-closure' to do the work.
	(byte-compile-defmacro): Use `byte-compile-make-closure'.
	(byte-compile-defvar): Expand the generated call to `push' since
	we're past macroexpansion already.
	(byte-compile-stack-adjustment): New function.
	(byte-compile-out): Make second arg optional.  Rewrite for clarity.
	(byte-compile-delay-out, byte-compile-delayed-out): New functions.

	* emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
	Don't expand macros here.

	* emacs-lisp/macroexp.el (macroexpand-all-1): Expand defmacro forms.

	* emacs-lisp/byte-lexbind.el (byte-compile-make-lvarinfo)
	(byte-compile-lforminfo-add-var)
	(byte-compile-lforminfo-note-closure)
	(byte-compile-compute-lforminfo)
	(byte-compile-lforminfo-from-lambda)
	(byte-compile-lforminfo-analyze)
	(byte-compile-heapenv-add-accessible-env)
	(byte-compile-heapenv-ensure-access)
	(byte-compile-rearrange-let-clauses, byte-compile-bind)
	(byte-compile-unbind): Fix a bunch of typos.

2002-06-12  Miles Bader  <miles@gnu.org>

	* emacs-lisp/byte-lexbind.el, emacs-lisp/macroexp.el: New files.

	* subr.el (functionp): Function removed (now a subr).
	* help-fns.el (describe-function-1): Handle interpreted closures.

;; arch-tag: bd1b5b8b-fdb2-425d-9ac2-20689fb0ee70