GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-43693: Compute deref offsets in compiler by markshannon · Pull Request #25152 · python/cpython

Conversation

@markshannon

@markshannon markshannon commented Apr 2, 2021 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Apr 2, 2021
@bedevere-bot bedevere-bot added the awaiting core review label Apr 2, 2021
@ericsnowcurrently ericsnowcurrently mentioned this pull request Apr 5, 2021
Offset cell variables from the base of locals faster-cpython/ideas#37
Closed
3 tasks done
gvanrossum
gvanrossum reviewed Apr 5, 2021
View reviewed changes
Comment thread Python/ceval.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

serhiy-storchaka
serhiy-storchaka reviewed Apr 5, 2021
View reviewed changes

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@serhiy-storchaka

serhiy-storchaka commented Apr 5, 2021

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@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

markshannon commented May 19, 2021

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@markshannon markshannon closed this May 19, 2021
This was referenced May 27, 2021
bpo-43693: Add the MAKE_CELL opcode and interleave fast locals offsets. #26396
Merged
Handle boxing of cell variables in the bytecode. faster-cpython/ideas#41
Closed
markshannon and others added 9 commits June 3, 2021 10:32
@markshannon @ericsnowcurrently
Compute index of cellvars in compiler to avoid additional pointer in …
d2f617f
…interpreter.
@markshannon @ericsnowcurrently
Remove LOAD_CLOSURE instruction.
4893684
@markshannon @ericsnowcurrently
Add NEWS
2f32044
@ericsnowcurrently
Bump the bytecode magic number.
0db1edc
@ericsnowcurrently
Update the dis module docs.
4d82f15
@ericsnowcurrently
Clarify the LOAD_FAST docs.
e4bf977
@ericsnowcurrently
Update the *_DEREF docs.
d25324a
@ericsnowcurrently
Preserve the LOAD_CLOSURE opcode as an alias for LOAD_FAST.
775d4db
@ericsnowcurrently
Update the dis docs.
5183325
@ericsnowcurrently ericsnowcurrently reopened this Jun 3, 2021
ericsnowcurrently added 2 commits June 3, 2021 10:38
@ericsnowcurrently
touch
4f1dde5
@ericsnowcurrently
touch
46d531e
@ericsnowcurrently
ericsnowcurrently force-pushed the compile-deref-offsets-in-compiler branch from 6174448 to 46d531e Compare June 3, 2021 16:41
@gvanrossum

gvanrossum commented Jun 3, 2021

Copy link
Copy Markdown
Member

(What are you doing here?)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently

ericsnowcurrently commented Jun 3, 2021

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. 🙂)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ericsnowcurrently
Drop the "cell" arg from code._varname_from_oparg().
eafb2b1
@ericsnowcurrently
ericsnowcurrently merged commit b2bf2bc into python:main Jun 4, 2021
@bedevere-bot bedevere-bot removed the awaiting core review label Jun 4, 2021
pablogsal added a commit to pablogsal/cpython that referenced this pull request Jun 4, 2021
@pablogsal
Revert "bpo-43693: Compute deref offsets in compiler (pythongh-25152)"
5e5dd48
This reverts commit b2bf2bc.
pablogsal added a commit that referenced this pull request Jun 4, 2021
@pablogsal
bpo-43693: Revert commits 2c1e258 and b2bf2bc (GH-26530)
17c4edc
* 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 ericsnowcurrently mentioned this pull request Jun 7, 2021
bpo-43693: Un-revert commits 2c1e258 and b2bf2bc. #26577
Merged
ericsnowcurrently added a commit to ericsnowcurrently/cpython that referenced this pull request Jun 7, 2021
@ericsnowcurrently
Un-revert commits 2c1e258 and b2bf2bc.
5e98b69
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
@ericsnowcurrently
bpo-43693: Un-revert commits 2c1e258 and b2bf2bc. (gh-26577)
2ab27c4
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
@markshannon markshannon mentioned this pull request May 2, 2022
Logically merge cell and locals array. They are already contiguous in memory #87859
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ericsnowcurrently ericsnowcurrently ericsnowcurrently left review comments
@gvanrossum gvanrossum gvanrossum left review comments
@serhiy-storchaka serhiy-storchaka serhiy-storchaka left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@markshannon @serhiy-storchaka @gvanrossum @ericsnowcurrently @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.