Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.10] bpo-45116: Shrink interpreter by targetted revert of #25244 #28475

Merged
merged 1 commit into from
Sep 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,21 +1297,20 @@ eval_frame_handle_pending(PyThreadState *tstate)

#if USE_COMPUTED_GOTOS
#define TARGET(op) op: TARGET_##op
#define DISPATCH_GOTO() goto *opcode_targets[opcode]
#else
#define TARGET(op) op
#define DISPATCH_GOTO() goto dispatch_opcode
#endif

#define DISPATCH() \
{ \
if (trace_info.cframe.use_tracing OR_DTRACE_LINE OR_LLTRACE) { \
goto tracing_dispatch; \
} \
f->f_lasti = INSTR_OFFSET(); \
NEXTOPARG(); \
DISPATCH_GOTO(); \
goto *opcode_targets[opcode]; \
}
#else
#define TARGET(op) op
#define DISPATCH() goto predispatch;
#endif


#define CHECK_EVAL_BREAKER() \
if (_Py_atomic_load_relaxed(eval_breaker)) { \
Expand Down Expand Up @@ -1827,7 +1826,16 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
}
}
#endif
#if USE_COMPUTED_GOTOS == 0
goto dispatch_opcode;

predispatch:
if (trace_info.cframe.use_tracing OR_DTRACE_LINE OR_LLTRACE) {
goto tracing_dispatch;
}
f->f_lasti = INSTR_OFFSET();
NEXTOPARG();
#endif
dispatch_opcode:
#ifdef DYNAMIC_EXECUTION_PROFILE
#ifdef DXPAIRS
Expand Down