Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-91432: Specialize FOR_ITER#91713
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
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
3a7f8df3b5ce1eb21b5f437269cfea0a7ee0751228dc80fdae4294101cb2de773fa01c4213582bf58358bd7575edb8754b2050c4e824e9666b16772c2a75a56696384d29709122635a6f360d6581e0500c2eab6825689c3b5df0472b1c17091d280ceba5e605b153d776f9a740565a689ba5b796cdf0e403dde6af1e2d39463c3b9ed29777188b35736d0999ad2e969d55868f2d6ee26db21da1File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -263,26 +263,26 @@ _PyLong_FromSTwoDigits(stwodigits x) | ||
| } | ||
| int | ||
| _PyLong_AssignValue(PyObject **target,Py_ssize_t value) | ||
| { | ||
| PyObject *old = *target; | ||
| if (IS_SMALL_INT(value)) { | ||
| *target = get_small_int(Py_SAFE_DOWNCAST(value,Py_ssize_t, sdigit)); | ||
| Py_XDECREF(old); | ||
| return 0; | ||
| } | ||
| else if (old != NULL && PyLong_CheckExact(old) && | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This only works for positive integers. | ||
| Py_REFCNT(old) == 1 && Py_SIZE(old) == 1 && | ||
| (size_t)value <= PyLong_MASK) | ||
| { | ||
| // Mutate in place if there are no other references to the old object. | ||
| // This avoids an allocation in a common case. | ||
| ((PyLongObject *)old)->ob_digit[0] | ||
| = Py_SAFE_DOWNCAST(value,Py_ssize_t, digit); | ||
| return 0; | ||
| } | ||
| else { | ||
| *target =PyLong_FromSsize_t(value); | ||
| Py_XDECREF(old); | ||
| if (*target == NULL) { | ||
| return -1; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -4510,6 +4510,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int | ||
| if (_PyLong_AssignValue(&GETLOCAL(_Py_OPARG(next)), value) < 0) { | ||
| goto error; | ||
| } | ||
| // The STORE_FAST is already done. | ||
| JUMPBY(INLINE_CACHE_ENTRIES_FOR_ITER + 1); | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Could you add a comment explaining why this is | ||
| NOTRACE_DISPATCH(); | ||
| } | ||