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 enums for IR opcodes and value types #91

Closed Tacodiva closed 1 year ago

Tacodiva commented 1 year ago

Removed all the 'opcode' strings that have to be the same (like control.if) between irgen and jsgen and moves them into a shared enum. This also distinguishes between opcodes that are a part of stackable blocks (like pen.up) and reporter blocks (like timer.get), which will be useful in upcoming refactorings to the IR.

Additionally, I created an enum for types of values being passed around the compiler. This will be useful when moving type logic out of jsgen and into irgen.

This took me about 2.5 hours lmao, I tested a few projects and nothing seems to have changed. Really hope there are no mistakes.