Skip to content
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

bpo-47120: make POP_JUMP_IF_NONE/NOT_NONE relative #32359

Closed
wants to merge 6 commits into from

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Apr 6, 2022

@iritkatriel
Copy link
Member Author

iritkatriel commented Apr 6, 2022

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

markshannon commented Apr 7, 2022

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

markshannon commented Apr 7, 2022

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

iritkatriel commented Apr 7, 2022

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

👍

@iritkatriel
Copy link
Member Author

iritkatriel commented Apr 8, 2022

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

None yet

4 participants