summaryrefslogtreecommitdiffstats
path: root/Python/optimizer.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/optimizer.c')
-rw-r--r--Python/optimizer.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/Python/optimizer.c b/Python/optimizer.c
index 56768ae..c0e1be9 100644
--- a/Python/optimizer.c
+++ b/Python/optimizer.c
@@ -976,7 +976,7 @@ count_exits(_PyUOpInstruction *buffer, int length)
int exit_count = 0;
for (int i = 0; i < length; i++) {
int opcode = buffer[i].opcode;
- if (opcode == _SIDE_EXIT || opcode == _DYNAMIC_EXIT) {
+ if (opcode == _EXIT_TRACE || opcode == _DYNAMIC_EXIT) {
exit_count++;
}
}
@@ -1021,7 +1021,7 @@ prepare_for_execution(_PyUOpInstruction *buffer, int length)
int32_t target = (int32_t)uop_get_target(inst);
if (_PyUop_Flags[opcode] & (HAS_EXIT_FLAG | HAS_DEOPT_FLAG)) {
uint16_t exit_op = (_PyUop_Flags[opcode] & HAS_EXIT_FLAG) ?
- _SIDE_EXIT : _DEOPT;
+ _EXIT_TRACE : _DEOPT;
int32_t jump_target = target;
if (is_for_iter_test[opcode]) {
/* Target the POP_TOP immediately after the END_FOR,
@@ -1112,7 +1112,7 @@ sanity_check(_PyExecutorObject *executor)
CHECK(target_unused(opcode));
break;
case UOP_FORMAT_EXIT:
- CHECK(opcode == _SIDE_EXIT);
+ CHECK(opcode == _EXIT_TRACE);
CHECK(inst->exit_index < executor->exit_count);
break;
case UOP_FORMAT_JUMP:
@@ -1138,9 +1138,9 @@ sanity_check(_PyExecutorObject *executor)
uint16_t opcode = inst->opcode;
CHECK(
opcode == _DEOPT ||
- opcode == _SIDE_EXIT ||
+ opcode == _EXIT_TRACE ||
opcode == _ERROR_POP_N);
- if (opcode == _SIDE_EXIT) {
+ if (opcode == _EXIT_TRACE) {
CHECK(inst->format == UOP_FORMAT_EXIT);
}
}
@@ -1178,7 +1178,7 @@ make_executor_from_uops(_PyUOpInstruction *buffer, int length, const _PyBloomFil
dest--;
*dest = buffer[i];
assert(opcode != _POP_JUMP_IF_FALSE && opcode != _POP_JUMP_IF_TRUE);
- if (opcode == _SIDE_EXIT) {
+ if (opcode == _EXIT_TRACE) {
executor->exits[next_exit].target = buffer[i].target;
dest->exit_index = next_exit;
dest->format = UOP_FORMAT_EXIT;
@@ -1398,14 +1398,13 @@ counter_optimize(
return 0;
}
_Py_CODEUNIT *target = instr + 1 + _PyOpcode_Caches[JUMP_BACKWARD] - oparg;
- _PyUOpInstruction buffer[5] = {
- { .opcode = _START_EXECUTOR, .jump_target = 4, .format=UOP_FORMAT_JUMP },
+ _PyUOpInstruction buffer[4] = {
+ { .opcode = _START_EXECUTOR, .jump_target = 3, .format=UOP_FORMAT_JUMP },
{ .opcode = _LOAD_CONST_INLINE_BORROW, .operand = (uintptr_t)self },
{ .opcode = _INTERNAL_INCREMENT_OPT_COUNTER },
- { .opcode = _EXIT_TRACE, .jump_target = 4, .format=UOP_FORMAT_JUMP },
- { .opcode = _SIDE_EXIT, .target = (uint32_t)(target - _PyCode_CODE(code)), .format=UOP_FORMAT_TARGET }
+ { .opcode = _EXIT_TRACE, .target = (uint32_t)(target - _PyCode_CODE(code)), .format=UOP_FORMAT_TARGET }
};
- _PyExecutorObject *executor = make_executor_from_uops(buffer, 5, &EMPTY_FILTER);
+ _PyExecutorObject *executor = make_executor_from_uops(buffer, 4, &EMPTY_FILTER);
if (executor == NULL) {
return -1;
}