Skip to content

Conversation

@Fidget-Spinner
Copy link
Member

@Fidget-Spinner Fidget-Spinner commented Dec 26, 2025

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
@tomasr8 tomasr8 self-requested a review December 28, 2025 19:03
Copy link
Member

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some nits, otherwise looks good!

// gh-143183: It's important we rewind to the last known proper target.
// The current target might be garbage as stop tracing usually indicates
// we are in something that we can't trace.
goto unsupported;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth to add a DPRINTF() here? All the other goto unsupported have it

if (opcode == BINARY_OP_SUBSCR_GETITEM && old_stack_level + 1 > old_code->co_stacksize) {
unsupported:
{
// Rewind to previous instruction and replace with _EXIT_TRACE.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Rewind to previous instruction and replace with exit_op.

except StopIteration:
break
for _ in range({TIER2_THRESHOLD // 40}):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, does the number of iterations depend on TIER2_THRESHOLD? Why specifically 40?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's too high, the test takes forever to run. So this just makes sure we have a number high enough that triggers without taking too long.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: Assertion failure in stopiteration_error

3 participants