Skip to content

New faster interpreter based on instruction objects and operands.#2426

Draft
aardvark179 wants to merge 27 commits into
mozilla:masterfrom
aardvark179:aardvark179-interpreterv2
Draft

New faster interpreter based on instruction objects and operands.#2426
aardvark179 wants to merge 27 commits into
mozilla:masterfrom
aardvark179:aardvark179-interpreterv2

Conversation

@aardvark179

Copy link
Copy Markdown
Contributor

This change implements a new interpreter based on Instruction objects rather than byte codes. Instructions generally have one or two operands which express where they get their data from (literal values, variables, or the stack). Currently all instructions that produce results put those results on the stack, but in the future the operands concept could be extended to where the result is placed and provide further improvements.

This design provides significant performance improvements over the old interpreter (see benchmarks in #2416 ) in return for a slightly increased memory overhead. This overhead is less than might be expected because operand objects can be heavily reused, fewer instructions are usually required for the V2 interpreter, and the byte code itself is often only a portion of the overall foot print of interpreted functions compared to constants, metadata, etc.

While upstreaming this work I've taken the opportunity to remove a lot of duplication between the two interpreters as inconsistencies between these were the source of a few issues while rebasing this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant