Is there a reason for these to being special opcodes vs just being functions imported from some implementation-provided intrinsic module? I think there are three things to trade off here:
- It's simpler in my implementation, and I imagine most others to add an intrinsic function.
- A dedicated opcode is more efficient for encoding frequently used operations.
- It's simpler to dispatch dedicated opcodes if you want to generate machine code that's not just a call.
I think all three of these opcodes (resize_memory, memory_size, and page_size) could all be intrinsic functions with very little effect on size or speed, so I don't think it's worth having dedicated opcodes for these.