<feed xmlns='http://www.w3.org/2005/Atom'>
<title>emacs/src, branch scratch/bytecode-speedup</title>
<subtitle>Emacs is the extensible, customizable, self-documenting real-time display editor. 
</subtitle>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/'/>
<entry>
<title>; * src/bytecode.c (exec_byte_code): better variable naming</title>
<updated>2022-01-18T14:18:17+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-18T14:09:44+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=26d97dcae90fff210ad50077f17967b848af4849'/>
<id>26d97dcae90fff210ad50077f17967b848af4849</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Inline maybe_quit</title>
<updated>2022-01-18T14:15:12+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-15T15:23:09+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=c5b9e999d49d32395b74b18ce106b114bc205c8c'/>
<id>c5b9e999d49d32395b74b18ce106b114bc205c8c</id>
<content type='text'>
Since `maybe_quit` is called on many critical paths, inline a slightly
cheaper condition (that ignores Vinhibit_quit).

* src/eval.c (maybe_quit): Rename to `probably_quit`.
* src/lisp.h (maybe_quit): New simplified inline function.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since `maybe_quit` is called on many critical paths, inline a slightly
cheaper condition (that ignores Vinhibit_quit).

* src/eval.c (maybe_quit): Rename to `probably_quit`.
* src/lisp.h (maybe_quit): New simplified inline function.
</pre>
</div>
</content>
</entry>
<entry>
<title>Bump specpdl inline, move reallocation out of line</title>
<updated>2022-01-15T13:51:09+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-15T13:51:09+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=273d220f5da1b2abd12ff2d5b2b07661bff995b4'/>
<id>273d220f5da1b2abd12ff2d5b2b07661bff995b4</id>
<content type='text'>
The common case is just to increment `specpdl_ptr`; do that in-line,
but move the uncommon reallocation to a separate subroutine.

* src/eval.c (grow_specpdl): Now inline, most code moved...
(grow_specpdl_allocation): ...here.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The common case is just to increment `specpdl_ptr`; do that in-line,
but move the uncommon reallocation to a separate subroutine.

* src/eval.c (grow_specpdl): Now inline, most code moved...
(grow_specpdl_allocation): ...here.
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement Ffuncall in terms of funcall_general</title>
<updated>2022-01-13T17:14:43+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-12T11:05:26+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=d29877e58a8fe23e7764656371138ccab31d3ec0'/>
<id>d29877e58a8fe23e7764656371138ccab31d3ec0</id>
<content type='text'>
* src/eval.c (funcall_general, Ffuncall): Delegate the actual work in
Ffuncall to funcall_general which does exactly this.
This slows down some less used function call paths by a small amount
but the code duplication was just silly.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/eval.c (funcall_general, Ffuncall): Delegate the actual work in
Ffuncall to funcall_general which does exactly this.
This slows down some less used function call paths by a small amount
but the code duplication was just silly.
</pre>
</div>
</content>
</entry>
<entry>
<title>Don't crash on unbalanced unwinds in debug mode</title>
<updated>2022-01-12T16:18:48+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-12T16:18:48+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=7875ce7365403522c6aa53c0ac892a6edb7403bd'/>
<id>7875ce7365403522c6aa53c0ac892a6edb7403bd</id>
<content type='text'>
* src/bytecode.c (exec_byte_code):
Restore the previous graceful error (instead of a hard crash) when the
bytecode doesn't unwind properly, but only when building with
debugging (NDEBUG not defined, checking enabled, or BYTE_CODE_SAFE
enabled).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/bytecode.c (exec_byte_code):
Restore the previous graceful error (instead of a hard crash) when the
bytecode doesn't unwind properly, but only when building with
debugging (NDEBUG not defined, checking enabled, or BYTE_CODE_SAFE
enabled).
</pre>
</div>
</content>
</entry>
<entry>
<title>Open-code aref and aset in bytecode interpreter</title>
<updated>2022-01-11T14:22:48+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-02T11:19:54+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=1e439fe19aee2b3729d22a00ee416293c4e9c171'/>
<id>1e439fe19aee2b3729d22a00ee416293c4e9c171</id>
<content type='text'>
* src/bytecode.c (exec_byte_code): Inline aref and aset for
vectors and records, since this is important for code that makes heavy
use of arrays and/or objects.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/bytecode.c (exec_byte_code): Inline aref and aset for
vectors and records, since this is important for code that makes heavy
use of arrays and/or objects.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove the unused unbind-all bytecode</title>
<updated>2022-01-11T14:22:48+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-02T10:35:16+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=1eacfb3c888764908d2ee421e16c020e7343b5a1'/>
<id>1eacfb3c888764908d2ee421e16c020e7343b5a1</id>
<content type='text'>
It was implemented but never generated, originally intended for
TCO in the pre-lexbind era (which was semantically dubious anyway).
Removing it speeds up the interpreter because there is no longer any
need for the outermost `count` variable unless checking is enabled.

