Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor cleanups and comments
  • Loading branch information
sweeneyde committed Oct 5, 2021
commit aea424ead30756f11d29e10643ccbfda82567676
10 changes: 6 additions & 4 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,10 +1973,12 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
if (PyFloat_CheckExact(left)) {
dleft = ((PyFloatObject *)left)->ob_fval;
if (PyFloat_CheckExact(right)) {
// float * float
dright = ((PyFloatObject *)right)->ob_fval;
}
else if (PyLong_CheckExact(right)
&& (((size_t)Py_SIZE(right)) + 1U < 3U)) {
// float * one_digit_int
dright = (double)(((stwodigits)Py_SIZE(right))
* ((PyLongObject *)right)->ob_digit[0]);
}
Expand All @@ -1985,8 +1987,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
}
}
else if (PyLong_CheckExact(left)
&& (((size_t)Py_SIZE(left)) + 1U < 3U)) {
DEOPT_IF(!PyFloat_CheckExact(right), BINARY_MULTIPLY);
&& (((size_t)Py_SIZE(left)) + 1U < 3U)
&& PyFloat_CheckExact(right)) {
// one_digit_int * float
dleft = (double)(((stwodigits)Py_SIZE(left))
* ((PyLongObject *)left)->ob_digit[0]);
dright = ((PyFloatObject *)right)->ob_fval;
Expand All @@ -1996,8 +1999,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
}
STAT_INC(BINARY_MULTIPLY, hit);
record_hit_inline(next_instr, oparg);
double dprod = dleft * dright;
PyObject *prod = PyFloat_FromDouble(dprod);
PyObject *prod = PyFloat_FromDouble(dleft * dright);
SET_SECOND(prod);
Py_DECREF(right);
Py_DECREF(left);
Expand Down
5 changes: 0 additions & 5 deletions Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,11 +455,6 @@ _Py_Quicken(PyCodeObject *code) {
#define SPEC_FAIL_NON_FUNCTION_SCOPE 11
#define SPEC_FAIL_DIFFERENT_TYPES 12

/* Binary Multiply */
#define SPEC_FAIL_STR_INT 13
#define SPEC_FAIL_INT_STR 14
#define SPEC_FAIL_FLOAT_INT 15
#define SPEC_FAIL_INT_FLOAT 16

static int
specialize_module_load_attr(
Expand Down