WebAssembly.jl icon indicating copy to clipboard operation
WebAssembly.jl copied to clipboard

Add opcodes. In progress...

Open EricForgy opened this issue 6 years ago • 2 comments

There might be a better way, but just throwing something out there to get started.

The idea is to have every Instruction have an opcode field so we can write to bytecode via

Base.write(io::IO,is::Instruction) = write(io,is.opcode)

#2

EricForgy avatar Mar 25 '18 12:03 EricForgy

With my early iterations of of this PR, it made some sense to have opcode be a field for each Instrument but now that I have the opcodes Dict, it might be better to remove them and handle everything from the write methods. I think that is how you intended.

If you think it is better NOT to have an opcode for each Instruction, let me know and I'll see about trying again (time permitting).

EricForgy avatar Mar 25 '18 15:03 EricForgy

Yeah, I think it's better to not have the opcode field (consider that it doesn't vary per Return object etc). You'll also have to handle things in a function for things that do vary, like Constant.

MikeInnes avatar Apr 16 '18 16:04 MikeInnes