gh-112383: teach dis how to interpret ENTER_EXECUTOR (#117171)

This commit is contained in:
Irit Katriel 2024-03-23 22:32:33 +00:00 committed by GitHub
parent 6c83352bfe
commit d610d821fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 120 additions and 50 deletions

View file

@ -1201,19 +1201,10 @@ class DisTests(DisTestBase):
@cpython_only
@requires_specialization
def test_loop_quicken(self):
import _testinternalcapi
# Loop can trigger a quicken where the loop is located
self.code_quicken(loop_test, 1)
self.code_quicken(loop_test, 4)
got = self.get_disassembly(loop_test, adaptive=True)
expected = dis_loop_test_quickened_code
if _testinternalcapi.get_optimizer():
# We *may* see ENTER_EXECUTOR in the disassembly. This is a
# temporary hack to keep the test working until dis is able to
# handle the instruction correctly (GH-112383):
got = got.replace(
"ENTER_EXECUTOR 16",
"JUMP_BACKWARD 16 (to L1)",
)
self.do_disassembly_compare(got, expected)
@cpython_only