Skip to content

Conversation

@gvanrossum
Copy link
Member

@gvanrossum gvanrossum commented Jul 15, 2023

Almost everything that used to go in operand now goes in oparg, except cache entries, which go into operand. This way a uop can have an oparg and a cache entry, which is much more convenient for splitting the more complex CALL specializations into uops. Most of the complexity (and debugging :-( ) went into optimizer.c.

As a side effect, without any extra work, we have four new viable uops:

  • STORE_ATTR (unspecialized, but still)
  • _LOAD_GLOBAL_MODULE
  • _LOAD_GLOBAL_BUILTINS
  • _LOAD_ATTR_INSTANCE_VALUE

The Python API (iterating over a uop executor) now returns triples (opname, oparg, operand).

Comment on lines -652 to +655
inst(STORE_SUBSCR, (counter/1, v, container, sub -- )) {
inst(STORE_SUBSCR, (unused/1, v, container, sub -- )) {
#if ENABLE_SPECIALIZATION
if (ADAPTIVE_COUNTER_IS_ZERO(counter)) {
_PyStoreSubscrCache *cache = (_PyStoreSubscrCache *)next_instr;
if (ADAPTIVE_COUNTER_IS_ZERO(cache->counter)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This change simply follows the vast majority of other unspecialized opcodes.

@gvanrossum
Copy link
Member Author

@markshannon Can you review this?

@gvanrossum gvanrossum merged commit 8e9a1a0 into python:main Jul 17, 2023
@gvanrossum gvanrossum deleted the add-oparg branch July 17, 2023 19:12
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.

2 participants