TurboWarp / scratch-vm

Scratch VM with a JIT compiler and more features
https://turbowarp.org/
Mozilla Public License 2.0
75 stars 72 forks source link

Create classes for IR stack blocks and inputs #92

Closed Tacodiva closed 1 year ago

Tacodiva commented 1 year ago

Creates two new classes IntermediateStack and IntermediateInput to replace Node. Right now these two classes almost the same, they contain an opcode and an object of inputs that contains all the values the Node type used to contain (other than kind).

In the next PR type information will be attached to IntermediateInput (so it can replace jsgen's TypedInput, VariableInput and ConstantInput) and eventually more complex type analysis info will be attached to IntermediateStack so they should be two separate classes.

Additionally, renamed the enums to StackOpcode and InputOpcode to better reflect their purpose.