Skip to content

Commit 222ee17

Browse files
committed
Tidy up
1 parent 18a6511 commit 222ee17

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

Python/ceval.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,6 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10621062
deoptimize:
10631063
// On DEOPT_IF we just repeat the last instruction.
10641064
// This presumes nothing was popped from the stack (nor pushed).
1065-
//assert(next_uop[-1].target + _PyCode_CODE((PyCodeObject *)frame->f_executable) == frame->instr_ptr);
10661065
DPRINTF(2, "DEOPT: [Opcode %d, operand %" PRIu64 " @ %d]\n", opcode, operand, (int)(next_uop-current_executor->trace-1));
10671066
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
10681067
UOP_STAT_INC(opcode, miss);

Python/optimizer.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ _PyUop_Replacements[OPCODE_METADATA_SIZE] = {
394394
};
395395

396396
static const uint16_t
397-
BRANCH_TO_GUARDS[4][2] = {
397+
BRANCH_TO_GUARD[4][2] = {
398398
[POP_JUMP_IF_FALSE - POP_JUMP_IF_FALSE][0] = _GUARD_IS_TRUE_POP,
399399
[POP_JUMP_IF_FALSE - POP_JUMP_IF_FALSE][1] = _GUARD_IS_FALSE_POP,
400400
[POP_JUMP_IF_TRUE - POP_JUMP_IF_FALSE][0] = _GUARD_IS_FALSE_POP,
@@ -545,7 +545,7 @@ translate_bytecode_to_trace(
545545
int counter = instr[1].cache;
546546
int bitcount = _Py_popcount32(counter);
547547
int jump_likely = bitcount > 8;
548-
uint32_t uopcode = BRANCH_TO_GUARDS[opcode - POP_JUMP_IF_FALSE][jump_likely];
548+
uint32_t uopcode = BRANCH_TO_GUARD[opcode - POP_JUMP_IF_FALSE][jump_likely];
549549
_Py_CODEUNIT *next_instr = instr + 1 + _PyOpcode_Caches[_PyOpcode_Deopt[opcode]];
550550
DPRINTF(4, "%s(%d): counter=%x, bitcount=%d, likely=%d, uopcode=%s\n",
551551
uop_name(opcode), oparg,
@@ -762,16 +762,6 @@ translate_bytecode_to_trace(
762762
#define SET_BIT(array, bit) (array[(bit)>>5] |= (1<<((bit)&31)))
763763
#define BIT_IS_SET(array, bit) (array[(bit)>>5] & (1<<((bit)&31)))
764764

765-
static bool
766-
is_branch(int opcode) {
767-
/* Currently there are no jumps in the buffer,
768-
* but we expect the optimizer to add them
769-
* in the future. */
770-
assert(opcode != _POP_JUMP_IF_FALSE &&
771-
opcode != _POP_JUMP_IF_TRUE);
772-
return false;
773-
}
774-
775765
/* Count the number of used uops, and mark them in the bit vector `used`.
776766
* This can be done in a single pass using simple reachability analysis,
777767
* as there are no backward jumps.

0 commit comments

Comments
 (0)