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: Add the MAKE_CELL opcode and interleave fast locals offsets. by ericsnowcurrently · Pull Request #26396 · python/cpython

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented May 27, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This moves logic out of the frame initialization code and into the compiler and eval loop. Doing so simplifies the runtime code and allows us to optimize it better.

https://bugs.python.org/issue43693

Sorry, something went wrong.

Uh oh!

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

All reactions
@ericsnowcurrently
ericsnowcurrently requested a review from markshannon May 27, 2021 02:34
@ericsnowcurrently
ericsnowcurrently requested a review from tiran as a code owner May 27, 2021 02:34
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label May 27, 2021
@bedevere-bot bedevere-bot added the awaiting core review label May 27, 2021
@ericsnowcurrently
ericsnowcurrently removed the request for review from tiran May 27, 2021 02:34
@ericsnowcurrently ericsnowcurrently mentioned this pull request May 27, 2021
Handle boxing of cell variables in the bytecode. faster-cpython/ideas#41
Closed
markshannon
markshannon reviewed May 27, 2021
View reviewed changes
Comment thread Include/cpython/code.h Resolved

Uh oh!

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

@ericsnowcurrently ericsnowcurrently mentioned this pull request May 27, 2021
bpo-43693: Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. #26388
Merged
@ericsnowcurrently
ericsnowcurrently force-pushed the add-make-cell branch from 24ecd90 to b4ba659 Compare May 27, 2021 23:55
@ericsnowcurrently
ericsnowcurrently force-pushed the add-make-cell branch from b4ba659 to 4dceac6 Compare June 4, 2021 00:07
markshannon
markshannon reviewed Jun 4, 2021
View reviewed changes

@markshannon markshannon 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.

Also a couple of Windows warnings.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Doc/library/dis.rst Resolved

Uh oh!

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

Comment thread Include/cpython/code.h Resolved

Uh oh!

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

Comment thread Include/cpython/code.h Resolved

Uh oh!

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

Comment thread Lib/opcode.py Outdated

@markshannon markshannon Jun 4, 2021

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.

Why the opcode shuffle?

Sorry, something went wrong.

Uh oh!

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

All reactions

@ericsnowcurrently ericsnowcurrently Jun 4, 2021

Copy link
Copy Markdown
Member Author

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.

My initial impression was that MAKE_CELL should be at the front of the cell-related list and I figured it would be better to preserve the gap at 134. I figured it wouldn't matter but if it's a problem I can put MAKE_CELL at 139.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Misc/NEWS.d/next/Core and Builtins/2021-05-26-19-10-47.bpo-43693.1KSG9u.rst Resolved

Uh oh!

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

Comment thread Objects/frameobject.c Resolved

Uh oh!

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

Comment thread Objects/frameobject.c Resolved

Uh oh!

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

Comment thread Python/ceval.c Resolved

Uh oh!

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

Comment thread Python/ceval.c Resolved

Uh oh!

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

@ericsnowcurrently ericsnowcurrently mentioned this pull request Jun 4, 2021
Document the instruction format. faster-cpython/ideas#56
Closed
ericsnowcurrently added 9 commits June 7, 2021 12:29
@ericsnowcurrently
Add the MAKE_CELL opcode.
110a891
@ericsnowcurrently
Insert MAKE_CELL for each cellvar.
4d1056b
@ericsnowcurrently
Implement MAKE_CELL.
e18489b
@ericsnowcurrently
Add a NEWS entry.
21acbc2
@ericsnowcurrently
Update the dis docs.
167cdc1
@ericsnowcurrently
offset_derefs() -> fix_cell_offsets().
409b92a
@ericsnowcurrently
Mark MAKE_CELL as "hasfree".
da503d0
@ericsnowcurrently
Drop _Py_MAX_OPARG (and add a note about max oparg size).
1a8400e
@ericsnowcurrently
Update the NEWS entry.
09f718f
@ericsnowcurrently
ericsnowcurrently force-pushed the add-make-cell branch from 4975013 to 16c3424 Compare June 7, 2021 18:30
ericsnowcurrently added 2 commits June 7, 2021 14:22
@ericsnowcurrently
Add some explicit casts to int.
cd2508f
@ericsnowcurrently
Do not create cells in PyFrame_LocalsToFast().
362088d
@ericsnowcurrently
ericsnowcurrently force-pushed the add-make-cell branch from 16c3424 to 2ea0f06 Compare June 7, 2021 20:23
ericsnowcurrently added 2 commits June 7, 2021 14:40
@ericsnowcurrently
Fix PyFrame_FastToLocals() and PyFrame_LocalsToFast() when the frame …
9cdc8ba
…has been cleared.
@ericsnowcurrently
Use the right offset in super_init_without_args().
5a4d984
@ericsnowcurrently
ericsnowcurrently force-pushed the add-make-cell branch from 2ea0f06 to 5a4d984 Compare June 7, 2021 20:46
@ericsnowcurrently
Py_ssize_t -> int.
05accc0
@ericsnowcurrently ericsnowcurrently added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 7, 2021
@bedevere-bot

bedevere-bot commented Jun 7, 2021

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @ericsnowcurrently for commit 05accc0 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jun 7, 2021
@ericsnowcurrently
ericsnowcurrently merged commit 631f993 into python:main Jun 7, 2021
@bedevere-bot bedevere-bot removed the awaiting core review label Jun 7, 2021
@ericsnowcurrently
ericsnowcurrently deleted the add-make-cell branch June 7, 2021 22:52
pablogsal added a commit to pablogsal/cpython that referenced this pull request Jun 8, 2021
@pablogsal
Revert "bpo-43693: Add the MAKE_CELL opcode and interleave fast local…
01ff3e0
…s offsets. (pythongh-26396)"

This reverts commit 631f993.
pablogsal added a commit that referenced this pull request Jun 8, 2021
@pablogsal
Revert "bpo-43693: Add the MAKE_CELL opcode and interleave fast local…
3fe921c
…s offsets. (gh-26396)" (GH-26597)

This reverts commit 631f993.
ericsnowcurrently added a commit to ericsnowcurrently/cpython that referenced this pull request Jun 8, 2021
@ericsnowcurrently
Un-revert "bpo-43693: Add the MAKE_CELL opcode and interleave fast lo…
ddcfb69
…cals offsets. (pythongh-26396)"

That commit (3fe921c) was reverted in pythonGH-26597
(3fe921c).
@ericsnowcurrently ericsnowcurrently mentioned this pull request Jun 8, 2021
bpo-43693: Un-revert commit f3fa63e. #26609
Merged
ericsnowcurrently added a commit that referenced this pull request Jun 8, 2021
@ericsnowcurrently
bpo-43693: Un-revert commit f3fa63e. (#26609)
3e1c716
This was reverted in GH-26596 (commit 6d518bb) due to some bad memory accesses.

* Add the MAKE_CELL opcode. (gh-26396)

The memory accesses have been fixed.

https://bugs.python.org/issue43693
@markshannon markshannon mentioned this pull request May 2, 2022
Logically merge cell and locals array. They are already contiguous in memory #87859
Closed
@ericsnowcurrently ericsnowcurrently mentioned this pull request Sep 8, 2023
Do we need the _PyFrame_OpAlreadyRan check in frameobject.c? faster-cpython/ideas#623
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon markshannon 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.

4 participants

@ericsnowcurrently @bedevere-bot @markshannon @the-knights-who-say-ni
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.