Skip to content

Commit f7c26d4

Browse files
rename jit_state to jit_tracer_state
1 parent 08ec600 commit f7c26d4

File tree

8 files changed

+111
-111
lines changed

8 files changed

+111
-111
lines changed

Include/internal/pycore_tstate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ typedef struct _PyThreadStateImpl {
109109
Py_ssize_t reftotal; // this thread's total refcount operations
110110
#endif
111111
#if _Py_TIER2
112-
_PyJitTracerState jit_state;
112+
_PyJitTracerState jit_tracer_state;
113113
#endif
114114
} _PyThreadStateImpl;
115115

Python/bytecodes.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5654,23 +5654,23 @@ dummy_func(
56545654
// Super instructions. Instruction deopted. There's a mismatch in what the stack expects
56555655
// in the optimizer. So we have to reflect in the trace correctly.
56565656
_PyThreadStateImpl *_tstate = (_PyThreadStateImpl *)tstate;
5657-
if ((_tstate->jit_state.prev_state.instr->op.code == CALL_LIST_APPEND &&
5657+
if ((_tstate->jit_tracer_state.prev_state.instr->op.code == CALL_LIST_APPEND &&
56585658
opcode == POP_TOP) ||
5659-
(_tstate->jit_state.prev_state.instr->op.code == BINARY_OP_INPLACE_ADD_UNICODE &&
5659+
(_tstate->jit_tracer_state.prev_state.instr->op.code == BINARY_OP_INPLACE_ADD_UNICODE &&
56605660
opcode == STORE_FAST)) {
5661-
_tstate->jit_state.prev_state.instr_is_super = true;
5661+
_tstate->jit_tracer_state.prev_state.instr_is_super = true;
56625662
}
56635663
else {
5664-
_tstate->jit_state.prev_state.instr = next_instr;
5664+
_tstate->jit_tracer_state.prev_state.instr = next_instr;
56655665
}
56665666
PyObject *prev_code = PyStackRef_AsPyObjectBorrow(frame->f_executable);
5667-
if (_tstate->jit_state.prev_state.instr_code != (PyCodeObject *)prev_code) {
5668-
Py_SETREF(_tstate->jit_state.prev_state.instr_code, (PyCodeObject*)Py_NewRef((prev_code)));
5667+
if (_tstate->jit_tracer_state.prev_state.instr_code != (PyCodeObject *)prev_code) {
5668+
Py_SETREF(_tstate->jit_tracer_state.prev_state.instr_code, (PyCodeObject*)Py_NewRef((prev_code)));
56695669
}
56705670

5671-
_tstate->jit_state.prev_state.instr_frame = frame;
5672-
_tstate->jit_state.prev_state.instr_oparg = oparg;
5673-
_tstate->jit_state.prev_state.instr_stacklevel = PyStackRef_IsNone(frame->f_executable) ? 2 : STACK_LEVEL();
5671+
_tstate->jit_tracer_state.prev_state.instr_frame = frame;
5672+
_tstate->jit_tracer_state.prev_state.instr_oparg = oparg;
5673+
_tstate->jit_tracer_state.prev_state.instr_stacklevel = PyStackRef_IsNone(frame->f_executable) ? 2 : STACK_LEVEL();
56745674
if (_PyOpcode_Caches[_PyOpcode_Deopt[opcode]]) {
56755675
(&next_instr[1])->counter = trigger_backoff_counter();
56765676
}

Python/ceval.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,15 +1002,15 @@ bail_tracing_and_jit(PyThreadState *tstate, _PyInterpreterFrame *frame)
10021002
}
10031003
_PyThreadStateImpl *_tstate = (_PyThreadStateImpl *)tstate;
10041004
// Deal with backoffs
1005-
_PyExitData *exit = _tstate->jit_state.initial_state.exit;
1005+
_PyExitData *exit = _tstate->jit_tracer_state.initial_state.exit;
10061006
if (exit == NULL) {
10071007
// We hold a strong reference to the code object, so the instruction won't be freed.
10081008
if (err <= 0) {
1009-
_Py_BackoffCounter counter = _tstate->jit_state.initial_state.jump_backward_instr[1].counter;
1010-
_tstate->jit_state.initial_state.jump_backward_instr[1].counter = restart_backoff_counter(counter);
1009+
_Py_BackoffCounter counter = _tstate->jit_tracer_state.initial_state.jump_backward_instr[1].counter;
1010+
_tstate->jit_tracer_state.initial_state.jump_backward_instr[1].counter = restart_backoff_counter(counter);
10111011
}
10121012
else {
1013-
_tstate->jit_state.initial_state.jump_backward_instr[1].counter = initial_jump_backoff_counter();
1013+
_tstate->jit_tracer_state.initial_state.jump_backward_instr[1].counter = initial_jump_backoff_counter();
10141014
}
10151015
}
10161016
else {

Python/ceval_macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ do { \
400400
JUMP_TO_LABEL(error); \
401401
} \
402402
if (keep_tracing_bit) { \
403-
assert(((_PyThreadStateImpl *)tstate)->jit_state.prev_state.code_curr_size == 2); \
403+
assert(((_PyThreadStateImpl *)tstate)->jit_tracer_state.prev_state.code_curr_size == 2); \
404404
ENTER_TRACING(); \
405405
DISPATCH_NON_TRACING(); \
406406
} \

Python/generated_cases.c.h

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

Python/jit.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ typedef struct {
139139
typedef struct {
140140
trampoline_state trampolines;
141141
uintptr_t instruction_starts[UOP_MAX_TRACE_LENGTH];
142-
} jit_state;
142+
} jit_tracer_state;
143143

144144
// Warning! AArch64 requires you to get your hands dirty. These are your gloves:
145145

@@ -443,7 +443,7 @@ patch_x86_64_32rx(unsigned char *location, uint64_t value)
443443
patch_32r(location, value);
444444
}
445445

446-
void patch_aarch64_trampoline(unsigned char *location, int ordinal, jit_state *state);
446+
void patch_aarch64_trampoline(unsigned char *location, int ordinal, jit_tracer_state *state);
447447

448448
#include "jit_stencils.h"
449449

@@ -458,7 +458,7 @@ void patch_aarch64_trampoline(unsigned char *location, int ordinal, jit_state *s
458458
// Generate and patch AArch64 trampolines. The symbols to jump to are stored
459459
// in the jit_stencils.h in the symbols_map.
460460
void
461-
patch_aarch64_trampoline(unsigned char *location, int ordinal, jit_state *state)
461+
patch_aarch64_trampoline(unsigned char *location, int ordinal, jit_tracer_state *state)
462462
{
463463

464464
uint64_t value = (uintptr_t)symbols_map[ordinal];
@@ -518,7 +518,7 @@ _PyJIT_Compile(_PyExecutorObject *executor, const _PyUOpInstruction trace[], siz
518518
// Loop once to find the total compiled size:
519519
size_t code_size = 0;
520520
size_t data_size = 0;
521-
jit_state state = {0};
521+
jit_tracer_state state = {0};
522522
for (size_t i = 0; i < length; i++) {
523523
const _PyUOpInstruction *instruction = &trace[i];
524524
group = &stencil_groups[instruction->opcode];
@@ -596,7 +596,7 @@ compile_trampoline(void)
596596
const StencilGroup *group;
597597
size_t code_size = 0;
598598
size_t data_size = 0;
599-
jit_state state = {0};
599+
jit_tracer_state state = {0};
600600
group = &trampoline;
601601
code_size += group->code_size;
602602
data_size += group->data_size;

0 commit comments

Comments
 (0)