Skip to content

bpo-43693: Compute deref offsets in compiler - #25152

Merged
ericsnowcurrently merged 12 commits into
python:mainfrom
faster-cpython:compile-deref-offsets-in-compiler
Jun 4, 2021
Merged

ericsnowcurrently merged 12 commits into
python:mainfrom
faster-cpython:compile-deref-offsets-in-compiler

Conversation

@markshannon

@markshannon markshannon commented Apr 2, 2021 •

Copy link
Copy Markdown
Member

Merges locals and cells into a single array.
Saves a pointer in the interpreter and means that we don't need the LOAD_CLOSURE opcode any more

https://bugs.python.org/issue43693

Comment thread Python/ceval.c Resolved

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update also Doc/library/dis.rst.

@serhiy-storchaka

Copy link
Copy Markdown
Member

Please don't forget to bump a bytecode magic number and add a line to the bytecode history list.

@ericsnowcurrently
ericsnowcurrently force-pushed the compile-deref-offsets-in-compiler branch 2 times, most recently from 6e4b212 to 8045347 Compare April 24, 2021 00:20
@ericsnowcurrently
ericsnowcurrently force-pushed the compile-deref-offsets-in-compiler branch from 16546b6 to 6174448 Compare May 7, 2021 20:42
@markshannon

Copy link
Copy Markdown
Member Author

Eric is working on a PR to implement faster-cpython/ideas#41, so I'm closing this.

@ericsnowcurrently
ericsnowcurrently force-pushed the compile-deref-offsets-in-compiler branch from 6174448 to 46d531e Compare June 3, 2021 16:41
@gvanrossum

Copy link
Copy Markdown
Member

(What are you doing here?)

@ericsnowcurrently

Copy link
Copy Markdown
Member

This change was always going to be included. I figured it would still be cleaner if it were its own PR. It also makes the subsequent PR a little smaller. (Plus it was already reviewed, between Mark and me, so I'll merge it today. 🙂)

@ericsnowcurrently
ericsnowcurrently merged commit b2bf2bc into python:main Jun 4, 2021
pablogsal added a commit to pablogsal/cpython that referenced this pull request Jun 4, 2021
pablogsal added a commit that referenced this pull request Jun 4, 2021
* Revert "bpo-43693: Compute deref offsets in compiler (gh-25152)"

This reverts commit b2bf2bc.

* Revert "bpo-43693: Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388)"

This reverts commit 2c1e258.

These two commits are breaking the refleak buildbots.
ericsnowcurrently added a commit to ericsnowcurrently/cpython that referenced this pull request Jun 7, 2021
These were reverted in pythonGH-26530 (commit 17c4edc).

* Compute deref offsets in compiler (pythongh-25152)
* Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (pythongh-26388)
ericsnowcurrently added a commit that referenced this pull request Jun 7, 2021
These were reverted in gh-26530 (commit 17c4edc) due to refleaks.

* 2c1e258 - Compute deref offsets in compiler (gh-25152)
* b2bf2bc - Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388)

This change fixes the refleaks.

https://bugs.python.org/issue43693
@ericsnowcurrently
ericsnowcurrently deleted the compile-deref-offsets-in-compiler branch June 7, 2021 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

6 participants