8000 Rename self -> current_executor (TODO: eliminate it?) · python/cpython@e02409d · GitHub
[go: up one dir, main page]

Skip to content

Commit e02409d

Browse files
committed
Rename self -> current_executor (TODO: eliminate it?)
1 parent a96ac7f commit e02409d

10000 File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

Python/bytecodes.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ static size_t jump;
6363
static uint16_t invert, counter, index, hint;
6464
#define unused 0 // Used in a macro def, can't be static
6565
static uint32_t type_version;
66+
static _PyUOpExecutorObject *current_executor;
6667

6768
static PyObject *
6869
dummy_func(
@@ -2364,7 +2365,7 @@ dummy_func(
23642365
frame->instr_ptr = next_instr;
23652366
Py_INCREF(executor);
23662367
if (executor->execute == _PyUopExecute) {
2367-
self = (_PyUOpExecutorObject *)executor;
2368+
current_executor = (_PyUOpExecutorObject *)executor;
23682369
GOTO_TIER_TWO();
23692370
}
23702371
frame = executor->execute(executor, frame, stack_pointer);
@@ -3991,18 +3992,18 @@ dummy_func(
39913992

39923993
op(_POP_JUMP_IF_FALSE, (flag -- )) {
39933994
if (Py_IsFalse(flag)) {
3994-
next_uop = self->trace + oparg;
3995+
next_uop = current_executor->trace + oparg;
39953996
}
39963997
}
39973998

39983999
op(_POP_JUMP_IF_TRUE, (flag -- )) {
39994000
if (Py_IsTrue(flag)) {
4000-
next_uop = self->trace + oparg;
4001+
next_uop = current_executor->trace + oparg;
40014002
}
40024003
}
40034004

40044005
op(_JUMP_TO_TOP, (--)) {
4005-
next_uop = self->trace;
4006+
next_uop = current_executor->trace;
40064007
CHECK_EVAL_BREAKER();
40074008
}
40084009

@@ -4024,7 +4025,7 @@ dummy_func(
40244025
op(_EXIT_TRACE, (--)) {
40254026
TIER_TWO_ONLY
40264027
_PyFrame_SetStackPointer(frame, stack_pointer);
4027-
Py_DECREF(self);
4028+
Py_DECREF(current_executor);
40284029
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
40294030
goto enter_tier_one;
40304031
}

Python/ceval.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
727727
}
728728

729729
/* State shared between Tier 1 and Tier 2 interpreter */
730-
_PyUOpExecutorObject *self = NULL;
730+
_PyUOpExecutorObject *current_executor = NULL;
731731

732732
/* Local "register" variables.
733733
* These are cached values from the frame and code object. */
@@ -982,7 +982,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
982982
#endif
983983

984984
OPT_STAT_INC(traces_executed);
985-
_PyUOpInstruction *next_uop = self->trace;
985+
_PyUOpInstruction *next_uop = current_executor->trace;
986986
#ifdef Py_DEBUG
987987
uint64_t operand; // Used by several DPRINTF() calls
988988
#endif
@@ -998,7 +998,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
998998
#endif
999999
DPRINTF(3,
10001000
"%4d: uop %s, oparg %d, operand %" PRIu64 ", stack_level %d\n",
1001-
(int)(next_uop - self->trace),
1001+
(int)(next_uop - current_executor->trace),
10021002
opcode < 256 ? _PyOpcode_OpName[opcode] : _PyOpcode_uop_name[opcode],
10031003
oparg,
10041004
operand,
@@ -1047,7 +1047,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10471047
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
10481048
frame->return_offset = 0; // Don't leave this random
10491049
_PyFrame_SetStackPointer(frame, stack_pointer);
1050-
Py_DECREF(self);
1050+
Py_DECREF(current_executor);
10511051
goto resume_with_error;
10521052

10531053
deoptimize:
@@ -1057,7 +1057,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
10571057
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
10581058
frame->return_offset = 0; // Dispatch to frame->instr_ptr
10591059
_PyFrame_SetStackPointer(frame, stack_pointer);
1060-
Py_DECREF(self);
1060+
Py_DECREF(current_executor);
10611061
enter_tier_one:
< 57AE div aria-hidden="true" style="left:-2px" class="position-absolute top-0 d-flex user-select-none DiffLineTableCellParts-module__in-progress-comment-indicator--hx3m3">
10621062
next_instr = frame->instr_ptr;
10631063
goto resume_frame;

Python/executor_cases.c.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
0