_PyStackRef *stackpointer;
uint16_t return_offset; /* Only relevant during a function call */
char owner;
- char visited;
+#ifdef Py_DEBUG
+ uint8_t visited:1;
+ uint8_t lltrace:7;
+#else
+ uint8_t visited;
+#endif
/* Locals and stack */
_PyStackRef localsplus[1];
} _PyInterpreterFrame;
_Py_CODEUNIT *target = _PyFrame_GetBytecode(frame) + exit->target;
#if defined(Py_DEBUG) && !defined(_Py_JIT)
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
- if (lltrace >= 2) {
+ if (frame->lltrace >= 2) {
printf("SIDE EXIT: [UOp ");
_PyUOpPrint(&next_uop[-1]);
printf(", exit %u, temp %d, target %d -> %s]\n",
_Py_CODEUNIT *target = frame->instr_ptr;
#if defined(Py_DEBUG) && !defined(_Py_JIT)
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
- if (lltrace >= 2) {
+ if (frame->lltrace >= 2) {
printf("DYNAMIC EXIT: [UOp ");
_PyUOpPrint(&next_uop[-1]);
printf(", exit %u, temp %d, target %d -> %s]\n",
#endif
uint8_t opcode; /* Current opcode */
int oparg; /* Current opcode argument, if any */
-#ifdef LLTRACE
- int lltrace = 0;
-#endif
_PyInterpreterFrame entry_frame;
entry_frame.owner = FRAME_OWNED_BY_INTERPRETER;
entry_frame.visited = 0;
entry_frame.return_offset = 0;
+#ifdef LLTRACE
+ entry_frame.lltrace = 0;
+#endif
/* Push frame */
entry_frame.previous = tstate->current_frame;
frame->previous = &entry_frame;
stack_pointer = _PyFrame_GetStackPointer(frame);
#ifdef LLTRACE
- lltrace = maybe_lltrace_resume_frame(frame, GLOBALS());
- if (lltrace < 0) {
- goto exit_unwind;
+ {
+ int lltrace = maybe_lltrace_resume_frame(frame, GLOBALS());
+ frame->lltrace = lltrace;
+ if (lltrace < 0) {
+ goto exit_unwind;
+ }
}
#endif
}
/* Resume normal execution */
#ifdef LLTRACE
- if (lltrace >= 5) {
+ if (frame->lltrace >= 5) {
lltrace_resume_frame(frame);
}
#endif
for (;;) {
uopcode = next_uop->opcode;
#ifdef Py_DEBUG
- if (lltrace >= 3) {
+ if (frame->lltrace >= 3) {
dump_stack(frame, stack_pointer);
if (next_uop->opcode == _START_EXECUTOR) {
printf("%4d uop: ", 0);
jump_to_error_target:
#ifdef Py_DEBUG
- if (lltrace >= 2) {
+ if (frame->lltrace >= 2) {
printf("Error: [UOp ");
_PyUOpPrint(&next_uop[-1]);
printf(" @ %d -> %s]\n",
next_instr = next_uop[-1].target + _PyFrame_GetBytecode(frame);
goto_to_tier1:
#ifdef Py_DEBUG
- if (lltrace >= 2) {
+ if (frame->lltrace >= 2) {
printf("DEOPT: [UOp ");
_PyUOpPrint(&next_uop[-1]);
printf(" -> %s]\n",
/* PRE_DISPATCH_GOTO() does lltrace if enabled. Normally a no-op */
#ifdef LLTRACE
-#define PRE_DISPATCH_GOTO() if (lltrace >= 5) { \
+#define PRE_DISPATCH_GOTO() if (frame->lltrace >= 5) { \
lltrace_instruction(frame, stack_pointer, next_instr, opcode, oparg); }
#else
#define PRE_DISPATCH_GOTO() ((void)0)
#if LLTRACE
#define LLTRACE_RESUME_FRAME() \
do { \
- lltrace = maybe_lltrace_resume_frame(frame, GLOBALS()); \
+ int lltrace = maybe_lltrace_resume_frame(frame, GLOBALS()); \
+ frame->lltrace = lltrace; \
if (lltrace < 0) { \
goto exit_unwind; \
} \
stack_pointer = _PyFrame_GetStackPointer(frame);
#if defined(Py_DEBUG) && !defined(_Py_JIT)
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
- if (lltrace >= 2) {
+ if (frame->lltrace >= 2) {
_PyFrame_SetStackPointer(frame, stack_pointer);
printf("SIDE EXIT: [UOp ");
_PyUOpPrint(&next_uop[-1]);
_Py_CODEUNIT *target = frame->instr_ptr;
#if defined(Py_DEBUG) && !defined(_Py_JIT)
OPT_HIST(trace_uop_execution_counter, trace_run_length_hist);
- if (lltrace >= 2) {
+ if (frame->lltrace >= 2) {
_PyFrame_SetStackPointer(frame, stack_pointer);
printf("DYNAMIC EXIT: [UOp ");
_PyUOpPrint(&next_uop[-1]);