emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is byte-compiled code supposed to call `make-byte-code'?


From: Paul Pogonyshev
Subject: Re: Is byte-compiled code supposed to call `make-byte-code'?
Date: Wed, 25 May 2016 10:53:36 +0200

Andreas Schwab wrote:
> But it isn't a constant, it depends on the function's argument.

You are right, didn't think about it. However, given that it is a
repetetive process, shouldn't all constant parts of it be moved to C
level instead of bytecode, as an optimization? E.g. add (make-closure
descriptor &rest constants), where descriptor would include the actual
bytecode, arglist, depth and constants inherited from outer closure?
Then `xxx' would disassemble to something like

0       constant  mapcar
1       constant  make-closure
2       constant  <<descriptor>>
3       stack-ref <<fn>>
5       call      2
6       constant  (1 2 3)
7       call      2
9       return

Thus, bytecode size would decrease for closure-heavy code and speed
likely improve as well.

Paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]