-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
GH-119500: Remove slice opcodes and handle constant slices in the compiler. #119502
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
Conversation
if (compare_constants(PyTuple_GET_ITEM(op1, i), | ||
PyTuple_GET_ITEM(op2, i)) == 0) { |
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.
if (compare_constants(PyTuple_GET_ITEM(op1, i), | |
PyTuple_GET_ITEM(op2, i)) == 0) { | |
if (compare_constants(PyTuple_GET_ITEM(op1, i), | |
PyTuple_GET_ITEM(op2, i)) == 0) { |
goto cleanup; | ||
} | ||
retval = PySlice_New(start, stop, step); | ||
assert(retval != NULL); |
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.
assert? Not memory error?
@@ -1484,6 +1492,7 @@ r_object(RFILE *p) | |||
|
|||
v = (PyObject *)_PyCode_New(&con); | |||
if (v == NULL) { | |||
assert(0); |
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.
?
Handling constant slices might be worthwhile, but it looks like we are better off keeping |
This PR:
BINARY_SLICE
andSTORE_SLICE
opcodesBINARY_SLICE
opcodes #119500