* lisp/emacs-lisp/bytecomp.el:
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst):
* src/bytecode.c (BYTE_CODES, exec_byte_code):
Remove definition and implementation of unbind-all, freeing up the opcode
for other purposes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It was implemented but never generated, originally intended for
TCO in the pre-lexbind era (which was semantically dubious anyway).
Removing it speeds up the interpreter because there is no longer any
need for the outermost `count` variable unless checking is enabled.

* lisp/emacs-lisp/bytecomp.el:
* lisp/emacs-lisp/comp.el (comp-limplify-lap-inst):
* src/bytecode.c (BYTE_CODES, exec_byte_code):
Remove definition and implementation of unbind-all, freeing up the opcode
for other purposes.
</pre>
</div>
</content>
</entry>
<entry>
<title>Move a runtime interpreter check to ENABLE_CHECKING</title>
<updated>2022-01-11T14:22:48+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-02T10:15:41+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=1dca615cf9132c59728bba6fd8f3e50498bf2a27'/>
<id>1dca615cf9132c59728bba6fd8f3e50498bf2a27</id>
<content type='text'>
* src/bytecode.c (exec_byte_code): Turn error condition into eassert.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* src/bytecode.c (exec_byte_code): Turn error condition into eassert.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove nil check in exec_byte_code</title>
<updated>2022-01-11T14:22:48+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-01T21:39:17+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=09b5ed93b193c4480c3c5aa7483b70348821e23b'/>
<id>09b5ed93b193c4480c3c5aa7483b70348821e23b</id>
<content type='text'>
Since we pass no arguments to a non-lexbind bytecode function, we can
specify its arity as 0 instead of nil and save a test and branch.

* src/bytecode.c (Fbyte_code, exec_byte_code):
* src/eval.c (fetch_and_exec_byte_code, funcall_lambda):
* src/lisp.h:
Change the args_template parameter type to ptrdiff_t, since it is now
always a small integer, in exec_byte_code and
fetch_and_exec_byte_code, all callers adjusted.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since we pass no arguments to a non-lexbind bytecode function, we can
specify its arity as 0 instead of nil and save a test and branch.

* src/bytecode.c (Fbyte_code, exec_byte_code):
* src/eval.c (fetch_and_exec_byte_code, funcall_lambda):
* src/lisp.h:
Change the args_template parameter type to ptrdiff_t, since it is now
always a small integer, in exec_byte_code and
fetch_and_exec_byte_code, all callers adjusted.
</pre>
</div>
</content>
</entry>
<entry>
<title>; * src/bytecode.c (exec_byte_code): Cosmetic improvement</title>
<updated>2022-01-11T14:22:48+00:00</updated>
<author>
<name>Mattias Engdegård</name>
</author>
<published>2022-01-01T14:33:27+00:00</published>
<link rel='alternate' type='text/html' href='https://jason.zzq.org/git/emacs/commit/?id=02ff30bfbb2b7c731c96110af84d2585211125ba'/>
<id>02ff30bfbb2b7c731c96110af84d2585211125ba</id>
<content type='text'>
Implement point_max in the same way as point_min.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implement point_max in the same way as point_min.
</pre>
</div>
</content>
</entry>
</feed>
