File: byte-opt.el.html

========================================================================
"No matter how hard you try, you can't make a racehorse out of a pig.
You can, however, make a faster pig."

Or, to put it another way, the Emacs byte compiler is a VW Bug. This code makes it be a VW Bug with fuel injection and a turbocharger... You're still not going to make it go faster than 70 mph, but it might be easier to get it there.

TO DO:

;; An awful lot of functions always return a non-nil value. If they're
;; error free also they may act as true-constants.

(disassemble (lambda (x) (and (point) (foo))))

;; When
;; - all but one arguments to a function are constant
;; - the non-constant argument is an if-expression (cond-expression?)
;; then the outer function can be distributed. If the guarding
;; condition is side-effect-free [assignment-free] then the other
;; arguments may be any expressions. Since, however, the code size
;; can increase this way they should be "simple". Compare:

(disassemble (lambda (x) (eq (if (point) 'a 'b) 'c)))
(disassemble (lambda (x) (if (point) (eq 'a 'c) (eq 'b 'c))))

;; (car (cons A B)) -> (prog1 A B)
(disassemble (lambda (x) (car (cons (foo) 42))))

;; (cdr (cons A B)) -> (progn A B)
(disassemble (lambda (x) (cdr (cons 42 (foo)))))

;; (car (list A B ...)) -> (prog1 A B ...)
(disassemble (lambda (x) (car (list (foo) 42 (bar)))))

;; (cdr (list A B ...)) -> (progn A (list B ...))
(disassemble (lambda (x) (cdr (list 42 (foo) (bar)))))

Defined variables (6)

byte-after-unbind-opsByte-codes that can be moved past an unbind.
byte-optimize--aliased-varsList of variables which may be aliased by other lexical variables.
byte-optimize--dynamic-varsList of variables declared as dynamic during optimization.
byte-optimize--inhibit-outside-loop-constpropIf t, don’t propagate values for variables declared outside the inner loop.
byte-optimize--lexvarsLexical variables in scope, in reverse order of declaration.
byte-optimize--vars-outside-loopAlist of variables lexically bound outside the innermost ‘while’ loop.

Defined functions (62)

byte-compile-inline-expand(FORM)
byte-compile-log-lap(FORMAT-STRING &rest ARGS)
byte-compile-log-lap-1(FORMAT &rest ARGS)
byte-compile-nilconstp(FORM)
byte-compile-trueconstp(FORM)
byte-decompile-bytecode(BYTES CONSTVEC)
byte-decompile-bytecode-1(BYTES CONSTVEC &optional MAKE-SPLICEABLE)
byte-opt--arith-reduce(OP ACCUM ARGS)
byte-opt--bool-value-form(FORM)
byte-opt--fget(F PROP)
byte-opt--nary-comparison(FORM)
byte-opt--negate(FORM)
byte-optimize--constant-symbol-p(EXPR)
byte-optimize--fixnump(O)
byte-optimize--pcase(EXP &rest CASES)
byte-optimize--rename-var(VAR NEW-VAR FORM)
byte-optimize--rename-var-body(VAR NEW-VAR BODY)
byte-optimize--substitutable-p(EXPR)
byte-optimize-and(FORM)
byte-optimize-append(FORM)
byte-optimize-apply(FORM)
byte-optimize-assoc(FORM)
byte-optimize-associative-math(FORM)
byte-optimize-assq(FORM)
byte-optimize-binary-predicate(FORM)
byte-optimize-body(FORMS ALL-FOR-EFFECT)
byte-optimize-concat(FORM)
byte-optimize-cond(FORM)
byte-optimize-cons(FORM)
byte-optimize-constant-args(FORM)
byte-optimize-divide(FORM)
byte-optimize-eq(FORM)
byte-optimize-equal(FORM)
byte-optimize-form(FORM &optional FOR-EFFECT)
byte-optimize-form-code-walker(FORM FOR-EFFECT)
byte-optimize-funcall(FORM)
byte-optimize-identity(FORM)
byte-optimize-if(FORM)
byte-optimize-inline-handler(FORM)
byte-optimize-lapcode(LAP &optional FOR-EFFECT)
byte-optimize-let-form(HEAD FORM FOR-EFFECT)
byte-optimize-letX(FORM)
byte-optimize-list(FORM)
byte-optimize-member(FORM)
byte-optimize-memq(FORM)
byte-optimize-min-max(FORM)
byte-optimize-minus(FORM)
byte-optimize-multiply(FORM)
byte-optimize-nconc(FORM)
byte-optimize-not(FORM)
byte-optimize-nth(FORM)
byte-optimize-nthcdr(FORM)
byte-optimize-one-form(FORM &optional FOR-EFFECT)
byte-optimize-or(FORM)
byte-optimize-plus(FORM)
byte-optimize-quote(FORM)
byte-optimize-set(FORM)
byte-optimize-string-greaterp(FORM)
byte-optimize-while(FORM)
bytecomp--log-lap-arg(ARG)
byteopt--eval-const(EXPR)
disassemble-offset(BYTES)

Defined faces (0)