Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-118093: Add tier two support forBINARY_OP_INPLACE_ADD_UNICODE#122253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@brandtbucher
Copy link
Member

@brandtbucherbrandtbucher commentedJul 25, 2024
edited by bedevere-appbot
Loading

This one's a bit weird, since it needs the oparg of the following instruction. This is readily available in tier one, but needs to be smuggled in using an operand in tier two.

Technically, it would be cleaner to just add an additional cache entry to allBINARY_OP instructions and use that here. However, that feels very wasteful for an instruction that already requires quite a bit of special-casing anyways. So instead, just toss the needed value in the operand during projection.

This is mostly for completeness. No impact onperf orstats, although if you squint hard enough you can see very slight increases in trace length and decreases in number of traces and tier one instructions.

Copy link
Member

@markshannonmarkshannon left a comment

Choose a reason for hiding this comment

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

I've suggested a couple of clarifications, but looks good in general.

*target_local=PyStackRef_FromPyObjectSteal(temp);
_Py_DECREF_SPECIALIZED(right_o,_PyUnicode_ExactDealloc);
ERROR_IF(PyStackRef_IsNull(*target_local),error);
#ifTIER_ONE
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment explaining how this is handled in tier 2.

brandtbucher reacted with thumbs up emoji
// Add cache size for opcode
instr+=_PyOpcode_Caches[_PyOpcode_Deopt[opcode]];

if (opcode==BINARY_OP_INPLACE_ADD_UNICODE) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you move this up to theif (uop == _BINARY_OP_INPLACE_ADD_UNICODE) clause above?
I'd like to keep the special casing code in one place.

You'll probably want to add an assert this uop is the last in the expansion, as well. Like we do inif (uop == _PUSH_FRAME) above.

brandtbucher reacted with thumbs up emoji
@brandtbucherbrandtbucher merged commitd9efa45 intopython:mainJul 25, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@markshannonmarkshannonmarkshannon left review comments

Assignees

@brandtbucherbrandtbucher

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usageskip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@brandtbucher@markshannon

[8]ページ先頭

©2009-2025 Movatter.jp