summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2023-01-30 10:03:04 (GMT)
committerGitHub <noreply@github.com>2023-01-30 10:03:04 (GMT)
commitc1b1f51cd1632f0b77dacd43092fb44ed5e053a9 (patch)
treeda815b0f6e2daddbb013ce2383837c61b3675201 /Python/bytecodes.c
parentf5a3d91b6c56ddff4644b5a5ac34d8c6d23d7c79 (diff)
downloadcpython-c1b1f51cd1632f0b77dacd43092fb44ed5e053a9.zip
cpython-c1b1f51cd1632f0b77dacd43092fb44ed5e053a9.tar.gz
cpython-c1b1f51cd1632f0b77dacd43092fb44ed5e053a9.tar.bz2
GH-101291: Refactor the `PyLongObject` struct into object header and PyLongValue struct. (GH-101292)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index fb00b88..d1e59f7 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -357,8 +357,8 @@ dummy_func(
// Deopt unless 0 <= sub < PyList_Size(list)
DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), BINARY_SUBSCR);
- assert(((PyLongObject *)_PyLong_GetZero())->ob_digit[0] == 0);
- Py_ssize_t index = ((PyLongObject*)sub)->ob_digit[0];
+ assert(((PyLongObject *)_PyLong_GetZero())->long_value.ob_digit[0] == 0);
+ Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
DEOPT_IF(index >= PyList_GET_SIZE(list), BINARY_SUBSCR);
STAT_INC(BINARY_SUBSCR, hit);
res = PyList_GET_ITEM(list, index);
@@ -375,8 +375,8 @@ dummy_func(
// Deopt unless 0 <= sub < PyTuple_Size(list)
DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), BINARY_SUBSCR);
- assert(((PyLongObject *)_PyLong_GetZero())->ob_digit[0] == 0);
- Py_ssize_t index = ((PyLongObject*)sub)->ob_digit[0];
+ assert(((PyLongObject *)_PyLong_GetZero())->long_value.ob_digit[0] == 0);
+ Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
DEOPT_IF(index >= PyTuple_GET_SIZE(tuple), BINARY_SUBSCR);
STAT_INC(BINARY_SUBSCR, hit);
res = PyTuple_GET_ITEM(tuple, index);
@@ -469,7 +469,7 @@ dummy_func(
// Ensure nonnegative, zero-or-one-digit ints.
DEOPT_IF(!_PyLong_IsPositiveSingleDigit(sub), STORE_SUBSCR);
- Py_ssize_t index = ((PyLongObject*)sub)->ob_digit[0];
+ Py_ssize_t index = ((PyLongObject*)sub)->long_value.ob_digit[0];
// Ensure index < len(list)
DEOPT_IF(index >= PyList_GET_SIZE(list), STORE_SUBSCR);
STAT_INC(STORE_SUBSCR, hit);
@@ -1834,8 +1834,8 @@ dummy_func(
DEOPT_IF((size_t)(Py_SIZE(right) + 1) > 2, COMPARE_AND_BRANCH);
STAT_INC(COMPARE_AND_BRANCH, hit);
assert(Py_ABS(Py_SIZE(left)) <= 1 && Py_ABS(Py_SIZE(right)) <= 1);
- Py_ssize_t ileft = Py_SIZE(left) * ((PyLongObject *)left)->ob_digit[0];
- Py_ssize_t iright = Py_SIZE(right) * ((PyLongObject *)right)->ob_digit[0];
+ Py_ssize_t ileft = Py_SIZE(left) * ((PyLongObject *)left)->long_value.ob_digit[0];
+ Py_ssize_t iright = Py_SIZE(right) * ((PyLongObject *)right)->long_value.ob_digit[0];
// 2 if <, 4 if >, 8 if ==; this matches the low 4 bits of the oparg
int sign_ish = COMPARISON_BIT(ileft, iright);
_Py_DECREF_SPECIALIZED(left, (destructor)PyObject_Free);