Skip to content

Commit e63de39

Browse files
working python startup
1 parent 13188a9 commit e63de39

File tree

5 files changed

+908
-7
lines changed

5 files changed

+908
-7
lines changed

Python/ceval.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,12 +975,12 @@ _PyObjectArray_Free(PyObject **array, PyObject **scratch)
975975

976976
// 1 for trace full, 0 for successful write.
977977
static int
978-
add_to_code_trace(PyThreadState *tstate, _PyInterpreterFrame *frame, _Py_CODEUNIT *this_instr, _Py_CODEUNIT *next_instr, int oparg)
978+
add_to_code_trace(PyThreadState *tstate, _PyInterpreterFrame *frame, PyCodeObject *old_code, _Py_CODEUNIT *this_instr, _Py_CODEUNIT *next_instr, int oparg)
979979
{
980980
assert(frame != NULL);
981981
assert(tstate->interp->jit_tracer_code_curr_size < UOP_MAX_TRACE_LENGTH);
982982
PyFunctionObject *func = (PyFunctionObject *)PyStackRef_AsPyObjectBorrow(frame->f_funcobj);
983-
return !_PyJIT_translate_single_bytecode_to_trace(tstate, this_instr, next_instr, _PyFrame_GetCode(frame), func, oparg);
983+
return !_PyJIT_translate_single_bytecode_to_trace(tstate, this_instr, next_instr, old_code, func, oparg);
984984
}
985985

986986
/* _PyEval_EvalFrameDefault is too large to optimize for speed with PGO on MSVC.
@@ -1193,10 +1193,9 @@ _PyTier2Interpreter(
11931193
assert(next_uop->opcode == _START_EXECUTOR || next_uop->opcode == _COLD_EXIT);
11941194
tier2_dispatch:
11951195
for (;;) {
1196-
frame->lltrace = 4;
11971196
uopcode = next_uop->opcode;
11981197
#ifdef Py_DEBUG
1199-
if (1 && next_uop->opcode != _YIELD_VALUE) {
1198+
if (frame->lltrace >= 4 && next_uop->opcode != _YIELD_VALUE) {
12001199
// dump_stack(frame, stack_pointer);
12011200
if (next_uop->opcode == _START_EXECUTOR) {
12021201
printf("%4d uop: ", 0);

Python/ceval_macros.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
DISPATCH();
145145
# define RECORD_TRACE() do { \
146146
frame->instr_ptr = next_instr; \
147-
if (add_to_code_trace(tstate, frame, this_instr, next_instr, oparg)) { \
147+
if (add_to_code_trace(tstate, frame, old_code, this_instr, next_instr, oparg)) { \
148148
BAIL_TRACING(); \
149149
} \
150150
} while (0);

0 commit comments

Comments
 (0)