Skip to content

Will-Never-Use Opcode? #687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BSalita opened this issue May 12, 2016 · 3 comments
Closed

Will-Never-Use Opcode? #687

BSalita opened this issue May 12, 2016 · 3 comments
Milestone

Comments

@BSalita
Copy link

BSalita commented May 12, 2016

Does WebAssembly have an opcode number that is guaranteed to never be used? This would be valuable to compiler writers who want to experiment with new opcodes and features. The experimental compiler would be paired with a corresponding interpreter.

The opcode could be followed by a length that tells the interpreter where to restart interpretation.

@BSalita BSalita changed the title Will-Never-Use Opcode Will-Never-Use Opcode? May 12, 2016
@distransient
Copy link

distransient commented May 12, 2016

There is discussion to make 0x00 unreachable here: #683 & #684 (it's currently 0x0a)

Right now there are no opcodes that are guaranteed to not be assigned an operation in the future. (beside unreachable and nop)

@sunfishcode
Copy link
Member

A significant idea that's being discussed in a variety of places is that of an opcode table, which would be a table in a wasm module that declares a mapping from numbers to strings, with the strings holding opcode names, and then the binary code would refer to these operators by number.

The opcode table would be more flexible than a single fixed reserved opcode range, because adding new opcodes would just be a matter of making up new names for them and adding them to the table in a wasm module that wants to use them. In particular, two people working independently on unrelated features would be likely to pick different names for their opcodes, so their extensions would be more likely to be compatible with each other than if they both used opcodes from the same fixed reserved range.

@sunfishcode sunfishcode added this to the MVP milestone Jul 12, 2016
@flagxor
Copy link
Member

flagxor commented Jul 30, 2016

Implementors have discussed this and decided not to explicitly reserve an opcode for this purpose for the MVP timeframe.

@flagxor flagxor closed this as completed Jul 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants