This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Boilerplate code replaced in Python/ceval.c
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: akuchling, amaury.forgeotdarc, knicker.kicker, pitrou, rhettinger
Priority: low Keywords: patch

Created on 2011-03-17 07:04 by knicker.kicker, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
20110317_ceval.patch knicker.kicker, 2011-03-17 07:04
Messages (5)
msg131230 - (view) Author: knickerkicker (knicker.kicker) Date: 2011-03-17 07:04
Replaced boilerplate implementations of several BINARY_* and INPLACE_* opcodes with two macros. The result shaves off 154 lines from Python/ceval.c.
msg131250 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2011-03-17 14:01
Hmm, this kind of macros make it difficult to step line by line in a debugger. From this point of view, an inlined function would be better, I'm not sure if this can have a performance impact though.
msg131283 - (view) Author: knickerkicker (knicker.kicker) Date: 2011-03-17 21:09
Creating a inline function would require passing the stackpointer variable so that the TOP() and POP() macros continue working, and creating
variables for u, v and x. I am not sure if that will not have a performance impact - ideally it shouldn't, but can we trust the compilers to see what we're upto?

Also, the DISPATCH() macro will still need to be outside the inline function.
msg131285 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-03-17 21:29
-1

I think this will make the code harder to understand and maintain.
msg246226 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2015-07-03 22:12
Closing, because neither Amaury nor Raymond likes the idea.  Thanks for your work, anyway!
History
Date User Action Args
2022-04-11 14:57:14adminsetgithub: 55791
2015-07-03 22:12:16akuchlingsetstatus: open -> closed

nosy: + akuchling
messages: + msg246226

resolution: rejected
stage: resolved
2014-10-04 21:35:54francismbsettype: enhancement
2011-03-17 21:29:33rhettingersetpriority: normal -> low
nosy: rhettinger, amaury.forgeotdarc, pitrou, knicker.kicker
versions: - Python 3.1, Python 3.2, Python 3.4
2011-03-17 21:29:07rhettingersetnosy: + rhettinger
messages: + msg131285
2011-03-17 21:09:33knicker.kickersetmessages: + msg131283
2011-03-17 14:16:27pitrousetnosy: + pitrou
2011-03-17 14:01:23amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg131250
2011-03-17 07:04:02knicker.kickercreate