gpgscm: Reduce opcode dispatch overhead.
authorJustus Winter <justus@g10code.com>
Thu, 10 Nov 2016 10:47:08 +0000 (11:47 +0100)
committerJustus Winter <justus@g10code.com>
Thu, 10 Nov 2016 13:57:07 +0000 (14:57 +0100)
commitd3a98ff5bc972a4c9b01b9e5338a4a59b5b4ac48
tree1120ba6d7f8317ce19d8a94315becabf783e8c5f
parent568cfcde45a0d6c456d8f8be1ea0e408416badad
gpgscm: Reduce opcode dispatch overhead.

* tests/gpgscm/scheme.c (s_thread_to): New macro.
(CASE): Likewise.
(opexe_[0-6]): Use 'CASE' instead of 'case' statements, replace
's_goto' with 's_thread_to' where applicable.
--

This is a straight-forward optimization that replaces 's_goto' in
certain cases.  Instead of returning to the calling function, and
dispatching the next opcode, we can jump to the opcode handler.

Signed-off-by: Justus Winter <justus@g10code.com>
tests/gpgscm/scheme.c
tests/gpgscm/scheme.h