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

Appearance settings

bpo-47120: make POP_JUMP_IF_NONE/NOT_NONE relative #32359

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Apr 6, 2022

@iritkatriel
Copy link
Member Author

The case of POP_JUMP_IF_TRUE/IF_FALSE is more complicated because of the COMPARE_OP specialisations. I suggest we do it separately (my current patch doesn't work unless I turn off specialization, debugging).

@markshannon
Copy link
Member

The FORWARD jumps don't need to include CHECK_EVAL_BREAKER(), so I think you'll need to implement each instruction independently and not use JUMP_TO_INSTRUCTION.

@markshannon
Copy link
Member

Which means the forwards jumps can be made simpler

TARGET(POP_JUMP_FORWARD_IF_NOT_NONE) {
    PyObject *value = POP();
    if (value != Py_None) {
        JUMPBY(oparg);
    }
    Py_DECREF(value);
    DISPATCH();
}

@iritkatriel
Copy link
Member Author

The case of POP_JUMP_IF_TRUE/IF_FALSE is more complicated because of the COMPARE_OP specialisations. I suggest we do it separately (my current patch doesn't work unless I turn off specialization, debugging).

I fixed it now, it was the usual +-1 business. I'll make a separate PR for that, it will be easier to review that way. We can merge magic number later.

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

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

👍

@iritkatriel
Copy link
Member Author

This will be merged as part of #32400

@iritkatriel iritkatriel closed this Apr 8, 2022
@iritkatriel iritkatriel deleted the jump_if branch May 20, 2022 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.