Skip to content

Commit 8ebb6cb

Browse files
Fix naming of things
1 parent 7d17741 commit 8ebb6cb

File tree

15 files changed

+107
-106
lines changed

15 files changed

+107
-106
lines changed

Include/internal/pycore_interp_structs.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -758,20 +758,20 @@ struct _Py_unique_id_pool {
758758
typedef _Py_CODEUNIT *(*_PyJitEntryFuncPtr)(struct _PyExecutorObject *exec, _PyInterpreterFrame *frame, _PyStackRef *stack_pointer, PyThreadState *tstate);
759759

760760
typedef struct _PyJitTracerState {
761-
int jit_tracer_code_max_size;
762-
int jit_tracer_code_curr_size;
763-
_PyBloomFilter jit_tracer_dependencies;
764-
bool jit_tracer_dependencies_still_valid;
765-
_PyUOpInstruction *jit_tracer_code_buffer;
766-
_Py_CODEUNIT *jit_tracer_insert_exec_instr;
767-
_Py_CODEUNIT *jit_tracer_close_loop_instr;
761+
bool dependencies_still_valid;
762+
int code_max_size;
763+
int code_curr_size;
764+
int initial_stack_depth;
765+
int initial_chain_depth;
766+
_PyUOpInstruction *code_buffer;
767+
_Py_CODEUNIT *insert_exec_instr;
768+
_Py_CODEUNIT *close_loop_instr;
768769
_Py_CODEUNIT *last_specialized_instr;
769-
int jit_tracer_initial_stack_depth;
770-
int jit_tracer_initial_chain_depth;
771-
PyCodeObject *jit_tracer_initial_code; // Strong
772-
PyFunctionObject *jit_tracer_initial_func; // Strong
773-
struct _PyExitData *jit_tracer_previous_exit;
774-
_PyInterpreterFrame *jit_tracer_current_frame;
770+
PyCodeObject *initial_code; // Strong
771+
PyFunctionObject *initial_func; // Strong
772+
struct _PyExitData *previous_exit;
773+
_PyInterpreterFrame *current_frame;
774+
_PyBloomFilter dependencies;
775775
} _PyJitTracerState;
776776

777777
/* PyInterpreterState holds the global state for one of the runtime's

Include/internal/pycore_optimizer.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ extern void _Py_ClearExecutorDeletionList(PyInterpreterState *interp);
359359
#endif
360360

361361
int
362-
_PyJIT_translate_single_bytecode_to_trace(
362+
_PyJit_translate_single_bytecode_to_trace(
363363
PyThreadState *tstate,
364364
_PyInterpreterFrame *frame,
365365
_Py_CODEUNIT *this_instr,
@@ -372,11 +372,12 @@ _PyJIT_translate_single_bytecode_to_trace(
372372
int jump_taken);
373373

374374
void
375-
_PyJIT_InitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *insert_exec_instr, _Py_CODEUNIT *close_loop_instr, int curr_stackdepth, int chain_depth, _PyExitData *exit);
375+
_PyJit_InitializeTracing(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *insert_exec_instr
376+
_Py_CODEUNIT *close_loop_instr, int curr_stackdepth, int chain_depth, _PyExitData *exit);
376377

377-
void _PyJIT_FinalizeTracing(PyThreadState *tstate);
378+
void _PyJit_FinalizeTracing(PyThreadState *tstate);
378379

379-
void _Py_JITTracer_InvalidateDependency(PyThreadState *old_tstate, void *obj);
380+
void _PyJit_Tracer_InvalidateDependency(PyThreadState *old_tstate, void *obj);
380381

381382
#ifdef __cplusplus
382383
}

Objects/codeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2415,7 +2415,7 @@ code_dealloc(PyObject *self)
24152415
PyMem_Free(co_extra);
24162416
}
24172417
#ifdef _Py_TIER2
2418-
_Py_JITTracer_InvalidateDependency(tstate, self);
2418+
_PyJit_Tracer_InvalidateDependency(tstate, self);
24192419
if (co->co_executors != NULL) {
24202420
clear_executors(co);
24212421
}

Objects/frameobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ framelocalsproxy_setitem(PyObject *self, PyObject *key, PyObject *value)
264264

265265
#if _Py_TIER2
266266
_Py_Executors_InvalidateDependency(PyInterpreterState_Get(), co, 1);
267-
_Py_JITTracer_InvalidateDependency(PyThreadState_GET(), co);
267+
_PyJit_Tracer_InvalidateDependency(PyThreadState_GET(), co);
268268
#endif
269269

270270
_PyLocals_Kind kind = _PyLocals_GetKind(co->co_localspluskinds, i);

Objects/funcobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "pycore_setobject.h" // _PySet_NextEntry()
1212
#include "pycore_stats.h"
1313
#include "pycore_weakref.h" // FT_CLEAR_WEAKREFS()
14-
#include "pycore_optimizer.h" // _Py_JITTracer_InvalidateDependency
14+
#include "pycore_optimizer.h" // _PyJit_Tracer_InvalidateDependency
1515

1616
static const char *
1717
func_event_name(PyFunction_WatchEvent event) {
@@ -1152,7 +1152,7 @@ func_dealloc(PyObject *self)
11521152
return;
11531153
}
11541154
#if _Py_TIER2
1155-
_Py_JITTracer_InvalidateDependency(PyThreadState_GET(), self);
1155+
_PyJit_Tracer_InvalidateDependency(PyThreadState_GET(), self);
11561156
#endif
11571157
_PyObject_GC_UNTRACK(op);
11581158
FT_CLEAR_WEAKREFS(self, op->func_weakreflist);

Python/bytecodes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,9 +2970,9 @@ dummy_func(
29702970
if (!IS_JIT_TRACING() && backoff_counter_triggers(counter) &&
29712971
this_instr->op.code == JUMP_BACKWARD_JIT &&
29722972
next_instr->op.code != ENTER_EXECUTOR) {
2973-
if (tstate->interp->jit_state.jit_tracer_code_buffer == NULL) {
2974-
tstate->interp->jit_state.jit_tracer_code_buffer = (_PyUOpInstruction *)_PyObject_VirtualAlloc(UOP_BUFFER_SIZE);
2975-
if (tstate->interp->jit_state.jit_tracer_code_buffer == NULL) {
2973+
if (tstate->interp->jit_state.code_buffer == NULL) {
2974+
tstate->interp->jit_state.code_buffer = (_PyUOpInstruction *)_PyObject_VirtualAlloc(UOP_BUFFER_SIZE);
2975+
if (tstate->interp->jit_state.code_buffer == NULL) {
29762976
// Don't error, just go to next instruction.
29772977
DISPATCH();
29782978
}
@@ -2985,7 +2985,7 @@ dummy_func(
29852985
oparg >>= 8;
29862986
insert_exec_at--;
29872987
}
2988-
_PyJIT_InitializeTracing(tstate, frame, insert_exec_at, next_instr, STACK_LEVEL(), 0, NULL);
2988+
_PyJit_InitializeTracing(tstate, frame, insert_exec_at, next_instr, STACK_LEVEL(), 0, NULL);
29892989
ENTER_TRACING();
29902990
}
29912991
int _jump_taken = false;
@@ -5456,7 +5456,7 @@ dummy_func(
54565456
_PyExecutorObject *previous_executor = _PyExecutor_FromExit(exit);
54575457
assert(tstate->current_executor == (PyObject *)previous_executor);
54585458
int chain_depth = previous_executor->vm_data.chain_depth + 1;
5459-
_PyJIT_InitializeTracing(tstate, frame, target, target, STACK_LEVEL(), chain_depth, exit);
5459+
_PyJit_InitializeTracing(tstate, frame, target, target, STACK_LEVEL(), chain_depth, exit);
54605460
exit->temperature = initial_temperature_backoff_counter();
54615461
GOTO_TIER_ONE(target, 1);
54625462
}

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -990,8 +990,8 @@ static inline int
990990
add_to_code_trace(PyThreadState *tstate, _PyInterpreterFrame *frame, PyCodeObject *old_code, PyFunctionObject *old_func, int old_stack_level, _Py_CODEUNIT *this_instr, _Py_CODEUNIT *next_instr, int opcode, int oparg, int jump_taken)
991991
{
992992
assert(frame != NULL);
993-
assert(tstate->interp->jit_state.jit_tracer_code_curr_size < UOP_MAX_TRACE_LENGTH);
994-
return !_PyJIT_translate_single_bytecode_to_trace(tstate, frame, this_instr, next_instr, old_code, old_func, old_stack_level, opcode, oparg, jump_taken);
993+
assert(tstate->interp->jit_state.code_curr_size < UOP_MAX_TRACE_LENGTH);
994+
return !_PyJit_translate_single_bytecode_to_trace(tstate, frame, this_instr, next_instr, old_code, old_func, old_stack_level, opcode, oparg, jump_taken);
995995
}
996996
#endif
997997

Python/ceval_macros.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,15 @@
150150
if (!_PyErr_Occurred(tstate) && !_is_sys_tracing) { \
151151
_PyFrame_SetStackPointer(frame, stack_pointer); \
152152
int _err = _PyOptimizer_Optimize(frame, tstate); \
153-
_PyJIT_FinalizeTracing(tstate); \
153+
_PyJit_FinalizeTracing(tstate); \
154154
stack_pointer = _PyFrame_GetStackPointer(frame); \
155155
if (_err < 0) { \
156156
JUMP_TO_LABEL(error); \
157157
} \
158158
} \
159159
else { \
160160
_PyFrame_SetStackPointer(frame, stack_pointer); \
161-
_PyJIT_FinalizeTracing(tstate); \
161+
_PyJit_FinalizeTracing(tstate); \
162162
stack_pointer = _PyFrame_GetStackPointer(frame); \
163163
} \
164164
} while (0);
@@ -451,7 +451,7 @@ do { \
451451
} \
452452
if (keep_tracing_bit) { \
453453
assert(next_instr->op.code != ENTER_EXECUTOR); \
454-
assert(tstate->interp->jit_state.jit_tracer_code_curr_size == 2); \
454+
assert(tstate->interp->jit_state.code_curr_size == 2); \
455455
ENTER_TRACING(); \
456456
} \
457457
DISPATCH(); \

Python/executor_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.

Python/generated_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.

0 commit comments

Comments
 (0)