Skip to content

Improve efficiency of fetching next opcode #39

@pliniker

Description

@pliniker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    data structuresArea: internal data structureseasyLittle experience and/or subject matter knowledge required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions