Skip to content

What should the family be of a super-instruction in our DSL? #495

Open
@gvanrossum

Description

@gvanrossum

It looks like "families" have a double meaning: they server to map specialized/super instructions back to their "base" instruction, and they are used to double check that all family members have the same cache and stack effects. From the DSL spec it appeared that the latter was the most important, so I only implemented that, but found out that super-instructions are also in the families as defined by opcode.py (_specializations).

ISTM that super-instructions shouldn't be required to have the same stack/cache effects as their first constituent -- their effects should be the combination of all constituents. The table that maps these back to their base can be generated separately from the super-instruction definitions (e.g., LOAD_FAST__LOAD_CONST clearly maps to LOAD_FAST).

I also finally realized there are some pseudo-super-instructions (e.g. BINARY_OP_INPLACE_ADD_UNICODE). These behave like super-instructions in that they skip the next opcode, but are not generated using super(X) = Y + Z; -- instead, they use an explicit code block. We might be able to define these as proper super-instructions constructed from constituent parts where the second part is a dummy that ends up shrinking the stack but does nothing else. I'll play with this.

Sorry for the ramble. Thanks to @brandtbucher for clearing up some of my confusion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic-generatorDSL-based code generator for the interpreter(s)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions