Skip to content

Conversation

@markshannon
Copy link
Member

@markshannonmarkshannon commented Oct 30, 2023

This PR:

  • Generates the code to set next_instr correct at the start of the generated instruction, and (when needed) generates this_instr which points to the current instruction.
  • Ensures that all instructions have a this_instr variable pointing to the instruction, and next_instr actually points to the next instruction.
  • Uses this_instr throughout which means we don't need to do manual size calculations.

self.check_events(func, recorders = JUMP_AND_BRANCH_RECORDERS, expected = [
('branch', 'func', 2, 2),
('branch', 'func', 3, 4),
('branch', 'func', 3, 6),
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is now correct. See #109038 (comment)

('jump', 'func', 5, 5),
('jump', 'func', 5, '[offset=114]'),
('branch', 'func', '[offset=120]', '[offset=122]'),
('branch', 'func', '[offset=120]', '[offset=124]'),
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Likewise

@markshannonmarkshannon merged commit d27acd4 into python:mainOct 31, 2023
FullteaR pushed a commit to FullteaR/cpython that referenced this pull request Nov 3, 2023
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
@markshannonmarkshannon deleted the increment-next-instr-consistently branch August 6, 2024 10:17
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@markshannon@iritkatriel