Skip to content

resize_memory, memory_size, page_size: opcodes or intrinsic functions? #362

@AndrewScheidecker

Description

@AndrewScheidecker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions