[New-bugs-announce] [issue31785] Move instruction code blocks to separate file

pdox report at bugs.python.org
Fri Oct 13 19:58:24 EDT 2017

New submission from pdox <pdox at alum.mit.edu>:

I'd like to move all instruction code (the code inside a TARGET(NAME) block) from Python/ceval.c to a new file, Python/instructions.h. The new file will contain only instruction bodies (prefixed by related helper functions/macros).

Eval-context macros (e.g. TARGET, DISPATCH, TOP, PUSH, POP, etc) will not be moved to instructions.h, but will be expected to be available (defined by the #includer).

ceval.c will define the eval-context macros in the same way, and #include "instructions.h", inside the body of _PyEval_EvalFrameDefault. The code emitted should remain exactly the same.

The benefit of this change, is that it becomes easy to produce alternative implementations of EvalFrame which reuse the same instruction code, but with changes to the evaluation context or dispatch mechanism. In particular, after this change, I hope to experiment with adding a cross-platform subroutine-threading code evaluator. (for performance testing)

components: Interpreter Core
messages: 304370
nosy: pdox
priority: normal
severity: normal
status: open
title: Move instruction code blocks to separate file
type: enhancement
versions: Python 3.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list