faster-cpython / ideas

1.67k stars 49 forks source link

Combine SAVE_IP and SAVE_CURRENT_IP into a new uop #624

Closed gvanrossum closed 10 months ago

gvanrossum commented 10 months ago

See https://github.com/faster-cpython/ideas/issues/621#issuecomment-1712697869:

Now, there's an explicit SAVE_CURRENT_IP in some macros (before every _POP_FRAME and _PUSH_FRAME). That's because it also acts as a flag for the code generator, which, combined with the preceding SAVE_IP, makes it effectively save a pointer to the next instruction (which is what's needed by the frame push/pop uops). But there's so much special-casing here that we might as well either introduce a new uop for the combined special effects or special-case _POP_FRAME and _PUSH_FRAME.

Also rename SAVE_IP to SET_IP (from the same issue).

gvanrossum commented 10 months ago

Sorry, meant to create this in cpython. See https://github.com/python/cpython/issues/109214.