Skip to content
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

Improve efficiency of fetching next opcode #39

Open
pliniker opened this issue Sep 11, 2020 · 0 comments
Open

Improve efficiency of fetching next opcode #39

pliniker opened this issue Sep 11, 2020 · 0 comments
Labels
data structures Area: internal data structures easy Little experience and/or subject matter knowledge required

Comments

@pliniker
Copy link
Member

pliniker commented Sep 11, 2020

See interpreter/src/bytecode.rs:293 - multiple dereferences required to fetch a single opcode.

Ideal state: an instruction pointer that is a pointer to the next opcode.

Realistically: that might not be sensible, given that we probably want to retain bounds checking; what about extending Array with a RefCell-style ArrayOpcode slice borrow? That's as close to bare pointer in safe Rust as we can get.

Files:

  • interpreter/src/bytecode.rs:293
  • booksrc/chapter-interp-bytecode.md
@pliniker pliniker added easy Little experience and/or subject matter knowledge required data structures Area: internal data structures labels Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data structures Area: internal data structures easy Little experience and/or subject matter knowledge required
Projects
None yet
Development

No branches or pull requests

1 participant