Skip to content

Encoding of opcodes #112

@fgmccabe

Description

@fgmccabe

The explainer introduces six instructions: cont.new, cont.bind, resume, resume_throw, suspend, switch.

While this is not a large number, it is more than 1. Furthermore, it is entirely possible that we will need to describe additional instructions.

At the moment, the opcodes 0xe0 through 0xe5 are also described.

The wasm opcode space is getting pretty crowded nowadays. (In fact, the above codes already conflict with some internal opcodes used within V8).

Also, since suspend/resume instructions are unlikely to be that frequent in the code, the code size argument does not seem pressing.

I would like to suggest using some space in one of the existing prefix groups: GC (0xfb), Numeric (0xfc), Simd (0xfd) or Atomic (0xfe).

The one with the most room is Numeric (last used sub-opcode 0x31) but maybe the one that makes most sense is GC (last used opcode is 0xb8)

Another suggestion made to me: have a specific 'experimental' prefix to be used by proposals until (just before) they reach phase 4.

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